:root{--bg:#f6f5f2;--surface:#fff;--surface-2:#eeece7;--text:#1d1f23;--muted:#62666e;--border:#dcd9d2;--accent:#3d5a80;--accent-text:#fff;--accent-soft:#dbe5f0;--ok:#2e7d4f;--ok-soft:#dcefe3;--bad:#b3261e;--bad-soft:#f7dedc;--hard:#a35c00;--radius:14px;--shadow:0 1px 2px #0000000f, 0 2px 8px #0000000d;--tabbar-h:64px;--safe-top:env(safe-area-inset-top,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px);--safe-right:env(safe-area-inset-right,0px);--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light dark}@media (prefers-color-scheme:dark){:root{--lightningcss-light: ;--lightningcss-dark:initial;--bg:#16171a;--surface:#212327;--surface-2:#2b2e33;--text:#ececef;--muted:#a1a5ad;--border:#3a3d43;--accent:#8fb3dc;--accent-text:#10223a;--accent-soft:#283a50;--ok:#74c69d;--ok-soft:#1f3a2b;--bad:#f28b82;--bad-soft:#452523;--hard:#f0b45a;--shadow:none}}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%;text-size-adjust:100%}body{background:var(--bg);color:var(--text);-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none;margin:0;font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif}a{color:var(--accent)}h1,h2,h3{margin:0;line-height:1.2}p{margin:.5em 0}svg{fill:none;stroke:currentColor;stroke-width:2px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:22px;height:22px}.sr-only{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.muted{color:var(--muted)}.small{font-size:.875rem}.center{text-align:center}.prewrap{white-space:pre-wrap}.error{color:var(--bad);background:var(--bad-soft);border-radius:10px;padding:8px 12px}.ok{color:var(--ok)}.hint{color:var(--muted);text-align:center;margin:4px 0 0;font-size:.85rem}.lead{color:var(--muted)}.app{min-height:100dvh;padding-left:var(--safe-left);padding-right:var(--safe-right)}main{padding-bottom:calc(var(--tabbar-h) + var(--safe-bottom) + 16px)}.app.focus main{padding-bottom:0}.page{max-width:760px;padding:calc(var(--safe-top) + 8px) 16px 16px;flex-direction:column;gap:14px;margin:0 auto;display:flex}.topbar{grid-template-columns:44px 1fr auto;align-items:center;gap:8px;min-height:52px;display:grid}.topbar h1{text-overflow:ellipsis;white-space:nowrap;font-size:1.25rem;overflow:hidden}.topbar-spacer{width:44px}.topbar-right{justify-content:flex-end;display:flex}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:16px}.section-title{margin-bottom:8px;font-size:1rem}.subhead{margin:18px 0 4px;font-size:.95rem}.stack{flex-direction:column;gap:10px;display:flex}.button-row{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.confirm-row{flex-wrap:wrap;gap:8px;display:flex}.danger-zone{border-top:1px solid var(--border);margin-top:16px;padding-top:16px}.btn{appearance:none;border:1px solid var(--border);background:var(--surface);min-height:44px;color:var(--text);font:inherit;cursor:pointer;-webkit-user-select:none;user-select:none;touch-action:manipulation;border-radius:12px;justify-content:center;align-items:center;gap:8px;padding:10px 18px;font-weight:600;text-decoration:none;transition:background .15s,transform 50ms;display:inline-flex}.btn:hover{background:var(--surface-2)}.btn:active{transform:scale(.98)}.btn:disabled,.btn[aria-disabled=true]{opacity:.5;pointer-events:none}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.btn.primary:hover{filter:brightness(1.08)}.btn.danger{color:var(--bad);border-color:var(--bad);background:0 0}.btn.link{color:var(--accent);background:0 0;border:none;justify-content:flex-start;min-height:36px;padding:6px 0;font-weight:500}.btn.small{min-height:36px;padding:6px 14px;font-size:.9rem}.btn.big{min-height:56px;font-size:1.05rem}.btn.wide{width:100%}.icon-btn{appearance:none;width:44px;height:44px;color:var(--text);cursor:pointer;background:0 0;border:none;border-radius:50%;place-items:center;display:grid}.icon-btn:hover{background:var(--surface-2)}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}label{flex-direction:column;gap:4px;font-size:.9rem;font-weight:600;display:flex}label.inline{flex-direction:row;justify-content:space-between;align-items:center}label.inline input{width:90px}.label{color:var(--muted);text-transform:uppercase;letter-spacing:.03em;margin-right:6px;font-size:.8rem;font-weight:600}.field{flex-direction:column;gap:6px;display:flex}input,textarea,select{font:inherit;color:var(--text);background:var(--surface);border:1px solid var(--border);border-radius:10px;width:100%;min-height:44px;padding:10px 12px;font-size:16px;font-weight:400}textarea{resize:vertical}.row2{grid-template-columns:1fr 1fr;gap:10px;display:grid}.row-form{gap:8px;display:flex}.row-form input{flex:1;min-width:0}.form-actions{gap:10px;margin-top:4px;display:flex}.chips{flex-wrap:wrap;gap:8px;display:flex}.chip{appearance:none;border:1px solid var(--border);background:var(--surface);color:var(--text);min-height:36px;font:inherit;cursor:pointer;border-radius:999px;padding:6px 14px;font-size:.9rem}.chip.on{background:var(--accent-soft);border-color:var(--accent);color:var(--text);font-weight:600}.chip-date{color:var(--muted);font-weight:400}.tabbar{z-index:10;height:calc(var(--tabbar-h) + var(--safe-bottom));padding:0 calc(8px + var(--safe-right)) var(--safe-bottom) calc(8px + var(--safe-left));background:color-mix(in srgb, var(--surface) 92%, transparent);-webkit-backdrop-filter:blur(12px);border-top:1px solid var(--border);justify-content:space-around;align-items:center;display:flex;position:fixed;bottom:0;left:0;right:0}.tab{max-width:120px;color:var(--muted);flex-direction:column;flex:1;align-items:center;gap:2px;padding:6px 0;font-size:.72rem;font-weight:600;text-decoration:none;display:flex}.tab[aria-current=page]{color:var(--accent)}.tab-primary svg{background:var(--accent);color:var(--accent-text);border-radius:50%;width:34px;height:34px;padding:7px}@media (width>=900px){.app:not(.focus){padding-left:calc(96px + var(--safe-left))}.tabbar{width:calc(96px + var(--safe-left));height:auto;padding:calc(24px + var(--safe-top)) 0 0 var(--safe-left);border-top:none;border-right:1px solid var(--border);flex-direction:column;justify-content:flex-start;gap:8px;top:0;right:auto}.tab{border-radius:12px;flex:none;width:80px;padding:10px 0}.tab:hover{background:var(--surface-2)}main{padding-bottom:32px}}.sync-badge{color:var(--muted);background:var(--surface-2);white-space:nowrap;border-radius:999px;align-items:center;gap:6px;padding:4px 10px;font-size:.78rem;font-weight:600;text-decoration:none;display:inline-flex}.sync-badge .dot{background:var(--muted);border-radius:50%;width:8px;height:8px}.sync-idle .dot{background:var(--ok)}.sync-syncing .dot{background:var(--accent);animation:1s infinite alternate pulse}.sync-error .dot,.sync-session-expired .dot{background:var(--bad)}@keyframes pulse{to{opacity:.3}}.home-head{justify-content:space-between;align-items:center;min-height:52px;display:flex}.home-head h1{font-size:1.4rem}.study-summary{text-align:center;flex-direction:column;align-items:center;gap:4px;padding:24px 16px;display:flex}.study-summary .btn{min-width:220px;margin-top:10px}.big-number{margin:0;font-size:3.2rem;font-weight:700;line-height:1}.event-card{color:var(--text);border-color:var(--accent);justify-content:space-between;align-items:center;gap:12px;text-decoration:none;display:flex}.nudge p{margin-top:0}.quick-actions{grid-template-columns:1fr 1fr;gap:10px;display:grid}.welcome{flex-direction:column;gap:12px;padding:24px;display:flex}.welcome h2{font-size:1.4rem}.recent{scroll-snap-type:x mandatory;gap:12px;margin:0;padding:0 0 4px;list-style:none;display:flex;overflow-x:auto}.recent li{scroll-snap-align:start}.recent a{width:84px;color:var(--text);text-align:center;flex-direction:column;gap:4px;font-size:.8rem;text-decoration:none;display:flex}.recent .photo{border-radius:10px;width:84px;height:105px}.install-help p{margin-top:0}.inline-icon{vertical-align:-3px;width:18px;height:18px}.photo{object-fit:cover;background:var(--surface-2);aspect-ratio:4/5;width:100%;display:block}.photo-missing{color:var(--muted);place-items:center;display:grid}.photo-missing svg{stroke-width:1.2px;width:40%;height:40%}.filters{gap:8px;display:flex}.filters select{width:auto;max-width:45%}.grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px;margin:0;padding:0;list-style:none;display:grid}.tile{color:var(--text);flex-direction:column;gap:2px;text-decoration:none;display:flex}.tile .photo{border-radius:12px;margin-bottom:4px}.tile-name{font-weight:600;line-height:1.25}.tile-sub{color:var(--muted);text-overflow:ellipsis;white-space:nowrap;font-size:.8rem;overflow:hidden}.list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.list-item{background:var(--surface);border:1px solid var(--border);color:var(--text);border-radius:12px;align-items:center;gap:12px;padding:12px 16px;text-decoration:none;display:flex}.list-item.check{cursor:pointer;flex-direction:row;font-weight:400}.list-item.check input{flex:none;width:22px;height:22px;min-height:0}.list-main{flex-direction:column;flex:1;min-width:0;display:flex}.thumb{border-radius:8px;flex:none;width:40px;height:50px}.plain{margin:0;padding:0;list-style:none}.passkey{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:6px 0;display:flex}.empty{text-align:center;color:var(--muted);flex-direction:column;align-items:center;gap:12px;padding:32px 0;display:flex}.photo-strip{gap:10px;padding-bottom:4px;display:flex;overflow-x:auto}.strip-item{flex:none;width:160px;position:relative}.strip-item .photo{border-radius:12px}.strip-remove{color:#fff;cursor:pointer;background:#0000008c;border:none;border-radius:50%;width:32px;height:32px;font-size:20px;line-height:1;position:absolute;top:6px;right:6px}.strip-add{aspect-ratio:4/5;border:2px dashed var(--border);width:120px;color:var(--muted);border-radius:12px;flex-direction:column;flex:none;justify-content:center;align-items:center;gap:4px;font-size:.85rem;font-weight:600;text-decoration:none;display:flex}.strip-add span{font-size:28px;line-height:1}.details p{margin:6px 0}.add-start{flex-direction:column;gap:12px;width:100%;max-width:420px;margin:16px auto;display:flex}.add-layout{flex-direction:column;gap:16px;display:flex}.add-form{flex-direction:column;gap:12px;display:flex}@media (width>=700px){.add-layout{grid-template-columns:minmax(260px,340px) 1fr;align-items:start;display:grid}}.cropper{width:100%;max-width:340px;margin:0 auto}.crop-frame{aspect-ratio:4/5;touch-action:none;cursor:grab;-webkit-user-select:none;user-select:none;background:#222;border-radius:16px;width:100%;position:relative;overflow:hidden}.crop-frame:active{cursor:grabbing}.crop-frame img{transform-origin:0 0;pointer-events:none;max-width:none;position:absolute;top:0;left:0}.crop-guide{pointer-events:none;border:2px dashed #ffffffb3;border-radius:50%;position:absolute;inset:12% 20% 22%}.crop-loading{color:#ddd;place-items:center;height:100%;display:grid}.zoom-row{flex-direction:row;align-items:center;gap:10px;margin-top:10px;font-size:1.2rem}.zoom-row input{min-height:0;accent-color:var(--accent);background:0 0;border:none;padding:0}.study{max-width:560px;min-height:100dvh;padding:calc(var(--safe-top) + 4px) 16px calc(var(--safe-bottom) + 16px);flex-direction:column;gap:12px;margin:0 auto;display:flex}.study-top{justify-content:space-between;align-items:center;display:flex}.study-card{flex-direction:column;flex:1;align-items:center;gap:10px;display:flex}.study-photo{width:min(100%,360px,80dvh - 264px);min-width:200px;box-shadow:var(--shadow);border-radius:18px}.study-photo.compact{width:min(100%,260px,80dvh - 344px);min-width:150px}.prompt{color:var(--muted);margin:4px 0;font-size:1.1rem}.prompt.big{color:var(--text);text-align:center;margin-top:24px;font-size:1.5rem;font-weight:700}.reveal{text-align:center}.name{font-size:1.7rem}.badge-new{background:var(--accent-soft);color:var(--text);border-radius:999px;margin:0 0 6px;padding:2px 10px;font-size:.8rem;font-weight:700;display:inline-block}.pron{color:var(--muted);margin:2px 0;font-style:italic}.context{margin:4px 0}.notes{color:var(--muted);white-space:pre-wrap;font-size:.9rem}.study-actions{flex-direction:column;gap:10px;display:flex}.grades{grid-template-columns:repeat(4,1fr);gap:8px;display:grid}.grades.two{grid-template-columns:1fr 1fr}.grade{flex-direction:column;gap:0;min-height:60px;padding:6px}.grade small{color:var(--muted);font-size:.75rem;font-weight:500}.grade-1{color:var(--bad)}.grade-2{color:var(--hard)}.grade-3{color:var(--ok)}.grade-4{color:var(--accent)}.name-options{grid-template-columns:1fr;gap:8px;display:grid}@media (width>=480px){.name-options{grid-template-columns:1fr 1fr}}.face-options{grid-template-columns:1fr 1fr;gap:10px;width:100%;max-width:420px;margin:0 auto;display:grid}.option{appearance:none;font:inherit;color:var(--text);background:var(--surface);border:2px solid var(--border);cursor:pointer;text-align:left;border-radius:14px;align-items:center;gap:10px;min-height:52px;padding:8px 12px;font-weight:600;display:flex;position:relative}.face-options .option{flex-direction:column;gap:0;padding:0;overflow:hidden}.option kbd{font:inherit;color:var(--muted);border:1px solid var(--border);border-radius:6px;padding:0 6px;font-size:.75rem}@media (pointer:coarse){.option kbd{display:none}}.option.right{border-color:var(--ok);background:var(--ok-soft)}.option.wrong{border-color:var(--bad);background:var(--bad-soft)}.option.dim{opacity:.5}.option:disabled{cursor:default}.option-name{text-align:center;padding:6px;font-size:.85rem}.chosen-feedback{text-align:center;flex-direction:column;gap:6px;display:flex}.chosen-feedback .bad{color:var(--bad);font-weight:600}.chosen-feedback .ok{font-weight:700}.done-body{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px 0;display:flex}.done-body .stack{min-width:240px;margin-top:16px}.progress{background:var(--surface-2);border-radius:3px;height:6px;overflow:hidden}.progress div{background:var(--ok);height:100%;transition:width .3s}@media (orientation:landscape) and (height<=500px){.study{max-width:900px}.study-card{flex-direction:row;justify-content:center;gap:24px}.study-photo{width:auto;min-width:0;height:calc(100dvh - 170px)}}.stat-grid{grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:10px;display:grid}.stat{flex-direction:column;gap:2px;display:flex}.stat-value{font-size:1.8rem;font-weight:700}.stat-label{color:var(--muted);font-size:.85rem}.forecast{grid-template-columns:repeat(7,1fr);align-items:end;gap:6px;height:160px;display:grid}.forecast-col{flex-direction:column;justify-content:flex-end;align-items:center;gap:4px;height:100%;display:flex}.forecast-bar{background:var(--accent);border-radius:4px 4px 0 0;width:70%;min-height:2px}.forecast-n{font-size:.8rem;font-weight:600}.forecast-day{color:var(--muted);font-size:.75rem}.recovery h3{margin-bottom:4px}.code{letter-spacing:.05em;background:var(--surface-2);word-break:break-all;-webkit-user-select:all;user-select:all;border-radius:10px;margin:10px 0;padding:12px;font:600 1.1rem ui-monospace,SFMono-Regular,Menlo,monospace;display:block}@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}@media (width<=360px){.row2{grid-template-columns:1fr}.grades{grid-template-columns:1fr 1fr}}
