:root{color-scheme:light;--paper:#f8f9fc;--ink:#202943;--muted:#56647b;--blue:#2e4aac;--line:#d8dfeb;--wash:#eef1fb;--body:"PingFang SC","Microsoft YaHei",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;--fig:"Avenir Next",Avenir,"Helvetica Neue",Arial,sans-serif;font-family:var(--body);color:var(--ink);background:var(--paper);font-size:16px}
*{box-sizing:border-box}body{margin:0;-webkit-text-size-adjust:100%}button,input{font:inherit}button{cursor:pointer;touch-action:manipulation;color:inherit}button:focus-visible,input:focus-visible{outline:3px solid #dc823d;outline-offset:2px}button{border:0;background:none}input{min-width:0;width:100%;font-size:18px;color:var(--ink);padding:10px 12px;border:1px solid #b4c1d7;border-radius:9px;background:white;min-height:48px}button:active{filter:brightness(.94)}[hidden]{display:none!important}h1,h2,p{margin:0}.shell{width:min(100%,680px);margin:auto;padding:calc(12px + env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) calc(40px + env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
.mast,.week-title,.list-title,.day-head,.btn-header,.actions,.record,.ref-heading{display:flex;align-items:center;justify-content:space-between;gap:10px}.mast{padding:8px 0 15px;border-bottom:1px solid var(--line)}.brand{display:flex;gap:10px;align-items:center;font-size:21px;font-weight:800;letter-spacing:.03em}.barbell{width:34px;height:22px;display:inline-flex;align-items:center;justify-content:space-between;position:relative;transform:rotate(-10deg);color:var(--blue);padding:0 4px}.barbell:before{content:"";position:absolute;inset:9px 0;background:currentColor;border-radius:2px}.barbell i{height:21px;width:7px;background:currentColor;border-radius:3px}.local{font-size:13px;color:var(--muted)}
.calendar{padding:19px 0 15px}.week-title{margin-bottom:11px}.week-title h2,.list-title h2{font-size:18px;letter-spacing:.02em}.week-title span,.target b,.counter strong,.ref,.kg,.rep,.day-button b,.num,.set-value{font-family:var(--fig),var(--body);font-variant-numeric:tabular-nums}.week-title span,.list-title span{font-size:14px;color:var(--muted)}
#days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}.day-button{position:relative;min-height:62px;border-radius:10px;display:grid;align-content:center;justify-items:center;gap:2px;padding:3px 0;background:#eef1f7;color:#4a5671}.day-button span{font-size:13px}.day-button b{font-size:18px;line-height:1.2}.day-button[aria-pressed="true"]{color:white;background:var(--blue)}.day-button.done:after{content:"";width:4px;height:4px;background:currentColor;border-radius:50%;position:absolute;bottom:4px}
.day-head{border-radius:17px;background:#263961;color:white;padding:20px 22px;position:relative;isolation:isolate;overflow:hidden}.day-head:before{content:"";position:absolute;z-index:-1;width:82px;right:62px;inset-block:-50%;transform:rotate(22deg);background:repeating-linear-gradient(90deg,transparent 0 8px,#ffffff0c 8px 11px)}.day-info>p{font-size:14px;color:#e1e7f4}.day-info h1{font-size:clamp(30px,7vw,41px);line-height:1.25;margin:5px 0;font-weight:800}.target{font-size:14px;color:#e6ebf8}.target b{color:white}.counter{text-align:center;border-left:1px solid #ffffff38;padding-left:19px;min-width:75px;display:grid;gap:1px}.counter strong{font-size:40px;line-height:1.1}.counter span{font-size:13px;color:#e5eaf8}
.movements{padding-top:21px}.list-title{margin-bottom:11px}.card{border:1px solid var(--line);border-radius:13px;background:white;overflow:hidden;margin-bottom:9px}.card.active{border-color:#aab9df}.btn-header{width:100%;text-align:left;padding:14px 14px;min-height:58px;gap:12px}.move-name{flex:1;font-size:17px;font-weight:750;overflow-wrap:anywhere}.set-count{color:var(--muted);font-size:14px;flex:none}.chev{width:8px;height:8px;border-right:2px solid #606e88;border-bottom:2px solid #606e88;transform:rotate(45deg);margin:0 2px 4px}.active .chev{transform:rotate(225deg);margin:4px 2px 0}.details{padding:0 14px 15px}.ref-box{background:#f4f6fa;border-radius:9px;padding:9px 10px;margin-bottom:14px}.ref-heading{font-size:14px;color:var(--muted);font-weight:600}.ref-heading small{font-size:12px;font-weight:400}.ref-tray{display:flex;flex-wrap:wrap;gap:0 5px;margin:3px -2px -3px}.ref{min-height:44px;padding:3px 2px;color:var(--blue);font-size:14px;font-weight:600}.ref span{display:block;border:1px solid #cdd7e7;background:white;border-radius:5px;padding:4px 6px}.entry{margin:0}.entry-title{font-size:16px;font-weight:750;margin:0 0 8px}.fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px}label{display:block;font-size:14px;color:var(--muted);margin-bottom:5px}.primary,.sub,.add{min-height:46px;padding:9px 16px;border-radius:9px;font-weight:700}.primary{background:var(--blue);color:white}.entry>.primary{width:100%;margin-top:12px}.sub{background:var(--wash);color:var(--blue)}.actions{justify-content:flex-end;margin-top:12px}.records{list-style:none;margin:0 0 12px;padding:0}.record{min-height:44px;border-bottom:1px solid var(--line);font-size:14px}.set-value{font-size:16px;font-weight:650;flex:1}.record .num{color:var(--muted)}.edit,.danger{min-height:44px;color:var(--blue);padding:4px 7px}.danger{margin-right:auto;color:#983a30}.add{width:100%;border:1px dashed #9cabc7;background:#f0f3fa;color:var(--blue)}.add span{font-size:18px}.training-form{background:white;border:1px solid var(--line);border-radius:13px;padding:16px}.empty{padding:12px 0 20px;color:var(--muted);font-size:15px;line-height:1.6}.error,#warning{font-size:14px;color:#973d23;margin:9px 0}.sr{position:absolute;width:1px;height:1px;clip-path:inset(50%);overflow:hidden}
@media(min-width:700px){.shell{padding-top:28px}.card .details{padding:0 20px 20px}.btn-header{padding-inline:20px}.calendar{padding:23px 0 18px}.day-head{padding:24px 28px}}
@media(max-width:370px){.shell{padding-inline:6px}#days{gap:0}.day-button{border-radius:8px}.ref-box{padding-inline:7px}}

select {
  appearance:none;
  -webkit-appearance:none;
  width:100%;
  min-height:48px;
  font:inherit;
  font-size:17px;
  color:var(--ink);
  border:1px solid #b4c1d7;
  border-radius:9px;
  padding:9px 32px 9px 12px;
  background:linear-gradient(45deg,transparent 50%,#53637e 50%) calc(100% - 17px) center / 5px 5px no-repeat,
             linear-gradient(135deg,#53637e 50%,transparent 50%) calc(100% - 12px) center / 5px 5px no-repeat, white;
}
select:focus-visible { outline:3px solid #dc823d; outline-offset:2px; }
.calendar-open,.month-nav button,.dialog-title button,.calendar-footer button {
  color:var(--blue);
  min-height:44px;
  font-weight:650;
  padding:7px 10px;
}
.calendar-open { display:flex; align-items:center; gap:8px; border-radius:9px; background:var(--wash); }
.calendar-icon { width:17px; height:16px; border:2px solid currentColor; border-radius:4px; position:relative; }
.calendar-icon::before { content:""; position:absolute; left:0; right:0; top:3px; border-top:2px solid currentColor; }
#calendar-dialog { width:min(calc(100% - 12px),420px); max-width:none; max-height:90vh; overflow:auto; padding:16px; color:var(--ink); background:var(--paper); border:0; border-radius:16px; }
#calendar-dialog::backdrop { background:rgb(20 31 55 / .48); }
.dialog-title,.month-nav,.calendar-footer { display:flex; align-items:center; justify-content:space-between; gap:6px; }
.dialog-title h2 { font-size:20px; }
.month-nav { margin:10px 0 14px; }
.month-nav select { width:auto; flex:1; text-align:center; font-weight:650; }
.month-nav button:disabled,.calendar-footer button:disabled { color:#adb4c3; cursor:default; }
#month-grid,.month-weekdays { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); text-align:center; }
.month-weekdays { color:var(--muted); font-size:14px; margin:0 0 4px; }
.month-day { position:relative; min-height:44px; padding:2px; border-radius:9px; font:600 16px var(--fig); }
.month-day:disabled { color:#aeb6c2; }
.month-day[aria-current="date"] { box-shadow:inset 0 0 0 1px var(--blue); }
.month-day[aria-pressed="true"] { color:white; background:var(--blue); }
.has-record::after { content:""; position:absolute; left:calc(50% - 2px); bottom:5px; width:4px; height:4px; background:currentColor; border-radius:50%; }
.calendar-footer { border-top:1px solid var(--line); margin-top:8px; padding-top:6px; }
.calendar-footer span,.no-history,.ref-date { font-size:14px; color:var(--muted); }
.no-history,.ref-date { margin:6px 0 0; }
.ref-tray { gap:4px; margin:5px 0 0; }
.ref { padding:0; text-align:left; font-size:15px; }
.ref span { min-height:45px; padding:5px 8px; }
.ref small { display:block; font:400 12px var(--body); color:var(--muted); }
.ref.original { color:var(--ink); }
@media(max-width:370px) { #calendar-dialog { padding-inline:4px; } }

.move-tools { display:flex; align-items:center; gap:12px; margin:-6px 0 7px; }
.move-tools button { padding:3px 4px; min-height:44px; font-size:14px; }
.remove-move { color:#943e38; }
#move-dialog, #body-weight-dialog { width:min(calc(100% - 24px),380px); padding:20px; border:0; border-radius:14px; background:white; color:var(--ink); }
#move-dialog::backdrop, #body-weight-dialog::backdrop { background:rgb(20 31 55 / .48); }
#move-heading, #body-weight-title { margin:0; font-size:20px; }
#move-scope, #body-weight-date { margin:10px 0 16px; color:var(--muted); font-size:15px; line-height:1.6; overflow-wrap:anywhere; }
.primary.destructive { background:#943e38; }
.training-marks,.training-legend { display:inline-flex; align-items:center; justify-content:center; gap:2px; }
.training-marks { min-height:16px; width:100%; }
.mark { display:inline-grid; place-items:center; border-radius:4px; width:16px; height:16px; font:700 12px/1 var(--body); font-style:normal; }
.mark.strength { color:#273e79; background:#dce5ff; }
.mark.aerobic { color:#1b5d41; background:#d7f0df; }
.mark.discipline { color:#663493; background:#f1e1ff; }
.training-legend { gap:4px; }
.training-legend .mark:not(:first-child) { margin-left:7px; }
.training-marks { display:flex; gap:1px; }
.training-marks .mark { min-width:0; }
.day-button { min-height:72px; }
.month-day { display:grid; align-content:center; justify-items:center; gap:2px; min-height:48px; }
.day-button, .month-day { grid-template-columns:minmax(0,1fr); }
.calendar-heading { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 7px; }
#trend-open { display:inline-flex; align-items:center; gap:7px; padding-inline:13px; border-radius:9px; color:#126354; background:#e2f1eb; }
#weight-trend-view { padding:0 2px 4px; }
.trend-modes { display:grid; grid-template-columns:repeat(3,1fr); background:#e7eee9; border-radius:10px; padding:3px; margin:12px 0 6px; }
.trend-modes button { min-height:44px; border-radius:8px; color:#3d5b52; font-weight:650; }
.trend-modes button[aria-pressed="true"] { background:#126354; color:white; }
.trend-nav { display:grid; grid-template-columns:auto 1fr auto; align-items:center; text-align:center; gap:4px; }
.trend-nav button { color:var(--blue); font-size:14px; min-height:44px; padding:4px 6px; }
.trend-nav button:disabled { color:#828c9e; cursor:default; }
#trend-period { font-size:15px; }
.trend-reading { margin-top:12px; padding-inline:5px; color:#126354; }
#trend-detail, #trend-hint { color:var(--muted); font-size:14px; }
#trend-kg { font:750 34px/1.25 var(--fig),var(--body); font-variant-numeric:tabular-nums; overflow-wrap:anywhere; }
#trend-plot { width:100%; height:auto; display:block; margin-top:4px; touch-action:manipulation; cursor:crosshair; }
#trend-plot:focus-visible { outline:2px solid var(--blue); border-radius:6px; }
#trend-plot text { font:12px var(--fig),var(--body); fill:#526176; }
.trend-grid { stroke:#dce3e2; }
.trend-segment { stroke:#147664; stroke-width:2.3; stroke-linecap:round; }
.trend-gap { stroke-dasharray:4 5; }
.trend-point { fill:#147664; stroke:var(--paper); stroke-width:1.4; }
.trend-point.is-selected { stroke:#126354; fill:#c4f2de; stroke-width:2.5; }
#trend-hint { margin:8px 5px 0; line-height:1.45; }
#trend-empty { padding:45px 12px; text-align:center; color:var(--muted); }
.weight-key, .calendar-weight { color:#126354; }
.weight-key { font-size:13px; }
.calendar-weight { display:flex; flex-wrap:wrap; justify-content:center; align-items:baseline; align-content:start; column-gap:1px; max-width:100%; min-height:1.25em; overflow-wrap:anywhere; font:650 12px/1.25 var(--fig),var(--body); font-variant-numeric:tabular-nums; }
.calendar-weight .weight-unit { font-size:.95em; font-weight:550; white-space:nowrap; }
button[aria-pressed="true"] > .calendar-weight { color:#82f2c9; }
.calendar:has(.calendar-weight:not(:empty)) .day-button { grid-template-rows:auto auto 1fr auto; }
#calendar-dialog:has(.calendar-weight:not(:empty)) .month-day { grid-template-rows:auto 1fr auto; }
:is(.calendar, #calendar-dialog):not(:has(.calendar-weight:not(:empty))) :is(.calendar-weight, .weight-key) { display:none; }
.mast-actions { display:flex; align-items:center; justify-content:flex-end; gap:8px; }
#refresh-page { min-width:48px; min-height:44px; padding:6px 10px; border-radius:9px; background:var(--wash); color:var(--blue); font-weight:650; }
#backup-open { min-height:44px; padding:6px 10px; }
#backup-dialog { width:min(calc(100% - 20px),430px); max-height:85vh; overflow:auto; padding:18px; color:var(--ink); background:var(--paper); border:0; border-radius:14px; }
#backup-dialog::backdrop { background:rgb(20 31 55 / .48); }
#backup-dialog p { margin:8px 0 12px; line-height:1.55; font-size:15px; overflow-wrap:anywhere; }
#backup-dialog p:empty { display:none; }
#backup-download { display:inline-flex; align-items:center; min-height:44px; padding:0 8px; color:var(--blue); }
.import-area { margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
#import-preview h3 { margin:12px 0 0; font-size:17px; }
#conflict-choices { margin:12px 0; padding:5px 12px; border:1px solid var(--line); border-radius:8px; }
#conflict-choices legend { padding:0 3px; font-size:14px; }
#conflict-choices label { display:flex; align-items:center; min-height:44px; gap:8px; color:var(--ink); margin:0; }
#conflict-choices input { min-height:0; height:18px; width:18px; accent-color:var(--blue); }
.day-head { display:grid; grid-template-columns:minmax(0,1fr); gap:14px; text-align:center; }
.day-totals, .day-actions { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); margin:0; border-top:1px solid #ffffff40; padding-top:12px; }
.day-action { min-width:0; padding-inline:6px; display:grid; grid-template-rows:1fr auto; align-items:center; gap:9px; }
.day-actions button { width:100%; max-width:14rem; justify-self:center; min-height:44px; padding:6px 10px; border:1px solid #ffffff65; border-radius:9px; font-size:15px; font-weight:650; }
#discipline-status { align-self:start; font-size:16px; line-height:1.65; }
#body-weight-open { color:white; background:#ffffff0d; }
#discipline-toggle { color:#263961; background:#f6f1ff; }
#discipline-toggle[aria-pressed="true"] { background:transparent; color:white; }
.day-totals > div + div { box-shadow:inset 1px 0 #ffffff40; }
.day-head dt { font-size:14px; font-weight:650; color:#edf1fb; margin-bottom:3px; }
.day-head dd { font-size:14px; margin:0; overflow-wrap:anywhere; }
.body-weight { display:flex; align-items:baseline; justify-content:center; flex-wrap:wrap; gap:2px 6px; margin:0; }
.body-weight dt { margin:0; }
.body-weight dd { display:flex; min-width:0; align-items:baseline; gap:3px; }
#body-weight-value { min-width:0; font:750 1.375rem/1.2 var(--fig),var(--body); font-variant-numeric:tabular-nums; }
#body-weight-unit { font:500 .875rem/1 var(--fig),var(--body); color:#d8e1f4; }
#body-weight-value.unmeasured { color:#d2dbef; font:500 .875rem/1.4 var(--body); }
#body-weight-previous { display:flex; justify-content:center; align-items:baseline; flex-wrap:wrap; gap:0 5px; margin-top:4px; color:#d2dbef; font-size:13px; line-height:1.4; font-variant-numeric:tabular-nums; }
#previous-weight-reading { overflow-wrap:anywhere; }
#date-tools { display:flex; align-items:center; justify-content:center; gap:10px; font-size:14px; }
#date-mode { font-weight:650; }
#jump-today { min-height:44px; color:white; text-decoration:underline; text-underline-offset:3px; padding:4px; }
#reuse-last-week { width:100%; margin-top:8px; }
#reuse-result { margin-top:8px; color:var(--muted); font-size:14px; }
.attempt-label { color:var(--muted); font-size:14px; }
.move-tools { flex-wrap:wrap; gap:3px 12px; }
.day-totals strong { font:750 30px/1.15 var(--fig),var(--body); font-variant-numeric:tabular-nums; }
@media(max-width:520px) {
  .day-head { padding:15px 18px; }
  .day-totals strong { font-size:27px; }
}
