:root {
  --bg: #050507; --text: #F4F4F5; --muted: #9C9CA6; --faint: #6A6A74;
  --blue: #4C8EFF; --green: #2EE59B; --line: #2C2C34; --border: #3A3A44;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.4; -webkit-font-smoothing: antialiased;
  padding-top: var(--sat);
}
button { font-family: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
button:disabled { cursor: default; }
input, textarea { font-family: inherit; color: var(--text); }
svg { display: block; }
.wrap { max-width: 640px; margin: 0 auto; padding-left: var(--sal); padding-right: var(--sar); }
.hdr { padding: 4px 14px 0; }
.hdr-in { padding: 2px 0 8px; }
.hdr-row { display: flex; align-items: center; gap: 8px; }
.ib { width: 40px; height: 40px; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; color: var(--text); }
.month { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; gap: 2px; min-height: 40px; color: var(--text); }
.month span { font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: 0.04em; }
.today-btn { min-height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--muted); background: transparent; color: var(--text); font-weight: 700; font-size: 11px; letter-spacing: 0.08em; }
.today-btn.on { border-color: var(--blue); color: var(--blue); }
.strip { display: flex; flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; overscroll-behavior-x: contain; margin-top: 4px; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.day { flex: 1 0 44px; min-width: 44px; min-height: 56px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 6px 2px 4px; }
.day.sel { border-bottom-color: var(--text); color: var(--text); }
.day.istoday { color: var(--blue); }
.day.sel.istoday { color: var(--text); }
.day .n { font-size: 18px; font-weight: 500; line-height: 1.1; }
.day.sel .n { font-weight: 700; }
.dots { display: flex; justify-content: center; gap: 2px; margin-top: 6px; min-height: 6px; }
.dots i { width: 4px; height: 4px; border-radius: 999px; background: var(--faint); display: inline-block; }
.day.sel .dots i { background: var(--text); }
.day.done .dots i { background: var(--green); }
.main { padding: 10px 16px calc(96px + var(--sab)); }
.lbl { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.lbl.blue { color: var(--blue); }
.pre { white-space: pre-wrap; }
.menu { padding: 8px 0 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.menu button { display: block; width: 100%; text-align: left; min-height: 48px; padding: 8px 4px; border: 0; background: transparent; font-size: 16px; font-weight: 500; color: var(--text); }
.menu button.on { color: var(--blue); font-weight: 700; }
.menu button small { color: var(--muted); font-weight: 400; margin-left: 8px; font-size: 13px; }
.note-day { font-size: 14px; color: var(--muted); line-height: 1.45; margin: 0 0 14px; }
.note-week { font-size: 13px; color: var(--faint); line-height: 1.45; margin: 0 0 16px; }
.blk { margin: 0 0 28px; }
.blk-h { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.badge { width: 28px; height: 28px; flex: 0 0 28px; border-radius: 999px; border: 1.5px solid var(--muted); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; margin-top: 2px; }
.blk-t { flex: 1 1 auto; min-width: 0; font-size: 20px; font-weight: 750; line-height: 1.2; padding-top: 2px; }
.score { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--blue); font-size: 14px; font-weight: 700; padding-top: 4px; }
.ind { padding-left: 38px; }
.body { font-size: 16px; line-height: 1.5; white-space: pre-wrap; margin: 0 0 12px; padding-left: 38px; }
.extra { font-size: 15px; color: var(--muted); line-height: 1.45; white-space: pre-wrap; margin: 0 0 12px; padding-left: 38px; }
.notes { font-size: 16px; line-height: 1.55; padding-left: 38px; margin-top: 4px; white-space: pre-wrap; }
.lvl { margin: 0 0 12px; }
.lvl + .lvl { padding-top: 12px; border-top: 1px dashed var(--faint); }
.lvl h4 { margin: 0 0 4px; font-size: 16px; font-weight: 700; }
.lvl div { font-size: 16px; line-height: 1.45; white-space: pre-wrap; }
.meta { font-size: 16px; line-height: 1.5; margin: 8px 0 16px; }
.inp { width: 100%; min-height: 44px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 16px; padding: 8px 12px; outline: none; }
.inp:focus { border-color: var(--blue); }
.field { display: block; margin: 0 0 14px; }
.field .lbl { margin-bottom: 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.chip { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; }
.chip.on { border-color: var(--blue); background: var(--blue); color: var(--text); }
.btn { width: 100%; min-height: 48px; border-radius: 12px; border: 0; background: var(--blue); color: var(--text); font-size: 16px; font-weight: 700; }
.btn.ghost { background: transparent; border: 1px solid var(--border); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.btnrow .btn { flex: 1 1 140px; width: auto; }
/* strength logger */
.lift { margin: 4px 0 8px; }
.exdots { display: flex; justify-content: center; gap: 8px; margin: 0 0 8px; }
.exdots button { width: 8px; height: 8px; border-radius: 999px; padding: 0; border: 1.5px solid var(--green); background: transparent; }
.exdots button.cur { width: 12px; height: 12px; }
.exdots button.fill { background: var(--green); }
.totals { display: flex; justify-content: center; gap: 22px; margin: 0 0 14px; }
.totals div { text-align: center; }
.totals b { display: block; font-size: 22px; font-weight: 800; font-style: italic; line-height: 1; }
.totals .lbl { margin-top: 2px; }
.rule { height: 1px; background: var(--line); margin: 0 0 14px; }
.lname { font-size: 18px; font-weight: 650; line-height: 1.3; }
.lrx { font-size: 14px; color: var(--muted); margin: 6px 0 16px; line-height: 1.45; white-space: pre-wrap; }
.grid { display: grid; grid-template-columns: 36px minmax(0, 1fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.grid .c { text-align: center; }
.grid .sn { font-size: 15px; color: var(--muted); text-align: center; }
.grid .inp { text-align: center; border-radius: 12px; padding: 8px 6px; }
.chk { width: 28px; height: 28px; margin: 0 auto; border-radius: 999px; border: 2px solid var(--green); background: transparent; color: var(--green); font-size: 14px; font-weight: 800; padding: 0; line-height: 1; }
.chk.on { background: var(--green); color: var(--bg); }
.setbar { display: flex; justify-content: center; align-items: center; gap: 18px; margin: 18px 0 12px; }
.setbar span { font-size: 15px; color: var(--muted); }
.rb { width: 36px; height: 36px; border-radius: 999px; background: transparent; font-size: 20px; line-height: 1; padding: 0; }
.rb.minus { border: 1.5px solid var(--faint); color: var(--muted); }
.rb.plus { border: 1.5px solid var(--blue); color: var(--blue); }
.xnote { width: 100%; min-height: 44px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--muted); font-size: 16px; padding: 8px 0; margin-bottom: 12px; outline: none; }
.xnav { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.xnav button { flex: 1 1 80px; min-height: 44px; border: 0; background: transparent; color: var(--blue); font-size: 16px; font-weight: 600; }
.xnav button:first-child { text-align: left; }
.xnav button:last-child { text-align: right; }
.xnav button:disabled { color: var(--faint); }
.xnav .lbl { flex: 1 1 80px; text-align: center; }
/* sections */
h2.sec { font-size: 24px; font-weight: 750; margin: 0 0 12px; }
.help { font-size: 15px; color: var(--muted); margin: 0 0 14px; line-height: 1.45; }
.card { margin: 0 0 20px; }
.card .lbl { margin-bottom: 6px; }
.card p { margin: 0; font-size: 16px; line-height: 1.5; white-space: pre-wrap; }
.phase { border-top: 1px solid var(--line); padding: 12px 0; }
.phase b { display: block; font-size: 16px; margin: 4px 0 6px; }
.phase p { margin: 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.hist { display: block; width: 100%; text-align: left; background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 12px 0; color: var(--text); }
.hist .d { font-weight: 700; }
.hist .d em { color: var(--green); margin-left: 8px; font-size: 12px; font-style: normal; font-weight: 600; }
.hist .f { font-size: 14px; color: var(--muted); margin-top: 4px; }
.hist .s { font-size: 15px; margin-top: 4px; }
textarea.inp { min-height: 120px; font-size: 14px; font-family: ui-monospace, Menlo, monospace; resize: vertical; }
.status { font-size: 14px; color: var(--green); min-height: 20px; margin: 4px 0 12px; }
.status.err { color: #FF7A7A; }
.logpanel { margin: 0 0 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.logpanel h3 { margin: 0 0 10px; font-size: 18px; font-weight: 700; }
.logpanel h5 { margin: 0 0 8px; font-size: 15px; font-weight: 650; }
.logpanel .mcg { margin-bottom: 16px; }
/* fixed chrome (short) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--bg); border-top: 1px solid var(--line); padding-bottom: var(--sab); padding-left: var(--sal); padding-right: var(--sar); z-index: 10; }
.tabbar button { flex: 1 1 0; min-width: 0; min-height: 48px; border: 0; background: transparent; color: var(--muted); font-size: 10px; font-weight: 600; padding: 6px 2px 4px; }
.tabbar button.on { color: var(--blue); }
.tabbar svg { margin: 0 auto 2px; }
.fab { position: fixed; right: calc(14px + var(--sar)); bottom: calc(64px + var(--sab)); width: 56px; height: 56px; border-radius: 999px; border: 0; background: var(--blue); color: var(--text); font-size: 28px; font-weight: 500; line-height: 1; box-shadow: 0 4px 16px rgba(0,0,0,0.4); z-index: 11; padding: 0; display: none; }
.fab.show { display: block; }
@media (min-width: 700px) { .tabbar { left: 50%; right: auto; width: 640px; transform: translateX(-50%); } .fab { right: calc(50% - 320px + 14px); } }
