:root{--bg:#faf6ee;--card:#fffdf8;--ink:#4a3a2e;--sub:#7d6b5c;--line:#e5dccb;--green:#7a9a7e;--green-d:#5c7d61;--green-l:#e6efe5;--accent:#c98f5a;--warn:#a5552f;--warn-l:#f8e6dc;--info-l:#eef2f6;--tap:48px}
*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
html,body{margin:0;height:100%;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,system-ui,sans-serif;font-size:16px;line-height:1.55;overflow-x:hidden}
body.modal-open{overflow:hidden}
.app{display:flex;flex-direction:column;height:100%;max-width:640px;margin:0 auto;background:var(--bg)}
.topbar{display:flex;align-items:center;justify-content:space-between;padding:calc(env(safe-area-inset-top) + 6px) 14px 6px;border-bottom:1px solid var(--line);background:var(--bg);min-height:56px}
.topbar h1{font-size:1.15rem;margin:0;font-weight:700;letter-spacing:.02em}
.main{flex:1;overflow-y:auto;overflow-x:hidden;-webkit-overflow-scrolling:touch;padding:12px 14px 24px;outline:none}
.tabbar{display:flex;border-top:1px solid var(--line);background:var(--card);padding-bottom:env(safe-area-inset-bottom)}
.tab{flex:1;min-height:56px;border:0;background:none;color:var(--sub);font:inherit;font-size:.78rem;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;cursor:pointer}
.tab-ico{font-size:1.2rem;line-height:1}
.tab.active{color:var(--green-d);font-weight:700;background:var(--green-l)}
.btn{min-height:var(--tap);padding:0 16px;border:1.5px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:.95rem;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;text-align:center}
.btn:active{filter:brightness(.95)}
.btn.primary{background:var(--green);border-color:var(--green-d);color:#fff;font-weight:700}
.btn.danger{background:var(--warn);border-color:var(--warn);color:#fff;font-weight:700}
.btn.danger-o{color:var(--warn);border-color:#e3bba8}
.btn.ghost{border-color:transparent;background:none;color:var(--green-d)}
.btn.small{min-height:44px;padding:0 12px;font-size:.88rem}
.btn.wide{width:100%}
.btn:disabled{opacity:.5}
.top-btn{min-width:64px}
.btn-row{display:flex;gap:10px;margin:14px 0}
.btn-row>.btn{flex:1}
.btn-row.tight{margin:8px 0}
.btn-row.wrap{flex-wrap:wrap}
.btn-row.wrap>.btn{flex:1 1 auto}
:focus-visible{outline:3px solid #6b8fb5;outline-offset:2px}
.field{width:100%;min-height:var(--tap);padding:8px 12px;border:1.5px solid var(--line);border-radius:12px;background:#fff;color:var(--ink);font:inherit;font-size:16px;margin:4px 0 8px}
textarea.field{min-height:0}
.mono{font-family:ui-monospace,Menlo,monospace;font-size:13px}
.hidden{display:none!important}
.lbl{display:block;font-size:.85rem;color:var(--sub);margin-top:10px;font-weight:600}
.lead{margin:4px 0 8px}
.sec{font-size:1rem;margin:20px 0 6px;padding-left:8px;border-left:4px solid var(--green)}
.note{font-size:.85rem;color:var(--sub);margin:6px 0}
.note.info{background:var(--info-l);padding:8px 10px;border-radius:10px}
.note.warn{background:var(--warn-l);color:var(--warn);padding:8px 10px;border-radius:10px}
.note.ok{color:var(--green-d);font-weight:600}
.note:empty{display:none}
.chips{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:8px 0}
.chip{display:flex;align-items:center;gap:8px;min-height:var(--tap);padding:6px 10px;border:1.5px solid var(--line);border-radius:12px;background:var(--card);cursor:pointer;font-size:.92rem}
.chip input{width:22px;height:22px;accent-color:var(--green-d);flex:none}
.chip:has(input:checked){background:var(--green-l);border-color:var(--green)}
.check-line{margin:12px 0 4px}
.create-summary{font-weight:700;color:var(--green-d);margin:10px 0}
.show-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.show-name{font-weight:700;font-size:1.05rem;overflow-wrap:anywhere}
.show-date{font-size:.8rem;color:var(--sub);overflow-wrap:anywhere}
.prog{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:10px 12px;margin:10px 0}
.prog-top{display:flex;align-items:baseline;gap:10px}
.pct{font-size:1.8rem;font-weight:800;color:var(--green-d);min-width:3.6ch}
.prog-text{font-size:.88rem;color:var(--sub)}
.bar{height:10px;background:var(--line);border-radius:6px;overflow:hidden;margin-top:6px}
.bar.small-bar{height:6px}
.bar-fill{height:100%;background:var(--green);transition:width .2s}
.seg{display:flex;gap:6px;margin:10px 0 4px}
.seg-btn{flex:1;min-height:var(--tap);border:1.5px solid var(--line);border-radius:12px;background:var(--card);color:var(--ink);font:inherit;font-size:.88rem;cursor:pointer}
.seg-btn.active{background:var(--green);border-color:var(--green-d);color:#fff;font-weight:700}
.search{margin-top:8px}
.group{margin:14px 0}
.group-head{display:flex;justify-content:space-between;align-items:center;font-size:.92rem;margin:0 0 4px;padding:6px 10px;background:var(--green-l);border-radius:10px;position:sticky;top:-1px;z-index:1}
.cnt{font-size:.8rem;color:var(--green-d);font-weight:700}
.items{list-style:none;margin:0;padding:0}
.item{display:flex;align-items:center;border-bottom:1px solid var(--line);background:var(--card)}
.row{display:flex;align-items:center;gap:12px;flex:1;min-height:var(--tap);padding:6px 8px;cursor:pointer;min-width:0}
.row.static{cursor:default}
.row input{position:absolute;opacity:0;width:1px;height:1px}
.box{flex:none;width:26px;height:26px;border:2px solid var(--green);border-radius:8px;background:#fff;display:inline-flex;align-items:center;justify-content:center}
.row input:checked+.box{background:var(--green);}
.row input:checked+.box::after{content:"✓";color:#fff;font-weight:800;font-size:1rem;line-height:1}
.row input:focus-visible+.box{outline:3px solid #6b8fb5;outline-offset:2px}
.name{flex:1;min-width:0;overflow-wrap:anywhere}
.is-done .name{color:#a89a8b;text-decoration:line-through;text-decoration-color:#c8bba9}
.is-done{background:#f4f0e6}
.badge{flex:none;font-size:.7rem;padding:2px 8px;border-radius:99px;background:var(--line);color:var(--sub)}
.badge.temp{background:#f6e3cf;color:#8a5a2b}
.badge.extra{background:var(--info-l);color:#3f5f80}
.badge.must{background:var(--green-l);color:var(--green-d);font-weight:700}
.badge.opt{background:#efe9dc}
.badge.cur{background:var(--green);color:#fff}
.master-item{flex-wrap:wrap;padding:2px 4px}
.item-actions{display:flex;gap:6px;margin-left:auto;padding:2px 4px}
.empty{padding:24px 8px;text-align:center;color:var(--sub)}
.card{background:var(--card);border:1px solid var(--line);border-radius:14px;padding:12px;margin:12px 0}
.card.current{border-color:var(--green);box-shadow:0 0 0 2px var(--green-l)}
.card-head{display:flex;justify-content:space-between;gap:8px;align-items:flex-start;margin-bottom:8px}
.card-prog{margin:6px 0;font-size:.88rem;color:var(--sub)}
.detail{margin-top:8px;border-top:1px dashed var(--line);padding-top:6px}
.dgroup{margin:10px 0 2px;font-size:.85rem;color:var(--green-d)}
.dlist{list-style:none;margin:0;padding:0}
.dlist li{display:flex;gap:8px;padding:6px 2px;border-bottom:1px solid var(--line);font-size:.92rem;min-height:36px;align-items:center}
.dlist .d-done{color:#a89a8b}
.dmark{width:1.4em;text-align:center;color:var(--green-d);font-weight:700;flex:none}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.help{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:0 12px;margin:8px 0}
.help summary{min-height:var(--tap);display:flex;align-items:center;font-weight:600;cursor:pointer}
.help ul{margin:0 0 10px;padding-left:1.2em;font-size:.9rem}
.help li{margin:4px 0}
.ver{text-align:center;color:var(--sub);font-size:.78rem;margin-top:24px}
.overlay{position:fixed;inset:0;background:rgba(60,45,30,.45);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.sheet{width:100%;max-width:640px;max-height:88vh;max-height:88dvh;overflow-y:auto;background:var(--bg);border-radius:18px 18px 0 0;padding:6px 14px calc(14px + env(safe-area-inset-bottom))}
.sheet-head{display:flex;justify-content:space-between;align-items:center;position:sticky;top:0;background:var(--bg);z-index:2}
.sheet-head h2{font-size:1.05rem;margin:0}
.confirm-msg{font-size:1rem;overflow-wrap:anywhere}
.sub{font-size:.85rem;color:var(--sub);margin:12px 0 4px}
.cands{list-style:none;margin:0;padding:0}
.cand{width:100%;min-height:var(--tap);display:flex;align-items:center;gap:8px;padding:6px 10px;margin:0;border:0;border-bottom:1px solid var(--line);background:var(--card);font:inherit;text-align:left;cursor:pointer;color:var(--ink)}
.cand .cat{font-size:.75rem;color:var(--sub)}
.cand .plus{font-weight:800;color:var(--green-d);font-size:1.2rem}
.toast{position:fixed;left:50%;bottom:calc(76px + env(safe-area-inset-bottom));transform:translate(-50%,20px);max-width:88%;background:#43362b;color:#fff;padding:10px 16px;border-radius:12px;font-size:.88rem;opacity:0;pointer-events:none;transition:opacity .2s,transform .2s;z-index:80}
.toast.show{opacity:1;transform:translate(-50%,0)}
.loading{text-align:center;color:var(--sub);margin-top:40px}
@media (prefers-reduced-motion:reduce){*{transition:none!important}}
