:root{
  --bg:#0b0d11;--panel:#131720;--panel2:#101722;--line:#262d39;--text:#f2f4f8;
  --muted:#939cab;--blue:#5aa7ff;--blue2:#8fc4ff;--orange:#ffb454;--red:#ff646e;
  --red2:#ffd3d7;--green:#62d394;--green2:#c8f3da;--gray:#7f8998;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--text);font-family:-apple-system,BlinkMacSystemFont,"Apple SD Gothic Neo","Noto Sans KR",sans-serif}
body{min-height:100vh;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom);overscroll-behavior-y:contain}
button,input,textarea{font:inherit}
button{touch-action:manipulation}
.wrap{max-width:760px;margin:0 auto;padding:18px 14px 30px}
.top{display:flex;justify-content:space-between;align-items:flex-start;gap:10px;margin-bottom:10px}
.title{font-size:25px;font-weight:850;letter-spacing:-.7px}
.date{font-size:11px;color:var(--muted);margin-top:4px}
.headerActions{display:grid;grid-template-columns:minmax(0,1.35fr) 42px 42px minmax(0,1fr);gap:7px;margin-bottom:13px}
.actionBtn{border:1px solid #526078;background:#1d2430;color:var(--text);font-size:12px;font-weight:850;padding:9px 8px;border-radius:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.actionBtn.square{font-size:15px;padding:7px 0}
.actionBtn:active{transform:scale(.97)}
.todoToolbar{display:flex;justify-content:flex-end;gap:7px;margin:0 0 8px}
.todoToolbar .actionBtn{min-width:58px}
.metrics{display:grid;grid-template-columns:repeat(5,1fr);gap:7px;margin:14px 0 12px}
.metric{background:var(--panel);border:1px solid var(--line);border-radius:12px;padding:10px 7px;text-align:center}
.metric b{display:block;font-size:20px}.metric span{font-size:11px;color:var(--muted)}
.search{width:100%;border:1px solid var(--line);background:var(--panel);color:var(--text);padding:11px 12px;border-radius:12px;outline:none;margin-bottom:9px}
.filters{display:flex;gap:7px;overflow:auto;padding-bottom:4px;margin-bottom:7px}
.filter{white-space:nowrap;border:1px solid var(--line);background:var(--panel);color:var(--muted);padding:8px 11px;border-radius:999px}
.filter.on{color:var(--text);border-color:#526078;background:#1d2430}
.filter[data-filter="withdrawal"]{color:var(--green);border-color:#315f48}
.filter[data-filter="withdrawal"].on{color:#d9f6e6;border-color:#3f8a63;background:#173326}
.case{background:var(--panel);border:1px solid var(--line);border-radius:15px;padding:13px;margin:9px 0}
.caseHead{display:flex;gap:9px;align-items:flex-start}
.ctitle{font-size:16px;font-weight:760;letter-spacing:-.25px;flex:1;cursor:pointer}
.badge{font-size:11px;font-weight:700;padding:5px 7px;border-radius:999px;border:1px solid currentColor;white-space:nowrap}
.active{color:var(--blue)}.waiting{color:var(--orange)}.ready{color:var(--green)}.hold{color:var(--gray)}
.urgent{color:var(--red)}.withdrawal{color:var(--green)}.not_started{color:var(--gray)}
.meta{font-size:12px;color:var(--muted);margin:6px 0 9px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.receiptChip{border:1px solid #465064;background:#181e28;color:#dce3ed;border-radius:999px;padding:4px 8px;font-size:12px;font-weight:760}
.receiptChip:active{transform:scale(.97)}
.row{display:grid;grid-template-columns:43px 1fr;gap:6px;font-size:13px;line-height:1.38;margin:4px 0 0}
.row .k{color:var(--muted)}
.todoSummary{color:var(--blue2)}
.stages{display:flex;gap:4px;margin:10px 0 0}.seg{height:5px;flex:1;border-radius:4px;background:#2a303a}
.seg.done{background:var(--green)}.seg.active{background:var(--blue)}
.age{font-size:11px;color:var(--muted);text-align:right;margin-top:8px}.age.warn{color:var(--orange)}.age.hot{color:var(--red);font-weight:700}
.empty{text-align:center;color:var(--muted);padding:28px 0}
.back{display:inline-flex;align-items:center;gap:4px;color:var(--blue);font-weight:700;cursor:pointer}
.detailNav{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}
.detailTitle{font-size:25px;font-weight:850;line-height:1.15;letter-spacing:-.6px}
.detailMeta{font-size:13px;color:var(--muted);margin:8px 0 14px;display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.box{background:var(--panel);border:1px solid var(--line);border-radius:15px;padding:13px;margin:10px 0}
.box h3{font-size:13px;color:var(--muted);margin:0 0 9px}
.current{font-size:18px;font-weight:780;line-height:1.35}.core{font-size:13px;line-height:1.55;color:#d5dae2;margin-top:8px}
.item{display:flex;gap:9px;align-items:flex-start;font-size:14px;line-height:1.45;padding:7px 0;border-top:1px solid #202630}
.item:first-of-type{border-top:0}.mark{width:20px;text-align:center;font-weight:900}
.mark.done{color:var(--green)}.mark.draft{color:var(--orange)}.mark.todo{color:var(--gray)}
.bigRows .item{display:grid;grid-template-columns:52px 1fr}.bigRows .mark{width:auto;color:var(--muted);font-size:12px;text-align:left}
.nextFocus{font-size:16px;font-weight:780}.waitingText{font-size:15px}
.footer{font-size:11px;color:#697383;text-align:center;padding:16px 5px 4px}
.toast{position:fixed;left:50%;bottom:calc(24px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(16px);background:#eef2f7;color:#11151c;font-size:13px;font-weight:750;padding:10px 13px;border-radius:10px;opacity:0;pointer-events:none;transition:.18s;z-index:9999;box-shadow:0 8px 30px #0008}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}

/* TODO BOARD V2 */
.todoSection{border:1px solid var(--line);border-radius:15px;padding:10px 11px;margin:9px 0;background:var(--panel2)}
.todoSection[data-theme="red"]{border-color:#653139}
.todoSection[data-theme="green"]{border-color:#28533d}
.sectionHead{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:2px 1px 8px}
.sectionTitle{font-size:15px;font-weight:850}
.todoSection[data-theme="red"] .sectionTitle{color:#ff7983}
.todoSection[data-theme="blue"] .sectionTitle{color:#7cbaff}
.todoSection[data-theme="green"] .sectionTitle{color:var(--green)}
.sectionCount{font-size:11px;color:var(--muted)}
.todoCaseGroup{border-top:1px solid #242b35;padding:8px 0}
.todoCaseGroup:first-child{border-top:0}
.todoCaseHead{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:7px;align-items:center}
.todoCaseTitle{background:transparent;border:0;color:var(--text);text-align:left;font-size:14px;font-weight:760;padding:5px 2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.expandBtn{border:1px solid #394455;background:#171d27;color:#d5deea;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:800}
.todoTasks{padding:6px 0 0 1px}
.todoTask{display:grid;grid-template-columns:30px minmax(0,1fr);gap:7px;padding:7px 0;border-top:1px solid #202832;align-items:start}
.todoCheck{width:28px;height:28px;border:0;background:transparent;font-size:19px;line-height:28px;padding:0;text-align:center}
.todoText{font-size:14px;line-height:1.4;padding-top:3px}
.todoSection[data-theme="red"] .todoCheck,.todoSection[data-theme="red"] .todoText{color:var(--red2)}
.todoSection[data-theme="blue"] .todoCheck{color:#67afff}
.todoSection[data-theme="green"] .todoCheck,.todoSection[data-theme="green"] .todoText{color:var(--green2)}
.todoTask.done .todoText{opacity:.68;text-decoration:line-through;text-decoration-thickness:1px}
.sectionEmpty{font-size:12px;color:var(--muted);padding:6px 2px 8px}

/* edit mode */
.editModeBanner{font-size:11px;color:#cbd7e7;margin-bottom:7px}
.editTaskList{min-height:26px}
.editTaskRow{display:grid;grid-template-columns:31px minmax(0,1fr) 22px;gap:7px;align-items:center;padding:9px 2px;border-top:1px solid #25303b;touch-action:none;user-select:none;-webkit-user-select:none}
.editTaskRow:first-child{border-top:0}
.editTaskMain{min-width:0}
.editTaskText{font-size:14px;font-weight:700;line-height:1.35}
.editTaskMeta{font-size:10px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dragGlyph{font-size:18px;color:#6f7b8d;text-align:center}
.dragSource{opacity:.18}
.dragPlaceholder{border:1px dashed #71839a;border-radius:10px;background:#18202b;margin:3px 0}
.dragGhost{position:fixed;left:12px;right:12px;z-index:99999;pointer-events:none;background:#202937;border:1px solid #7890aa;border-radius:12px;padding:10px 12px;box-shadow:0 16px 38px #000b;transform:scale(1.02);opacity:.97}
.todoSection.dragOver{outline:2px solid #7890aa;outline-offset:2px}

/* receipt editor */
.overlay{position:fixed;inset:0;background:#000a;display:flex;align-items:center;justify-content:center;padding:20px;z-index:100000}
.editorCard{width:min(520px,100%);background:#171c25;border:1px solid #3b4657;border-radius:16px;padding:15px}
.editorTitle{font-size:16px;font-weight:850;margin-bottom:10px}
.editorInput{width:100%;background:#0d1117;border:1px solid #4b586b;color:var(--text);border-radius:10px;padding:12px;font-size:16px;outline:none}
.editorActions{display:flex;justify-content:flex-end;gap:8px;margin-top:11px}

/* detail v2 */
.detailTodoSection{margin:8px 0}
.detailTodoLabel{font-size:12px;font-weight:850;margin-bottom:4px}
.detailTodoLabel.red{color:#ff7983}.detailTodoLabel.blue{color:#7cbaff}.detailTodoLabel.green{color:var(--green)}

/* memo */
.memoCard{width:min(680px,100%);max-height:88vh;display:flex;flex-direction:column}
.memoArea{width:100%;min-height:50vh;max-height:67vh;resize:none;background:#0c1016;border:1px solid #48566a;color:var(--text);border-radius:11px;padding:12px;font-size:15px;line-height:1.5;outline:none}
.memoActions{display:flex;justify-content:flex-end;gap:8px;margin-top:10px}
.actionBtn:disabled{opacity:.35}


/* WEB V1 · 2/8 temporary demo status. This phase has NO persistent writes. */
.demoNotice{background:#252117;border:1px solid #785e2e;border-radius:12px;color:#ffe4ab;padding:11px 12px;font-size:12px;line-height:1.5;margin-bottom:13px}
.demoNotice b{font-weight:850}
.demoNotice small{display:block;color:#e3c991;margin-top:3px;font-size:11px}
.demoPending{background:#181f2b;border:1px solid #394a63;border-radius:12px;padding:15px;margin:12px 0;line-height:1.55}
.demoPending h2{margin:0 0 8px;font-size:16px}
.demoPending p{color:#cad2df;font-size:13px;margin:0}
:focus-visible{outline:2px solid #8fc4ff;outline-offset:2px}
@media(max-width:370px){.wrap{padding-left:9px;padding-right:9px}.headerActions{grid-template-columns:minmax(0,1.35fr) 36px 36px minmax(0,1fr);gap:5px}.actionBtn{font-size:11px;padding:9px 5px}}

/* WEB V1 3/8 saving errors */
.demoNotice small.saveError{color:#ff9aa4;font-weight:800}
