:root { --purple:#8a5cf6; --line:#e5e5ea; --grad:linear-gradient(135deg,#8fa8ff,#c8a2ff,#9ad0ff); }
* { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { margin:0; height:100%; background:#fff; color:#000; font:17px -apple-system,BlinkMacSystemFont,"SF Pro Text",sans-serif; }
button { font:inherit; color:inherit; background:none; border:0; padding:0; cursor:pointer; }
#app { display:flex; flex-direction:column; height:100%; max-width:560px; margin:0 auto; }
main { flex:1; overflow-y:auto; padding:calc(20px + env(safe-area-inset-top)) 20px 20px; -webkit-overflow-scrolling:touch; }
h1 { font-size:25px; font-weight:800; letter-spacing:-.7px; margin:0 0 16px; }
h2 { font-size:14px; font-weight:600; margin:20px 0 8px; }
.label { font-size:13px; color:#666; margin-top:8px; }
.value { font-weight:500; }
.note,.msg { font-size:12px; color:#888; }
.msg { color:#1f7a35; font-size:13px; }

/* calendar */
.cal { width:90%; margin:0 auto; }
.cal-head { display:flex; align-items:center; justify-content:space-between; margin-bottom:12px; }
.month { font-size:16px; font-weight:600; }
.nav { width:44px; height:44px; font-size:25px; }
.weekdays { display:flex; margin-bottom:4px; }
.weekdays span { flex:1; text-align:center; font-size:12px; color:#999; }
.grid { display:flex; flex-wrap:wrap; }
.cell { position:relative; width:14.2857%; height:50px; display:flex; align-items:center; justify-content:center; }
.dot { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:13px; }
.dot.period { background:linear-gradient(to bottom left,#ff6fae,#ff1a3c); color:#fff; font-weight:500; }
.dot.peak { background:linear-gradient(135deg,#74c0fc,#1c7ed6); color:#fff; font-weight:500; }
.dot.predicted { border:1.5px dotted #e03131; }
.dot.fertile { color:#1c7ed6; font-weight:500; }
.today-ring { width:38px; height:38px; border-radius:50%; padding:2px; background:var(--grad); }
.today-inner { width:34px; height:34px; border-radius:50%; background:#fff; display:flex; align-items:center; justify-content:center; }
.dots { position:absolute; top:44px; left:0; right:0; display:flex; justify-content:center; }
.slot { width:5px; height:5px; border-radius:50%; margin:0 2px; }
.slot.grey { background:#9e9e9e; } .slot.green { background:#34c759; }

.add-row { display:flex; align-items:center; justify-content:center; margin:24px 0; }
.plus { width:36px; height:36px; border-radius:50%; border:1.5px solid #c8a2ff; color:var(--purple); font-size:22px; line-height:1; margin-right:10px; }
.link { font-weight:500; }
.btns { display:flex; flex-direction:column; gap:8px; margin-bottom:20px; }
.btn { padding:12px; text-align:center; color:#007aff; border-radius:12px; background:#f2f2f7; }
.btn.grey { color:#888; }
.btn.outline { width:100%; margin-bottom:10px; background:none; border:1px solid var(--line); color:#000; }
.info { border:1px solid transparent; border-radius:16px; padding:16px; margin-bottom:16px;
  background:linear-gradient(#fff,#fff) padding-box, var(--grad) border-box; }

/* tabs */
nav { display:flex; border-top:.5px solid var(--line); padding-bottom:calc(6px + env(safe-area-inset-bottom)); }
.tab { flex:1; padding:12px 0; color:#888; border-top:2px solid transparent; margin-top:-1px; }
.tab.on { color:#000; font-weight:600; border-top-color:var(--purple); }

/* workout */
.card { border:1px solid var(--line); border-radius:15px; padding:16px; margin-bottom:16px; }
.ex { display:flex; justify-content:space-between; margin-top:10px; gap:8px; }
.done { width:100%; border:1px solid #34c759; border-radius:12px; padding:14px; color:#1f7a35; font-weight:500; }
.done.on { background:#34c759; color:#fff; }
.week-row { width:100%; display:flex; align-items:center; justify-content:space-between; padding:12px 0; border-top:.5px solid var(--line); text-align:left; }
.check { width:26px; height:26px; border-radius:50%; border:1.5px solid #34c759; display:flex; align-items:center; justify-content:center; color:#fff; font-size:14px; font-weight:700; }
.check.on { background:#34c759; }

/* sheets */
.modal { position:fixed; inset:0; display:flex; flex-direction:column; justify-content:flex-end; z-index:10; }
.backdrop { position:absolute; inset:0; background:rgba(0,0,0,.3); }
.sheet { position:relative; background:#fff; border-radius:16px 16px 0 0; padding:16px 20px calc(24px + env(safe-area-inset-bottom)); max-height:85%; display:flex; flex-direction:column; width:100%; max-width:560px; margin:0 auto; }
.sheet h3 { margin:0 0 8px; font-size:17px; font-weight:600; }
.sheet h4 { margin:16px 0 8px; font-size:14px; font-weight:600; }
.scroll { overflow-y:auto; }
.opt { display:block; width:100%; text-align:left; padding:14px 0; border-top:.5px solid var(--line); }
.opt.danger { color:#e03131; } .opt.muted { color:#888; }
.chips { display:flex; flex-wrap:wrap; }
.chip { background:#f3ecfd; border-radius:20px; padding:8px 14px; margin:0 8px 8px 0; font-size:14px; }
.chip.on { background:var(--purple); color:#fff; font-weight:500; }
.fert { font-size:13px; color:#666; }
textarea,input[type=file] { width:100%; font:14px monospace; border:1px solid var(--line); border-radius:8px; padding:8px; }
