:root{
  --bg:#f6f7f9;--surface:#fff;--fill:#f0f2f5;--line:#e6e8ec;
  --text:#16181d;--text2:#5b6270;--text3:#8b92a0;
  --blue:#2f6bff;--blue-w:#e8efff;--green:#16a34a;--green-w:#e4f5ea;
  --orange:#c2690a;--orange-w:#fdf1e1;--red:#e5484d;--red-w:#fdeaea;
  --purple:#7056f0;--purple-w:#eeeaff;--gray:#6b7280;--gray-w:#eef0f3;
  --main:var(--blue);--on-main:#fff;--sun:#e5484d;--sat:#2f6bff;
  --r:14px;--tab-h:64px;--safe-b:env(safe-area-inset-bottom,0px);
  color-scheme:light;
}
[data-theme=dark]{
  --bg:#0f1115;--surface:#181b21;--fill:#22262e;--line:#2a2e36;
  --text:#f2f4f7;--text2:#a9b0bc;--text3:#747c89;
  --blue:#6b95ff;--blue-w:#1d2944;--green:#3ccb76;--green-w:#16301f;
  --orange:#f0a63a;--orange-w:#3a2c14;--red:#ff6b6b;--red-w:#3d1d1f;
  --purple:#a48fff;--purple-w:#2a2445;--gray:#9aa1ad;--gray-w:#262a32;
  --sun:#ff6b6b;--sat:#6b95ff;color-scheme:dark;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:'Pretendard Variable',Pretendard,system-ui,-apple-system,sans-serif;font-size:16px;line-height:1.5;-webkit-font-smoothing:antialiased}
button,input,select,textarea{font:inherit;color:inherit}
button{background:none;border:0;padding:0;cursor:pointer}
svg.i{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
#app{max-width:560px;margin:0 auto;min-height:100dvh;background:var(--surface);position:relative}
#view{padding-bottom:calc(var(--tab-h) + 88px + var(--safe-b))}

.hd{display:flex;align-items:center;justify-content:space-between;padding:14px 12px 8px;position:sticky;top:0;background:var(--surface);z-index:5}
.hd h1{font-size:22px;font-weight:700;margin:0 6px}
.hd .nav{display:flex;align-items:center}
.ib{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:12px;color:var(--text2)}
.ib:active{background:var(--fill)}
.pill{font-size:14px;font-weight:600;padding:7px 13px;border-radius:999px;background:var(--fill);color:var(--text2);display:inline-flex;align-items:center;gap:5px}
.pill.on{background:var(--blue-w);color:var(--blue)}

.wk,.grid{display:grid;grid-template-columns:repeat(7,1fr);padding:0 6px}
.wk div{text-align:center;font-size:13px;font-weight:600;color:var(--text2);padding:4px 0}
.wk .su{color:var(--sun)}.wk .sa{color:var(--sat)}
.day{height:64px;display:flex;flex-direction:column;align-items:center;gap:3px;padding-top:4px}
.day .n{width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;font-size:16px;font-weight:600}
.day.red .n{color:var(--sun)}.day.blue .n{color:var(--sat)}
.day.today:not(.sel) .n{box-shadow:inset 0 0 0 2px var(--main)}
.day.sel .n{background:var(--main);color:var(--on-main)}
.day.out{opacity:.35}
.sh{font-size:11px;font-weight:700;line-height:1;padding:3px 5px;border-radius:5px}
.sh-gap{height:17px}
.dots{display:flex;gap:3px;height:5px}
.dots i{width:5px;height:5px;border-radius:50%;background:var(--text3)}

.c-blue{background:var(--blue-w);color:var(--blue)}.c-green{background:var(--green-w);color:var(--green)}
.c-orange{background:var(--orange-w);color:var(--orange)}.c-red{background:var(--red-w);color:var(--red)}
.c-purple{background:var(--purple-w);color:var(--purple)}.c-gray{background:var(--gray-w);color:var(--gray)}
.bg-blue{background:var(--blue)}.bg-green{background:var(--green)}.bg-orange{background:var(--orange)}
.bg-red{background:var(--red)}.bg-purple{background:var(--purple)}.bg-gray{background:var(--gray)}

.detail{border-top:1px solid var(--line);margin-top:6px;padding:16px 20px}
.dh{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.dh b{font-size:19px;font-weight:700;margin-right:auto}
.tag{font-size:13px;font-weight:600;padding:4px 9px;border-radius:7px}
.lab{display:flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--text2);margin:20px 0 4px}
.lab svg.i{width:18px;height:18px}
.row{display:flex;align-items:center;gap:12px;min-height:52px;padding:6px 0;border-bottom:1px solid var(--line);width:100%;text-align:left}
.row:last-child{border-bottom:0}
.bar{width:4px;align-self:stretch;margin:6px 0;border-radius:2px}
.tm{width:64px;font-size:14px;color:var(--text2);font-variant-numeric:tabular-nums;line-height:1.3}
.tx{flex:1;min-width:0;font-size:16px}
.tx small{display:block;font-size:13px;color:var(--text3)}
.chk{width:26px;height:26px;border-radius:8px;border:2px solid var(--text3);display:flex;align-items:center;justify-content:center;color:#fff;flex-shrink:0}
.chk svg.i{width:16px;height:16px;stroke-width:2.6}
.done .chk{background:var(--green);border-color:var(--green)}
.done .tx{color:var(--text3);text-decoration:line-through}
.pri{width:8px;height:8px;border-radius:50%;background:var(--red);flex-shrink:0}
.late{font-size:12px;font-weight:600;color:var(--red);background:var(--red-w);padding:2px 7px;border-radius:6px;flex-shrink:0}
.empty{font-size:15px;color:var(--text3);padding:10px 0}
.memo{display:block;width:100%;text-align:left;background:var(--fill);border-radius:12px;padding:12px 14px;margin-top:8px}
.memo b{display:block;font-weight:600}
.memo p{margin:2px 0 0;color:var(--text2);font-size:15px;white-space:pre-wrap;overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical}
.memo small{display:block;color:var(--text3);font-size:13px;margin-top:6px}

.pad{padding:0 20px}
.segs{display:flex;gap:8px;padding:4px 20px 8px}
.seg{font-size:15px;font-weight:600;padding:8px 16px;border-radius:999px;background:var(--fill);color:var(--text2)}
.seg.on{background:var(--text);color:var(--surface)}
.sum{display:flex;justify-content:space-between;align-items:center;background:var(--blue-w);border-radius:var(--r);padding:16px 18px;margin:6px 0 4px}
.sum span{color:var(--text2);font-weight:600}
.sum b{font-size:28px;font-weight:700;color:var(--blue)}
.sum b small{font-size:16px;color:var(--text2);font-weight:600}
.search{display:flex;align-items:center;gap:8px;background:var(--fill);border-radius:12px;padding:0 12px;margin:4px 20px 8px;height:46px;color:var(--text3)}
.search input{flex:1;border:0;background:none;outline:none;font-size:16px;color:var(--text)}

.set .row{min-height:58px}
.set .tx{font-weight:600}
.set .tx small{font-weight:400}
.sw{width:50px;height:30px;border-radius:15px;background:var(--line);position:relative;flex-shrink:0;transition:background .15s}
.sw::after{content:'';position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;transition:left .15s}
.sw.on{background:var(--main)}.sw.on::after{left:23px}
.chips{display:flex;flex-wrap:wrap;gap:8px;padding:8px 0}
.chip{font-size:15px;font-weight:600;padding:8px 12px;border-radius:10px;display:inline-flex;align-items:center;gap:6px}
.chip .x{opacity:.6;display:inline-flex}
.chip .x svg.i{width:15px;height:15px}
.chip.add{border:1.5px dashed var(--text3);color:var(--text2);background:none}
.hint{font-size:13px;color:var(--text3);margin:2px 0 6px}
.tname{flex:1;min-width:0;border:0;background:none;font-weight:600;font-size:16px;padding:6px 0;outline:none}
.tname:focus{border-bottom:2px solid var(--main)}
.swatch{width:28px;height:28px;border-radius:50%;flex-shrink:0}
.ver{text-align:center;color:var(--text3);font-size:13px;padding:24px 0}
input.date{border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:8px 10px;font-size:15px;color:var(--blue);font-weight:600}

.fab{position:fixed;right:max(18px,calc(50% - 262px));bottom:calc(var(--tab-h) + 18px + var(--safe-b));width:60px;height:60px;border-radius:50%;background:var(--main);color:var(--on-main);display:flex;align-items:center;justify-content:center;z-index:20;box-shadow:0 4px 14px rgba(47,107,255,.35)}
.fab svg.i{width:28px;height:28px;stroke-width:2.2}
.fab[hidden]{display:none}
.tabs{position:fixed;left:50%;transform:translateX(-50%);bottom:0;width:100%;max-width:560px;display:grid;grid-template-columns:repeat(4,1fr);background:var(--surface);border-top:1px solid var(--line);padding:6px 0 calc(6px + var(--safe-b));z-index:20}
.tabs button{display:flex;flex-direction:column;align-items:center;gap:2px;font-size:12px;font-weight:600;color:var(--text3);padding:4px 0}
.tabs button svg.i{width:25px;height:25px}
.tabs button.on{color:var(--main)}

.overlay{position:fixed;inset:0;background:rgba(0,0,0,.42);z-index:50;display:flex;align-items:flex-end;justify-content:center}
.overlay[hidden]{display:none}
.overlay.center{align-items:center;padding:24px}
.sheet{background:var(--surface);width:100%;max-width:560px;border-radius:22px 22px 0 0;padding:10px 20px calc(18px + var(--safe-b));max-height:92dvh;overflow:auto;animation:up .2s ease-out}
@keyframes up{from{transform:translateY(30px);opacity:.6}}
.grab{width:40px;height:4px;border-radius:2px;background:var(--line);margin:0 auto 12px}
.ktabs{display:flex;gap:4px;background:var(--fill);border-radius:12px;padding:4px}
.ktabs button{flex:1;padding:9px 0;border-radius:9px;font-weight:600;color:var(--text2)}
.ktabs button.on{background:var(--surface);color:var(--text);box-shadow:0 0 0 1px var(--line)}
.shead{display:flex;align-items:center;justify-content:space-between}
.shead b{font-size:18px}
.title{width:100%;border:0;background:none;font-size:21px;font-weight:700;padding:14px 0 4px;outline:none}
.err{font-size:14px;color:var(--red);min-height:20px}
.f{display:flex;align-items:center;gap:12px;min-height:56px;border-bottom:1px solid var(--line);font-size:16px;white-space:nowrap}
.f svg.i{color:var(--text2)}
.f .v{margin-left:auto;display:flex;gap:6px;align-items:center;min-width:0}
.f .v:has(input[type=time]){flex:1;justify-content:flex-end}
.f input[type=time]{flex:1;min-width:0;max-width:150px;padding:8px 6px}
.f input[type=date],.f input[type=time],.f select{border:0;background:var(--fill);border-radius:10px;padding:8px 10px;font-size:15px;font-weight:600;color:var(--blue)}
.dotpick{width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;color:#fff}
.dotpick svg.i{width:16px;height:16px;stroke-width:2.6}
.prs{display:flex;gap:6px}
.prs button{font-size:14px;font-weight:600;padding:7px 13px;border-radius:999px;background:var(--fill);color:var(--text2)}
.prs button.on{background:var(--text);color:var(--surface)}
textarea.body{width:100%;min-height:140px;border:0;background:var(--fill);border-radius:12px;padding:12px 14px;font-size:16px;resize:vertical;outline:none;margin-top:6px}
.acts{display:flex;gap:10px;margin-top:18px}
.btn{flex:1;height:52px;border-radius:14px;font-size:16px;font-weight:700;background:var(--fill);color:var(--text)}
.btn.pri2{flex:2;background:var(--main);color:var(--on-main)}
.btn.del{flex:0 0 52px;color:var(--red);display:flex;align-items:center;justify-content:center}

.card{background:var(--surface);border-radius:20px;padding:24px 22px;max-width:360px;width:100%;text-align:center}
.card h2{font-size:21px;margin:8px 0 6px}
.card p{color:var(--text2);margin:0 0 20px;font-size:15px}
.card .btn{width:100%;margin-top:8px;flex:none}
.toast{position:fixed;left:50%;bottom:calc(var(--tab-h) + 92px + var(--safe-b));transform:translate(-50%,10px);background:var(--text);color:var(--surface);padding:10px 18px;border-radius:999px;font-size:15px;font-weight:600;opacity:0;pointer-events:none;transition:.2s;z-index:60;white-space:nowrap}
.toast.show{opacity:1;transform:translate(-50%,0)}
