:root{
  --bg: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #24403E;
  --ink-soft: #5C7A78;
  --sage: #7C9885;
  --sage-deep: #5F7C68;
  --gold: #C99A3C;
  --brick: #BE5B54;
  --line: #E7E0D4;
}
*{box-sizing:border-box;}
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'Figtree', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing:antialiased;
  padding-bottom:48px;
}
.wrap{max-width:520px; margin:0 auto; padding:24px 18px 8px;}
header{margin-bottom:22px;}
.eyebrow{
  font-size:13px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--ink-soft); font-weight:600; margin-bottom:6px;
}
h1{
  font-family:'Fraunces', Georgia, serif; font-weight:600; font-size:30px;
  margin:0 0 4px; color:var(--ink); line-height:1.15;
}
.sub{color:var(--ink-soft); font-size:15px; margin:0;}

.card{
  background:var(--surface); border-radius:20px; padding:20px;
  margin-bottom:16px; box-shadow:0 1px 2px rgba(36,64,62,0.06), 0 8px 24px -12px rgba(36,64,62,0.10);
}
.card h2{
  font-family:'Fraunces', Georgia, serif; font-size:19px; font-weight:600;
  margin:0 0 14px; color:var(--ink);
}

label{font-size:13px; font-weight:600; color:var(--ink-soft); display:block; margin:14px 0 6px;}
label:first-of-type{margin-top:0;}
input[type=number], input[type=text], input[type=datetime-local]{
  width:100%; font-size:22px; font-family:'Fraunces', Georgia, serif; font-weight:600;
  padding:12px 14px; border-radius:12px; border:1.5px solid var(--line);
  background:#FCFAF6; color:var(--ink);
}
input[type=text]{font-size:15px; font-family:'Figtree','Segoe UI',sans-serif; font-weight:400;}
input[type=datetime-local]{font-size:16px; font-family:'Figtree','Segoe UI',sans-serif; font-weight:500;}
input:focus{outline:2px solid var(--sage); outline-offset:1px; border-color:var(--sage);}

.pill-group{display:flex; flex-wrap:wrap; gap:8px;}
.pill{
  padding:11px 16px; border-radius:999px; border:1.5px solid var(--line);
  background:#FCFAF6; color:var(--ink-soft); font-size:14.5px; font-weight:600;
  cursor:pointer; user-select:none; transition:all .15s ease;
}
.pill.active{background:var(--sage); border-color:var(--sage); color:#fff;}

details.when{margin-top:14px;}
details.when summary{
  font-size:13.5px; font-weight:600; color:var(--ink-soft); cursor:pointer;
  padding:6px 0; list-style-position:inside;
}
details.when[open] summary{margin-bottom:4px;}

.btn{
  width:100%; margin-top:18px; padding:16px; border:none; border-radius:14px;
  background:var(--sage-deep); color:#fff; font-size:17px; font-weight:700;
  font-family:'Figtree','Segoe UI',sans-serif; cursor:pointer; transition:opacity .15s;
  min-height:52px;
}
.btn:active{opacity:.85;}
.btn:disabled{background:#C9CFC9; cursor:not-allowed;}

.feedback{
  margin-top:14px; padding:12px 14px; border-radius:12px; font-size:14.5px;
  display:none;
}
.feedback.show{display:block;}
.feedback.ok{background:#EEF3EC; color:var(--sage-deep);}
.feedback.warn{background:#FBF1DF; color:#8A6A1F;}
.feedback.alert{background:#F8E9E7; color:var(--brick);}

.stats-grid{display:grid; grid-template-columns:repeat(3,1fr); gap:10px;}
.stat{text-align:center;}
.stat .num{font-family:'Fraunces',Georgia,serif; font-size:24px; font-weight:700; color:var(--ink);}
.stat .lbl{font-size:11.5px; color:var(--ink-soft); margin-top:2px;}

svg{width:100%; height:auto; display:block; overflow:visible;}

.day-group{margin-bottom:6px;}
.day-heading{
  font-size:12.5px; font-weight:700; color:var(--ink-soft); text-transform:uppercase;
  letter-spacing:.05em; margin:18px 0 8px;
}
.entry{
  display:flex; align-items:center; gap:12px; padding:12px 6px;
  border-bottom:1px solid var(--line);
}
.entry:last-child{border-bottom:none;}
.dot{width:11px; height:11px; border-radius:50%; flex:0 0 auto;}
.dot.ok{background:var(--sage);}
.dot.warn{background:var(--gold);}
.dot.alert{background:var(--brick);}
.entry-main{flex:1; min-width:0;}
.entry-value{font-family:'Fraunces',Georgia,serif; font-weight:700; font-size:18px;}
.entry-value .unit{font-size:12px; font-weight:400; color:var(--ink-soft); font-family:'Figtree','Segoe UI',sans-serif;}
.entry-meta{font-size:12.5px; color:var(--ink-soft); margin-top:1px;}
.entry-note{font-size:12.5px; color:var(--ink-soft); font-style:italic; margin-top:2px;}
.del-btn{
  border:none; background:none; color:#C7BEB0; font-size:18px; cursor:pointer;
  padding:10px 12px; line-height:1; border-radius:10px; min-width:44px; min-height:44px;
}
.del-btn.confirm{
  background:var(--brick); color:#fff; font-size:12.5px; font-weight:700;
  font-family:'Figtree','Segoe UI',sans-serif;
}

.empty{
  text-align:center; padding:30px 10px; color:var(--ink-soft); font-size:14px;
}

.banner{
  padding:12px 14px; border-radius:12px; font-size:14px; margin-bottom:16px;
  background:#FBF1DF; color:#8A6A1F;
}
.banner.error{background:#F8E9E7; color:var(--brick);}

.locked{
  text-align:center; padding:60px 20px; color:var(--ink-soft); font-size:15px; line-height:1.6;
}
.locked .big{font-size:44px; margin-bottom:12px;}
.locked input{margin-top:24px; text-align:center; font-size:16px !important;}
.locked .btn{max-width:320px;}

.disclaimer{
  font-size:12px; color:var(--ink-soft); text-align:center; margin-top:20px;
  line-height:1.5; padding:0 12px;
}
