/* base */
:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#faf9f5;color:#141413}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

/* Layout: one narrow column (max 640px) like a coach's clipboard; navy scoreboard header, orange marks "now". */
:root{
  --bg:#eef1f6; --surface:#ffffff; --surface-2:#f6f8fb; --ink:#13213a; --muted:#566279; --line:#d6dce7;
  --navy:#14284b; --navy-ink:#f2f5fa; --navy-muted:#a9b6cf;
  --accent:#e2691a; --accent-ink:#b04f0c; --accent-soft:#fde9d9;
  --ok:#1b7f55; --ok-soft:#dcf1e7; --warn:#a36b00; --warn-soft:#fbefd2; --bad:#bd3a2a; --bad-soft:#f9e0dc;
  --ev-sure:#1d4f91; --ev-sure-soft:#dfe9f7; --ev-adult:#5b4a9a; --ev-adult-soft:#ebe6f7; --ev-field:#5d6676; --ev-field-soft:#eceef2;
  --shadow:0 1px 2px rgba(20,40,75,.06),0 4px 16px rgba(20,40,75,.06);
  --f-body:"Noto Sans JP","Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;
  --f-num:"Barlow Condensed","Arial Narrow","Roboto Condensed",sans-serif;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0b1322; --surface:#131e33; --surface-2:#18253e; --ink:#e7ecf5; --muted:#9ca8bf; --line:#27354f;
  --navy:#0f1f3d; --navy-ink:#eef2f9; --navy-muted:#93a3c2;
  --accent:#ff8a3d; --accent-ink:#ffa466; --accent-soft:#3a2516;
  --ok:#4cc48e; --ok-soft:#14322a; --warn:#f0b544; --warn-soft:#352a12; --bad:#ff7a66; --bad-soft:#3a1d1a;
  --ev-sure:#8fb6ec; --ev-sure-soft:#1a2c4a; --ev-adult:#b7a6ef; --ev-adult-soft:#272245; --ev-field:#aab2c0; --ev-field-soft:#232c3c;
  --shadow:0 1px 2px rgba(0,0,0,.3);
  color-scheme:dark;
}}
:root[data-theme="dark"]{
  --bg:#0b1322; --surface:#131e33; --surface-2:#18253e; --ink:#e7ecf5; --muted:#9ca8bf; --line:#27354f;
  --navy:#0f1f3d; --navy-ink:#eef2f9; --navy-muted:#93a3c2;
  --accent:#ff8a3d; --accent-ink:#ffa466; --accent-soft:#3a2516;
  --ok:#4cc48e; --ok-soft:#14322a; --warn:#f0b544; --warn-soft:#352a12; --bad:#ff7a66; --bad-soft:#3a1d1a;
  --ev-sure:#8fb6ec; --ev-sure-soft:#1a2c4a; --ev-adult:#b7a6ef; --ev-adult-soft:#272245; --ev-field:#aab2c0; --ev-field-soft:#232c3c;
  --shadow:0 1px 2px rgba(0,0,0,.3);
  color-scheme:dark;
}
*{box-sizing:border-box}
[hidden]{display:none !important}
body{background:var(--bg);color:var(--ink);font-family:var(--f-body);font-size:16px;line-height:1.7;-webkit-text-size-adjust:100%}
.wrap{max-width:640px;margin:0 auto;padding:0 16px;padding-block:0 40px;display:flex;flex-direction:column;gap:16px}
h1,h2,h3{text-wrap:balance;margin:0;line-height:1.35}
h2{font-size:1.1rem}
h3{font-size:1rem}
p{margin:0}
.num{font-family:var(--f-num);font-variant-numeric:tabular-nums;letter-spacing:.01em}
button,input,select{font:inherit;color:inherit}
:focus-visible{outline:3px solid var(--accent);outline-offset:2px}

/* header */
.top{background:var(--navy);color:var(--navy-ink);margin:0 -16px;padding:18px 16px 16px;display:flex;flex-direction:column;gap:10px}
.top-row{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;flex-wrap:wrap}
.top h1{font-size:1.35rem;letter-spacing:.02em}
.top h1 small{font-size:.75rem;font-weight:500;color:var(--navy-muted);margin-left:6px}
.top p{color:var(--navy-muted);font-size:.9rem}
.basedate{display:flex;align-items:center;gap:8px;font-size:.8rem;color:var(--navy-muted)}
.basedate input{background:transparent;border:1px solid var(--navy-muted);border-radius:6px;padding:4px 8px;color:var(--navy-ink);font-size:.85rem;color-scheme:dark;min-height:36px}

/* panels */
.panel{background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:16px;display:flex;flex-direction:column;gap:14px;min-width:0}
.panel-title{display:flex;align-items:baseline;justify-content:space-between;gap:8px;flex-wrap:wrap}
.hint{font-size:.82rem;color:var(--muted)}
.field{display:flex;flex-direction:column;gap:6px;min-width:0}
.field>label,.field>.lab{font-size:.85rem;font-weight:700}
.field input[type=date],.field input[type=number],.field select{width:100%;min-height:46px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:8px 12px;font-size:1rem}
.seg{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--surface-2)}
.seg input{position:absolute;opacity:0;pointer-events:none}
.seg label{display:flex;align-items:center;justify-content:center;text-align:center;min-height:46px;padding:6px 6px;font-size:.92rem;cursor:pointer;border-left:1px solid var(--line);line-height:1.3}
.seg label:first-of-type{border-left:0}
.seg input:checked+label{background:var(--navy);color:var(--navy-ink);font-weight:700}
.seg input:focus-visible+label{outline:3px solid var(--accent);outline-offset:-3px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
@media (max-width:420px){.grid2{grid-template-columns:1fr}}
details.more{border-top:1px dashed var(--line);padding-top:10px}
details.more summary{cursor:pointer;font-weight:700;font-size:.95rem;min-height:40px;display:flex;align-items:center;gap:8px;list-style:none}
details.more summary::-webkit-details-marker{display:none}
details.more summary::before{content:"＋";color:var(--accent-ink);font-weight:700}
details.more[open] summary::before{content:"－"}
.more-body{display:flex;flex-direction:column;gap:14px;padding-top:8px}

/* result */
.result{background:var(--navy);color:var(--navy-ink);border-radius:14px;padding:18px 16px;display:flex;flex-direction:column;gap:14px;box-shadow:var(--shadow)}
.result .phase-k{font-size:.8rem;letter-spacing:.12em;color:var(--navy-muted)}
.result .phase{font-size:1.55rem;font-weight:700;line-height:1.3}
.result .phase em{font-style:normal;color:var(--accent)}
.count{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.count .big{font-family:var(--f-num);font-size:3.6rem;line-height:1;font-weight:700;color:var(--accent)}
.count .unit{font-size:1rem;color:var(--navy-muted)}
.points{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.points li{display:grid;grid-template-columns:5.2em 1fr;gap:8px;background:rgba(255,255,255,.06);border-radius:8px;padding:10px 12px;font-size:.95rem;line-height:1.6}
.points b{color:var(--accent);font-size:.85rem;padding-top:2px}
.points li .ev{margin-top:4px}
.notice{border-radius:10px;padding:12px 14px;font-size:.92rem;display:flex;flex-direction:column;gap:6px}
.notice.accent{background:var(--accent-soft);color:var(--ink);border:1px solid var(--accent)}
.notice.plain{background:var(--surface-2);border:1px solid var(--line)}
.result .notice.plain{background:rgba(255,255,255,.06);border-color:rgba(255,255,255,.12);color:var(--navy-ink)}

/* timeline */
.tl{display:grid;grid-template-columns:repeat(5,1fr) .7fr;gap:6px;align-items:end}
.tl-col{display:flex;flex-direction:column;align-items:stretch;gap:4px;min-width:0;text-align:center}
.tl-bar-box{height:84px;display:flex;align-items:flex-end;background:var(--surface-2);border-radius:6px;overflow:hidden}
.tl-bar{width:100%;background:var(--line);border-radius:6px 6px 0 0}
.tl-col.now .tl-bar{background:var(--accent)}
.tl-col.now .tl-bar-box{outline:2px solid var(--accent);outline-offset:1px}
.tl-pct{font-family:var(--f-num);font-size:.95rem;font-weight:700;line-height:1.1}
.tl-name{font-size:.72rem;font-weight:700;line-height:1.25}
.tl-date{font-size:.66rem;color:var(--muted);line-height:1.2;font-variant-numeric:tabular-nums}
.tl-col.now .tl-name{color:var(--accent-ink)}
.tl-flag .tl-bar-box{background:repeating-linear-gradient(45deg,var(--surface-2) 0 6px,var(--line) 6px 8px)}
.tl-now-tag{font-size:.66rem;font-weight:700;color:var(--surface);background:var(--accent);border-radius:4px;padding:0 4px;align-self:center;visibility:hidden}
.tl-col.now .tl-now-tag{visibility:visible}

/* tabs */
.tabs{display:flex;flex-wrap:wrap;gap:6px}
.tab{border:1px solid var(--line);background:var(--surface-2);border-radius:999px;padding:8px 14px;min-height:42px;font-size:.9rem;cursor:pointer}
.tab[aria-selected=true]{background:var(--navy);color:var(--navy-ink);border-color:var(--navy);font-weight:700}
.tabpanel{display:flex;flex-direction:column;gap:14px}
.kv{display:grid;grid-template-columns:auto 1fr;gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.kv>div{padding:10px 12px;border-top:1px solid var(--line);font-size:.93rem;min-width:0}
.kv>div:nth-child(-n+2){border-top:0}
.kv .k{background:var(--surface-2);font-weight:700;font-size:.82rem;color:var(--muted);white-space:nowrap}
.kv .v strong{font-size:1.05rem}
.list{margin:0;padding-left:1.2em;display:flex;flex-direction:column;gap:6px;font-size:.93rem}
.ex{display:flex;flex-direction:column;gap:0;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.ex-row{display:grid;grid-template-columns:4.6em 1fr;gap:10px;padding:10px 12px;border-top:1px solid var(--line);font-size:.93rem}
.ex-row:first-child{border-top:0}
.role{font-size:.72rem;font-weight:700;border-radius:4px;padding:2px 6px;align-self:start;text-align:center;background:var(--surface-2);border:1px solid var(--line);color:var(--muted)}
.role.main{background:var(--navy);color:var(--navy-ink);border-color:var(--navy)}
.ex-row small{display:block;color:var(--muted);font-size:.8rem}
.chiprow{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.chip{font-size:.8rem;border-radius:999px;padding:3px 10px;background:var(--surface-2);border:1px solid var(--line)}
.chip.strong{background:var(--navy);color:var(--navy-ink);border-color:var(--navy);font-weight:700}
.stoprule{border-left:4px solid var(--accent);background:var(--accent-soft);padding:10px 12px;border-radius:0 8px 8px 0;font-size:.93rem;font-weight:500}
.tblwrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px}
table{border-collapse:collapse;width:100%;font-size:.85rem;font-variant-numeric:tabular-nums}
th,td{padding:8px 10px;border-top:1px solid var(--line);text-align:center;white-space:nowrap}
th{background:var(--surface-2);font-size:.78rem;color:var(--muted);border-top:0}
td:first-child,th:first-child{text-align:left}
tr.hl td{background:var(--accent-soft);font-weight:700}

/* evidence badges */
.ev{display:inline-flex;align-items:center;gap:4px;border-radius:999px;padding:1px 9px 1px 7px;font-size:.7rem;font-weight:700;line-height:1.7;cursor:pointer;border:1px solid currentColor;vertical-align:middle;white-space:nowrap;min-height:24px;background:transparent}
.ev::before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.ev.sure{color:var(--ev-sure);background:var(--ev-sure-soft)}
.ev.adult{color:var(--ev-adult);background:var(--ev-adult-soft)}
.ev.field{color:var(--ev-field);background:var(--ev-field-soft);border-style:dashed}
.ev.guide{color:var(--ok);background:var(--ok-soft)}
.ev.small{color:var(--ev-adult);background:var(--ev-adult-soft);border-style:dotted}
.result .ev{background:rgba(255,255,255,.1)}
.result .ev.sure,.result .ev.adult,.result .ev.field{color:var(--navy-ink)}
.legend{display:flex;flex-wrap:wrap;gap:6px;font-size:.8rem;align-items:center}

/* kg calc */
.kgrow{display:flex;flex-direction:column;gap:8px;border:1px solid var(--line);border-radius:10px;padding:12px}
.kgrow h3{font-size:.95rem}
.kgin{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}
.kgin label{font-size:.75rem;color:var(--muted);display:flex;flex-direction:column;gap:4px}
.kgin input{width:100%;min-height:44px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:6px 8px;font-size:1rem;font-family:var(--f-body)}
.kgout{font-size:.93rem;background:var(--surface-2);border-radius:8px;padding:10px 12px}
.kgout .kg{font-family:var(--f-num);font-size:1.8rem;font-weight:700;color:var(--accent-ink);line-height:1.1}

/* volume check */
.verdict{border-radius:10px;padding:14px;display:flex;flex-direction:column;gap:6px;border:1px solid}
.verdict .vh{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.verdict .pct{font-family:var(--f-num);font-size:2.2rem;font-weight:700;line-height:1}
.verdict .st{font-weight:700;font-size:1.05rem}
.verdict.ok{background:var(--ok-soft);border-color:var(--ok)} .verdict.ok .st,.verdict.ok .pct{color:var(--ok)}
.verdict.warn{background:var(--warn-soft);border-color:var(--warn)} .verdict.warn .st,.verdict.warn .pct{color:var(--warn)}
.verdict.bad{background:var(--bad-soft);border-color:var(--bad)} .verdict.bad .st,.verdict.bad .pct{color:var(--bad)}
.alert{font-size:.88rem;border-radius:8px;padding:8px 12px;background:var(--warn-soft);border:1px solid var(--warn)}

/* pain */
.pain{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.pain-row{display:grid;grid-template-columns:64px 1fr;gap:12px;padding:12px;border-top:1px solid var(--line);align-items:start;font-size:.92rem}
.pain-row:first-child{border-top:0}
.pain-row .lv{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:.75rem;font-weight:700;text-align:center;line-height:1.3}
.pain-row svg{width:40px;height:40px}
.pain-row.stop{background:var(--bad-soft)}
.pain-row.go{background:var(--surface)}

.female{border:2px solid var(--accent);background:var(--accent-soft);border-radius:12px;padding:14px;display:flex;flex-direction:column;gap:6px}
.female h2{color:var(--accent-ink);font-size:1.02rem}

.disc{font-size:.8rem;color:var(--muted);display:flex;flex-direction:column;gap:6px;line-height:1.7}
footer{font-size:.8rem;color:var(--muted);text-align:center;padding-top:8px;border-top:1px solid var(--line)}

/* rest plan */
.daychips{display:grid;grid-template-columns:repeat(7,1fr);gap:6px}
.daychips input{position:absolute;opacity:0;pointer-events:none}
.daychips label{display:flex;align-items:center;justify-content:center;min-height:44px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);font-weight:700;cursor:pointer}
.daychips input:checked+label{background:var(--navy);color:var(--navy-ink);border-color:var(--navy)}
.daychips input:focus-visible+label{outline:3px solid var(--accent);outline-offset:2px}
.switch{display:flex;align-items:center;gap:10px;font-size:.92rem;min-height:44px;cursor:pointer}
.switch input{width:22px;height:22px;accent-color:var(--navy);flex:none}
.wk{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.wk-h{background:var(--surface-2);font-size:.8rem;font-weight:700;color:var(--muted);padding:6px 12px}
.dr{display:grid;grid-template-columns:4.4em 3.4em 1fr;gap:8px;padding:8px 12px;border-top:1px solid var(--line);align-items:start;font-size:.88rem}
.dr .dt{font-variant-numeric:tabular-nums;font-weight:700}
.dr .dt.we{color:var(--accent-ink)}
.dr .nn{color:var(--muted);font-size:.78rem;padding-top:2px}
.dr .memo{display:block;color:var(--muted);font-size:.78rem;line-height:1.5;margin-top:2px}
.lb{display:inline-block;border-radius:6px;padding:1px 8px;font-size:.8rem;font-weight:700;border:1px solid var(--line);background:var(--surface-2);line-height:1.6}
.lb.rec{background:var(--ok);color:#fff;border-color:var(--ok)}
.lb.nogym{background:var(--ok-soft);color:var(--ok);border-color:var(--ok)}
.lb.light,.lb.sub{background:var(--surface);border-style:dashed}
.lb.hard,.lb.hshort{background:var(--accent-soft);color:var(--accent-ink);border-color:var(--accent)}
.lb.game{background:var(--navy);color:var(--navy-ink);border-color:var(--navy)}
.lb.active{background:var(--ev-sure-soft);color:var(--ev-sure);border-color:var(--ev-sure)}
.lb.alt{background:transparent;color:var(--ok);border:1px dashed var(--ok);margin-left:4px}
.dr.is-rec{background:var(--ok-soft)}
.wk .alert{margin:8px 12px}
.wk .info{margin:8px 12px;font-size:.85rem;border-radius:8px;padding:8px 12px;background:var(--surface-2);border:1px solid var(--line)}
.legend2{display:flex;flex-wrap:wrap;gap:6px}
.explain{display:flex;flex-direction:column;gap:8px;font-size:.88rem}
.explain>div{display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start}
.ovsel{display:block;margin-top:6px;min-height:34px;font-size:.8rem;border:1px solid var(--line);border-radius:6px;background:var(--surface-2);color:var(--muted);padding:2px 6px;max-width:100%}
.ovsel.set{border-color:var(--accent);color:var(--accent-ink);font-weight:700}
@media (max-width:380px){.dr{grid-template-columns:4.2em 1fr}.dr .nn{display:none}}

/* sheet */
.sheet-bg{position:fixed;inset:0;background:rgba(10,18,34,.45);z-index:20}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:21;background:var(--surface);color:var(--ink);border-radius:16px 16px 0 0;padding:18px 16px calc(18px + env(safe-area-inset-bottom,0px));max-width:640px;margin:0 auto;display:flex;flex-direction:column;gap:10px;box-shadow:0 -6px 24px rgba(0,0,0,.2)}
.sheet .close{align-self:flex-end;border:1px solid var(--line);background:var(--surface-2);border-radius:8px;padding:6px 14px;min-height:40px;cursor:pointer}
.sheet .item{font-size:.88rem;color:var(--muted);border-top:1px solid var(--line);padding-top:8px}
@media (prefers-reduced-motion:no-preference){.tl-bar{transition:height .3s ease}}
.sheet{max-height:85vh;overflow-y:auto}
.sheet-body{display:flex;flex-direction:column;gap:10px;font-size:.9rem}

/* meals */
.ev.unver{color:var(--warn);background:var(--warn-soft);border-style:dotted}
.mealbtn{display:block;margin-top:4px;min-height:32px;padding:2px 0;border:0;background:none;color:var(--accent-ink);font-size:.8rem;font-weight:700;text-align:left;cursor:pointer;text-decoration:underline dotted;text-underline-offset:3px}
.result .mealbtn{color:var(--accent)}
.meals{display:flex;flex-direction:column;gap:8px}
.meal-d{border:1px solid var(--line);border-radius:10px;padding:4px 12px}
.meal-d summary{cursor:pointer;min-height:44px;display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:.92rem;font-weight:700}
.meal-body{display:flex;flex-direction:column;gap:10px;padding:4px 0 12px}

/* ---------- 年間トレーニング計画 ---------- */
:root{
  --ph-base:#d8e6f7; --ph-spec:#d3eedf; --ph-peak:#fde0c4; --ph-taper:#efdcf3; --ph-comp:#f7cfca; --ph-recov:#e6e8ec; --ph-reprep:#e3efc4;
  --mk3:#14284b; --mk3-ink:#ffffff; --mk2:#b7c3d9; --mk2-ink:#13213a; --mk1:#f1f3f7; --mk1-ink:#7a8496;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --ph-base:#1e3557; --ph-spec:#1d4234; --ph-peak:#55361a; --ph-taper:#43294b; --ph-comp:#5a2621; --ph-recov:#2c3445; --ph-reprep:#3a4720;
  --mk3:#c9d6ef; --mk3-ink:#0b1322; --mk2:#4b5f83; --mk2-ink:#eef2f9; --mk1:#18253e; --mk1-ink:#8794ab;
}}
:root[data-theme="dark"]{
  --ph-base:#1e3557; --ph-spec:#1d4234; --ph-peak:#55361a; --ph-taper:#43294b; --ph-comp:#5a2621; --ph-recov:#2c3445; --ph-reprep:#3a4720;
  --mk3:#c9d6ef; --mk3-ink:#0b1322; --mk2:#4b5f83; --mk2-ink:#eef2f9; --mk1:#18253e; --mk1-ink:#8794ab;
}
.viewtabs{display:grid;grid-template-columns:1fr 1fr;gap:0;border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--surface)}
.vtab{border:0;background:transparent;min-height:50px;padding:8px 10px;font-size:.95rem;font-weight:700;cursor:pointer;color:var(--muted);line-height:1.3}
.vtab+.vtab{border-left:1px solid var(--line)}
.vtab[aria-selected=true]{background:var(--navy);color:var(--navy-ink)}
.view{display:flex;flex-direction:column;gap:16px;min-width:0}
.field input[type=text]{width:100%;min-height:46px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:8px 12px;font-size:1rem}
.ylist{display:flex;flex-direction:column;gap:10px}
.ybtn{align-self:flex-start;border:1px dashed var(--navy);background:var(--surface);color:var(--ink);border-radius:8px;min-height:44px;padding:6px 14px;font-weight:700;cursor:pointer}
.ybtn.small{min-height:36px;padding:4px 12px;font-size:.82rem;border-style:solid;border-color:var(--line);font-weight:500}
.yev{border:1px solid var(--line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:8px;background:var(--surface)}
.yev.off{background:var(--surface-2);opacity:.75}
.yev-top{display:flex;align-items:center;gap:8px}
.yev-top input{flex:1;min-width:0;min-height:42px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:6px 10px;font-size:1rem;font-weight:700}
.yev-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:8px}
.yev-grid label,.ytest label{display:flex;flex-direction:column;gap:2px;font-size:.75rem;color:var(--muted);min-width:0}
.yev-grid input,.yev-grid select,.ytest input{width:100%;min-width:0;min-height:42px;border:1px solid var(--line);border-radius:8px;background:var(--surface-2);padding:4px 8px;font-size:.95rem;color:var(--ink)}
.yev-foot{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}
.yev-foot .switch{font-size:.85rem;min-height:36px}
.ytest{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end}
.flag{display:inline-flex;align-items:center;justify-content:center;min-width:1.6em;height:1.6em;border-radius:4px;font-family:var(--f-num);font-weight:700;font-size:.9rem;line-height:1;border:1.5px solid var(--navy);flex:none}
.flag.A{background:var(--accent);border-color:var(--accent);color:#fff}
.flag.B{background:var(--surface);color:var(--ink)}
.flag.C{background:var(--surface);color:var(--muted);border-style:dashed;border-color:var(--muted)}
.lb.ph-base,.bp.ph-base{background:var(--ph-base)} .lb.ph-spec,.bp.ph-spec{background:var(--ph-spec)}
.lb.ph-peak,.bp.ph-peak{background:var(--ph-peak)} .lb.ph-taper,.bp.ph-taper{background:var(--ph-taper)}
.lb.ph-comp,.bp.ph-comp{background:var(--ph-comp)} .lb.ph-recov,.bp.ph-recov{background:var(--ph-recov)}
.lb.ph-reprep,.bp.ph-reprep{background:var(--ph-reprep)}
button.lb{cursor:pointer;color:var(--ink);min-height:30px}
.band-scroll{overflow-x:auto;border:1px solid var(--line);border-radius:10px;-webkit-overflow-scrolling:touch}
.band{display:grid;grid-template-columns:6.4em repeat(var(--n),30px);width:max-content;font-size:.72rem;line-height:1.2}
.band>*{border-bottom:1px solid var(--line);min-height:26px;display:flex;align-items:center;justify-content:center;text-align:center}
.band .bl{position:sticky;left:0;z-index:2;background:var(--surface-2);justify-content:flex-start;padding:2px 6px;font-weight:700;color:var(--muted);border-right:1px solid var(--line);text-align:left}
.band .bm{justify-content:flex-start;padding-left:4px;font-weight:700;border-left:1px solid var(--line);white-space:nowrap;overflow:hidden}
.band .bw{border:0;border-bottom:1px solid var(--line);background:transparent;font-family:var(--f-num);font-size:.85rem;cursor:pointer;flex-direction:column;padding:0;min-height:36px;color:var(--muted)}
.band .bw b{font-family:var(--f-body);font-size:.6rem;color:#fff;background:var(--accent);border-radius:3px;padding:0 3px}
.band .bp{border:0;border-bottom:1px solid var(--line);border-left:1px solid var(--surface);min-height:40px;font-weight:700;font-size:.72rem;color:var(--ink);cursor:pointer;padding:0 2px;overflow:hidden;word-break:break-all}
.band .be{gap:1px;flex-wrap:wrap}
.band .be .flag{font-size:.75rem;min-width:1.4em;height:1.4em}
.band .bk{font-size:.85rem}
.band .bk.m3{background:var(--mk3);color:var(--mk3-ink)}
.band .bk.m2{background:var(--mk2);color:var(--mk2-ink)}
.band .bk.m1{background:var(--mk1);color:var(--mk1-ink)}
.band .bn{flex-direction:column;font-size:.68rem;font-weight:700;color:var(--accent-ink);min-height:30px}
.band .now{box-shadow:inset 2px 0 0 var(--accent),inset -2px 0 0 var(--accent)}
.band .bw.now{color:var(--accent-ink);font-weight:700}
.ylegend{display:flex;flex-direction:column;gap:8px}
.mk{display:inline-flex;align-items:center;justify-content:center;min-width:1.8em;height:1.8em;border-radius:4px;font-weight:700;font-size:.8rem;border:1px solid var(--line);color:var(--accent-ink)}
.mk.m3{background:var(--mk3);color:var(--mk3-ink)} .mk.m2{background:var(--mk2);color:var(--mk2-ink)} .mk.m1{background:var(--mk1);color:var(--mk1-ink)}
.mk.mL,.band .bk.mL{background:var(--ph-recov);color:var(--ink);font-size:.75rem}
#yPri>div{grid-template-columns:2em 1fr}
@media (max-width:380px){.yev-grid{grid-template-columns:1fr 1fr}.yev-grid label:first-child{grid-column:1/-1}}
.lg{display:inline-flex;align-items:center;gap:4px;margin-right:8px}
.band-key{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:.82rem;line-height:1.5}
.band-key li{display:grid;grid-template-columns:2em 1fr;gap:8px;align-items:start;break-inside:avoid}
.band-key .mk{height:1.7em}
.yweek{display:flex;flex-direction:column;gap:12px}
.ynow-aim{color:var(--navy-muted);font-size:.92rem}
.ynow-chip{margin-left:8px;vertical-align:middle;color:var(--ink);font-size:.8rem}
.result .ybtn{background:var(--surface);color:var(--ink);border-style:solid}
.ymenus{display:flex;flex-direction:column;gap:8px}
.ymenu{border:1px solid var(--line);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:4px;font-size:.93rem;break-inside:avoid}
.ymenu-h{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.ymenu-h .hint{margin-left:auto}
.ypain{display:flex;flex-direction:column;gap:2px}
.notice a{color:var(--accent-ink);font-weight:700}
.yalloc{display:flex;flex-direction:column;gap:6px}
.yalloc-main{display:grid;grid-template-columns:1fr auto 1fr;gap:8px;align-items:stretch}
.yalloc-main>div{border:1px solid var(--line);border-radius:10px;padding:8px 10px;display:flex;flex-direction:column;gap:2px;background:var(--surface-2)}
.yalloc-main>div:last-child{border-color:var(--accent);background:var(--accent-soft)}
.yalloc-main span{font-size:.78rem;color:var(--muted);line-height:1.35}
.yalloc-main strong{font-family:var(--f-num);font-size:1.6rem;line-height:1.1}
.yalloc-main>b{align-self:center;font-size:1.2rem;color:var(--muted)}
.yalloc-rest{font-size:.88rem;color:var(--muted)}
.yev-fixed{color:var(--warn);font-weight:700}
.ymenu-kv{display:grid;grid-template-columns:auto 1fr;gap:2px 10px;margin:0;font-size:.88rem}.ymenu-kv dt{color:var(--muted);font-size:.8rem}.ymenu-kv dd{margin:0}

/* ---------- 印刷 ---------- */
.yprint{display:flex;flex-wrap:wrap;gap:8px}
.print-only{display:none}
@media print{
  /* 端末がダーク表示でも、印刷は明るい色にする */
  :root,:root:not([data-theme="light"]),:root[data-theme="dark"]{
    --bg:#fff; --surface:#fff; --surface-2:#f4f6f9; --ink:#000; --muted:#333; --line:#999;
    --navy:#14284b; --navy-ink:#fff; --accent:#e2691a; --accent-ink:#9a420a; --accent-soft:#fde9d9;
    --ph-base:#d8e6f7; --ph-spec:#d3eedf; --ph-peak:#fde0c4; --ph-taper:#efdcf3; --ph-comp:#f7cfca; --ph-recov:#e6e8ec; --ph-reprep:#e3efc4;
    --mk3:#14284b; --mk3-ink:#fff; --mk2:#b7c3d9; --mk2-ink:#000; --mk1:#fff; --mk1-ink:#444;
    color-scheme:light;
  }
  *{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  html,body{margin:0;padding:0;min-width:0}
  body{background:#fff;color:#000}
  .viewtabs,.sheet,.sheet-bg,button,select,input,#view-year{display:none !important}
  body.printing-year .wrap,body.printing-week .wrap{display:none !important}
  body.printing-year #printYear,body.printing-week #printWeek{display:block}
}
/* 印刷の中身。.print-only は画面では表示しないので、ここから下は印刷のときだけ見える。
   印刷の前に画面の外で同じ大きさに組んで高さを測り、1枚を超えるときだけ縮める（season-app.js の fitPage） */
  /* 中身の幅は余白（15mm）の内側に必ず収める。長い語は折り返し、表は幅に合わせて縮める */
  .print-only{width:100%;max-width:100%;padding:0 .5mm;overflow-wrap:anywhere;background:#fff;color:#000}
  .print-only table{width:100%;max-width:100%;table-layout:fixed}
  .print-only *{min-width:0}
  /* 文字は本文10pt以上（表の小さな数字・記号だけ例外） */
  .print-only h1{font-size:15pt;margin:0;line-height:1.25}
  .print-only h2{font-size:11.5pt;margin:2.5mm 0 1.2mm}
  .print-only p,.print-only li{margin:0}
  .pr-head{display:flex;justify-content:space-between;align-items:flex-end;gap:4mm;border-bottom:.6mm solid #14284b;padding-bottom:1.5mm;margin-bottom:2mm}
  .pr-head>div{flex:none}
  .pr-head p{font-size:10pt;line-height:1.3;flex:1 1 auto;text-align:right}
  .pr-head h1{white-space:nowrap}
  .pr-head .pr-date{font-size:12pt;font-weight:700;text-align:left}
  .pr-disc{margin-top:2.5mm !important;border:.3mm solid #999;padding:1.5mm 3mm;font-size:10pt;line-height:1.35;font-weight:700}
  .pr-small{font-size:10pt;color:#222}
  .pr-ph{display:inline-block;border:.3mm solid #666;border-radius:1mm;padding:0 1.5mm;font-weight:700;margin-right:2mm}
  .pr-ph.ph-base,.pp .ph-base{background:var(--ph-base)} .pr-ph.ph-spec,.pp .ph-spec{background:var(--ph-spec)}
  .pr-ph.ph-peak,.pp .ph-peak{background:var(--ph-peak)} .pr-ph.ph-taper,.pp .ph-taper{background:var(--ph-taper)}
  .pr-ph.ph-comp,.pp .ph-comp{background:var(--ph-comp)} .pr-ph.ph-recov,.pp .ph-recov{background:var(--ph-recov)}
  .pr-ph.ph-reprep,.pp .ph-reprep{background:var(--ph-reprep)}
  .print-only .flag{font-size:9pt;min-width:4.6mm;height:4.6mm;border-width:.3mm}
  .print-only table,.print-only .ymenu,.print-only li,.pr-bottom>div,.pr-cols>div{break-inside:avoid}
  /* 記号：白黒でも◎○△軽が見分けられるよう、背景の濃さと文字の両方で示す */
  .print-only .mk{min-width:5mm;height:5mm;font-size:10pt;border:.3mm solid #666;border-radius:.8mm}
  .print-only .mk.m3,.pband .pk td.m3{background:var(--mk3);color:var(--mk3-ink)}
  .print-only .mk.m2,.pband .pk td.m2{background:var(--mk2);color:var(--mk2-ink)}
  .print-only .mk.m1,.pband .pk td.m1{background:#fff;color:#000}
  .print-only .mk.mL,.pband .pk td.mL{background:#fff;color:#000;font-weight:700}

  /* 年間計画（A4横） */
  #printYear{font-size:10pt;line-height:1.35}
  .pr-evs{display:flex;flex-direction:column;gap:.6mm;margin:0 0 2mm;font-size:10pt}
  .pband{width:100%;table-layout:fixed;border-collapse:collapse;font-size:8pt;line-height:1.15}
  .pband col.pl{width:8.5%}
  .pband th,.pband td{border:.15mm solid #888;padding:0;text-align:center;height:4.4mm;white-space:nowrap;overflow:hidden}
  .pband th{text-align:left;padding-left:1mm;font-size:8.5pt;background:#f4f6f9;color:#000}
  .pband .pm td{font-weight:700;text-align:left;padding-left:.6mm;font-size:8.5pt}
  .pband .pw td{font-size:7.5pt;color:#000}
  .pband .pe td{font-weight:700;font-size:9pt}
  .pband .pp td{height:13mm;font-weight:700;font-size:8pt;line-height:1.12;white-space:normal;padding:0 .3mm}
  .pband .pk td{font-size:10pt;height:4.6mm}
  .pband .pn td{font-size:8pt;font-weight:700;white-space:normal;height:5mm;line-height:1.02}
  .pband .pn td span{display:block}
  .pband td.now{border-left:.8mm solid #000;border-right:.8mm solid #000}
  .pr-key{display:flex;flex-wrap:wrap;gap:1mm 6mm;font-size:10pt;margin-top:.6mm !important}
  .pr-key span{white-space:nowrap}
  .pr-prev{display:grid;grid-template-columns:5.5mm 1fr;gap:1.5mm;align-items:start;font-size:10pt;line-height:1.22;margin-top:.4mm !important}
  #printYear h2{font-size:11pt;margin:1mm 0 .4mm}
  #printYear .pr-evs{margin-bottom:1mm;gap:.3mm}
  #printYear .pr-head{margin-bottom:1.2mm}
  #printYear .pr-date{font-size:10pt;font-weight:500}
  #printYear .pr-disc{margin-top:1mm !important;padding:.6mm 3mm;line-height:1.25}
  #printYear .pr-head p{line-height:1.2}
  .pr-bottom{display:grid;grid-template-columns:1.5fr .8fr 2fr;gap:4mm}
  .pr-bottom>div:last-child .band-key{display:block;column-count:2;column-gap:5mm}
  .pr-bottom>div:last-child .band-key li{margin-bottom:.6mm}
  .pr-aims{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:.5mm;line-height:1.3}
  .pr-aims .pr-ph{margin-right:1.5mm;padding:0 1mm}
  #printYear .band-key{font-size:10pt;gap:.4mm;margin:0;line-height:1.22}
  #printYear .pr-aims{line-height:1.22;gap:.3mm}
  #printYear .band-key li{grid-template-columns:5.5mm 1fr;gap:1.5mm}

  /* 今週のメニュー（A4縦・文字大きめ） */
  #printWeek{font-size:10.5pt;line-height:1.3}
  #printWeek h2{font-size:12pt;border-left:1.2mm solid #14284b;padding-left:2mm;margin:1.6mm 0 .8mm}
  .pr-top{border:.4mm solid #14284b;border-radius:2mm;padding:1mm 3mm;display:flex;flex-direction:column;gap:.3mm;font-size:10pt}
  #printWeek .pr-disc{padding:1mm 3mm;line-height:1.25;margin-top:1.5mm !important}
  .pr-phase{font-size:12pt}
  .pr-alert{margin-top:1.5mm !important;border:.7mm solid #000;border-radius:1.5mm;padding:1mm 2.5mm;font-size:10.5pt;font-weight:700;background:#fde9d9}
  .pr-days{width:100%;border-collapse:collapse;font-size:10pt;line-height:1.22}
  .pr-days th,.pr-days td{border:.2mm solid #666;padding:.5mm 1.2mm;text-align:left;vertical-align:top;white-space:normal}
  .pr-days thead th{background:#f4f6f9;font-size:10pt;color:#000}
  .pr-days tbody th{font-size:10pt;background:#f4f6f9;color:#000}
  .pr-days tbody th span{display:block;font-size:10pt;font-weight:500}
  .pr-days .c-name{width:17%} .pr-days .c-reps{width:16%} .pr-days .c-rest{width:15%} .pr-days .c-rpe{width:13%}
  .pr-sched{width:100%;border-collapse:collapse;margin-bottom:1.5mm;font-size:10pt;line-height:1.25}
  .pr-sched th,.pr-sched td{border:.2mm solid #666;padding:.5mm 1mm;text-align:center;vertical-align:top}
  .pr-sched th{background:#f4f6f9;color:#000;font-size:10.5pt}
  .pr-sched th span{display:inline-block;font-size:10pt;font-weight:500;white-space:nowrap}
  .pr-days tr{break-inside:avoid}
  .pr-notes{margin:1.2mm 0 0;padding-left:5mm;font-size:10pt;line-height:1.25;column-count:2;column-gap:6mm}
  .pr-notes li{break-inside:avoid}
  .pr-cols{display:grid;grid-template-columns:1fr 1.2fr;gap:5mm}
  .pr-check{list-style:none;margin:0;padding:0;font-size:10.5pt;line-height:1.25}
  .pr-red{font-weight:700;font-size:10pt;line-height:1.25;border-left:1mm solid #000;padding-left:2mm;margin:.8mm 0 !important}
  .pr-safe{margin:0;padding-left:5mm;font-size:10pt;line-height:1.25}
  #printWeek .pr-small{line-height:1.25}
  .pr-alloc{display:flex;align-items:baseline;gap:2mm;flex-wrap:wrap;font-size:10pt}
  .pr-alloc+.pr-alloc{margin-top:1mm !important}
  .pr-alloc span{border:.3mm solid #666;border-radius:1mm;padding:.3mm 2mm}
  .pr-alloc strong{font-size:13pt}
  .pr-alloc small{font-size:10pt}
  .pr-at{border-collapse:collapse;font-size:10pt;line-height:1.2}
  .pr-at th,.pr-at td{border:.2mm solid #666;padding:.4mm 1.5mm;text-align:center}
  .pr-at tr:first-child th{background:#f4f6f9}
  .pr-at tbody th,.pr-at tr+tr th{text-align:left;background:#f4f6f9}
  .pr-at strong{font-size:12pt}
