@font-face{font-family:Inter;src:url('./inter.woff2') format('woff2');font-style:normal;font-weight:400 700;font-display:swap}
:root{--bg:#f5f5fa;--card:#fff;--text:#171b37;--muted:#525771;--primary:#3d4eae;--on-primary:#fff;--subtle:#e3e7ff;--link:#34449b;--border:#3d4eae;--divider:#e3e7ff;color-scheme:light}
:root[data-theme=dark]{--bg:#101321;--card:#191e31;--text:#f0f1fa;--muted:#b9c0d8;--primary:#a9b4ff;--on-primary:#171b37;--subtle:#293354;--link:#bcc6ff;--border:#6877ac;--divider:#333d5c;color-scheme:dark}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--text);font:16px/1.45 Inter,system-ui,sans-serif}
a{color:var(--link);text-decoration:none}
p,h1,h2,h3{margin:0}
h1{font-size:46px;line-height:1.16}
h2{font-size:22px;line-height:1.3}
h3{font-size:16px}
button,input{font:inherit}
button,.button{border:0;border-radius:8px;min-height:44px;padding:0 12px;color:var(--link);background:var(--card);font-size:15px;font-weight:600;cursor:pointer}
button:hover,.button:hover,nav a:hover{filter:brightness(.95)}
button:disabled{opacity:.65;cursor:wait}
:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.primary{background:var(--primary);color:var(--on-primary)}
.subtle{background:var(--subtle)}
input:not([type=checkbox]):not([type=file]){border:0;border-radius:8px;background:var(--bg);color:var(--text);padding:0 12px;width:100%;min-width:0;min-height:44px}
input::placeholder{color:var(--muted);opacity:1}
.sidebar{position:fixed;inset:0 auto 0 0;width:216px;padding:24px;background:var(--card);display:flex;flex-direction:column;gap:32px}
.sidebar::after{content:"";position:absolute;inset:0 0 0 auto;width:1px;background:var(--border);pointer-events:none}
.brand{font-size:28px;line-height:34px;font-weight:700}
nav{display:flex;flex-direction:column;gap:8px}
nav a{min-height:44px;padding:8px;border-radius:8px;display:grid;place-items:center;color:var(--muted);font-weight:600}
nav a[aria-current=page]{background:var(--subtle);color:var(--link)}
main{margin-left:216px;padding:32px;display:grid;gap:24px}
header{display:flex;justify-content:space-between;align-items:center;gap:8px}
#date-label{margin-top:4px;color:var(--muted)}
.header-actions,.entry,.card-head,.theme-row{display:flex;align-items:center;gap:8px}
.header-actions{flex:none}
.header-actions button{border:1px solid var(--border)}
.settings-icon{display:none}
.stack,.dashboard,.column{display:grid;align-content:start;gap:16px;min-width:0}
.stack{gap:24px}
.dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}
.card{background:var(--card);border:1px solid var(--border);border-radius:12px;padding:22px 23px;display:grid;gap:10px;min-width:0}
.card-head,.entry,.theme-row{justify-content:space-between}
.theme-row{flex-wrap:wrap}
.theme-row .segment{max-width:100%;flex-wrap:wrap;gap:4px}
.theme-row .segment button{padding-inline:8px;font-size:13px;line-height:16px}
.card-head a{font-size:15px;font-weight:600;white-space:nowrap}
.quick{gap:12px;padding:23px}
.quick .field{min-width:0;font-size:13px;line-height:16px}
.quick .field input{color:var(--muted)}
.quick>button{justify-self:start}
.segment{display:inline-flex;justify-self:start;align-items:center;background:var(--bg);border-radius:8px;padding:4px}
.segment button{background:transparent;min-height:36px}
.segment button[aria-pressed=true]{background:var(--primary);color:var(--on-primary)}
.category{gap:4px;max-width:100%}
.category button{width:108px;min-width:0}
.entry>div{min-width:0;overflow-wrap:anywhere}
.entry+.entry,.history-day+.history-day{border-top:1px solid var(--divider);padding-top:10px;margin-top:10px}
.entry-edit{padding:0;min-height:0;background:none;color:var(--text);font:inherit;font-weight:600;text-align:left;overflow-wrap:anywhere}
.badge{flex:none;border-radius:8px;padding:4px 8px;background:var(--subtle);color:var(--link);font-size:13px;font-weight:600}
.badge.neutral{background:var(--bg);color:var(--muted)}
.meta{color:var(--muted);font-size:15px}
.reading{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.reading strong{font-size:36px;line-height:1.3}
.self-start{justify-self:start}
.count{font-weight:600;color:var(--link)}
.dose{display:flex;align-items:center;gap:12px;font-weight:600;min-height:48px;cursor:pointer;overflow-wrap:anywhere}
.dose+.dose{border-top:1px solid var(--divider);padding-top:12px;margin-top:10px;min-height:59px}
.dose input{appearance:none;margin:0;flex:none;width:28px;height:28px;border-radius:8px;background:var(--subtle);cursor:pointer;display:grid;place-items:center}
.dose input:checked{background:var(--primary);color:var(--on-primary)}
.dose input:checked::before{content:'✓'}
.history-day h3{margin-bottom:6px}
.history-day .entry+.entry{border:0;margin-top:4px;padding:0}
#notice{padding:10px 12px;border-radius:8px;background:var(--subtle);color:var(--link)}
dialog{
  color:var(--text);
  background:var(--card);
  width:min(348px,calc(100% - 32px));
  max-height:calc(100% - 32px);
  border:1px solid var(--border);
  border-radius:12px;
  padding:19px;
  box-shadow:0 6px 12px rgb(23 27 55 / 12%),0 16px 36px rgb(23 27 55 / 22%);
}
:root[data-theme=dark] dialog{box-shadow:0 6px 12px rgb(0 0 0 / 32%),0 16px 36px rgb(0 0 0 / 50%)}
dialog::backdrop{background:#10132170}
.settings-dialog h3{line-height:20px}
.settings-dialog .dialog-head button{width:37px;padding-inline:0}
.settings-dialog .dialog-body>button{font-size:13px}
.settings-dialog #offline-status{margin-top:8px}
.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-bottom:16px}
.dialog-head h2{font-size:24px}
.dialog-head button{font-size:20px}
.dialog-body,.fields,.field{display:grid;gap:8px}
.fields{gap:16px}
.field{font-size:14px;gap:4px;font-weight:600}
.field input{font-weight:400}
.pair{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
hr{border:0;border-top:1px solid var(--divider);margin:8px 0}
.dialog-message{font-size:14px;color:var(--muted)}
.dialog-message:empty{display:none}
@media(max-width:1023px){
.sidebar{position:relative;width:auto;padding:12px 24px;flex-direction:row;align-items:center;justify-content:space-between;gap:12px}
.sidebar::after{inset:auto 0 0;width:auto;height:1px}
nav{flex-direction:row}
nav a{padding-inline:14px}
main{margin:0;padding:24px}
.quick{padding:15px}
.quick>button{justify-self:stretch}
}
@media(max-width:639px){
body{font-size:14px}
.sidebar{position:fixed;inset:auto 0 0;width:100%;padding:4px 8px max(4px,env(safe-area-inset-bottom));min-height:64px;z-index:1}
.sidebar::after{inset:0 0 auto}
.brand,.settings-label{display:none}
.settings-icon{display:inline;font-size:20px}
nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;width:100%}
nav a{font-size:12px;padding-inline:2px}
main{padding:20px 16px calc(84px + env(safe-area-inset-bottom));gap:16px}
h1{font-size:32px}
h2{font-size:20px}
button,.button,.card-head a,.meta{font-size:13px}
#date-label{margin-top:4px}
.dashboard{grid-template-columns:minmax(0,1fr)}
.stack{gap:16px}
.card{padding:15px}
.reading strong{font-size:28px}
.badge{font-size:11px}
}
@media(max-width:355px){h1{font-size:26px}.header-actions button{padding-inline:8px}}

