:root{--ink:#173a33;--muted:#546861;--green:#17674e;--line:#ccd8d1;--paper:#fff;--wash:#f2f5f1;--red:#a02020}*{box-sizing:border-box}body{margin:0;background:var(--wash);color:var(--ink);font:17px/1.6 system-ui,-apple-system,'Noto Sans KR',sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer;min-height:48px;border:1px solid var(--line);border-radius:9px;padding:9px 15px;background:white;color:var(--ink)}button:disabled{cursor:wait;opacity:.65}input,select,textarea{width:100%;min-height:48px;border:1px solid #94a79d;border-radius:8px;padding:10px 12px;background:#fff;color:var(--ink)}textarea{resize:vertical}label{display:block;font-weight:600;margin:12px 0 6px}button:focus-visible,input:focus,select:focus,textarea:focus,summary:focus-visible{outline:3px solid #dbad42;outline-offset:3px}.primary{background:var(--green);color:#fff;border-color:var(--green);font-weight:700}.wide{width:100%}.quiet{background:transparent}.muted,.hint{color:var(--muted);font-size:16px}.hint{margin:6px 0}.error{color:var(--red);white-space:pre-line}.error:empty{display:none}.login-shell{min-height:100svh;display:grid;place-items:center;padding:24px}.login-card{width:min(100%,430px);background:white;padding:32px;border:1px solid var(--line);border-radius:18px;box-shadow:0 15px 50px #153c3310}.login-card h1{font-size:34px;margin:10px 0}.brand,.eyebrow{color:var(--green);font-weight:600;margin:0}.login-card button{margin-top:14px}[hidden]{display:none!important}header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:14px 28px;background:white;border-bottom:1px solid var(--line)}header>div{display:flex;gap:16px;align-items:center}.wordmark{color:var(--ink);text-decoration:none;font-size:21px}.wordmark strong{font-weight:600;margin-left:8px}.layout{max-width:1320px;margin:auto;display:grid;grid-template-columns:300px minmax(0,1fr);gap:28px;padding:28px}aside{min-width:0}#records{display:grid;gap:10px}.record{width:100%;text-align:left;padding:14px;min-height:88px;background:#fff}.record[aria-current=true]{border:2px solid var(--green);background:#eaf5ee}.record strong{display:block;font-size:18px}.record small{font-size:15px;color:var(--muted);display:block;overflow-wrap:anywhere}.editor{background:#fff;padding:28px;border:1px solid var(--line);border-radius:15px;min-width:0}.editor-head{display:flex;justify-content:space-between;align-items:center;gap:16px}.editor h1{font-size:28px;margin:6px 0 24px}.grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 20px}fieldset{border:0;padding:0;margin:0 0 25px;min-width:0}legend{font-weight:700;font-size:19px;padding:0}.memo-wrap{margin:0 0 26px}.memo-wrap>label{font-size:19px}.chips{display:flex;gap:7px;flex-wrap:wrap}.chip{min-height:46px;font-size:16px;padding:7px 12px}.chip[aria-pressed=true]{background:var(--green);color:white;border-color:var(--green)}.full{grid-column:1/-1}details{border-top:1px solid var(--line);padding:15px 0}summary{cursor:pointer;min-height:44px;font-size:19px;font-weight:600}summary span{font-weight:400;font-size:16px;color:var(--muted);display:inline-block;margin-left:8px}.detail-content{padding:10px 0}.save-bar{position:sticky;bottom:0;display:flex;align-items:center;justify-content:space-between;gap:16px;background:#fff;border-top:1px solid var(--line);padding:16px 0 5px;margin-top:15px}.save-bar p{margin:0}.save-bar button{flex-shrink:0;min-width:130px}#save-status{font-weight:600}#sheet-status{max-width:520px}#more{margin-top:15px}@media(max-width:800px){header{padding:12px 16px}header>div{gap:8px}.layout{grid-template-columns:1fr;padding:16px;gap:18px}aside{border-bottom:1px solid var(--line);padding-bottom:18px}#records{max-height:225px;overflow:auto;grid-template-columns:repeat(2,minmax(0,1fr))}.editor{padding:20px}.eyebrow{font-size:16px}.editor-head{display:block}#record-date{display:block;margin-bottom:12px}.grid{gap:8px 14px}}@media(max-width:440px){header{align-items:flex-start;flex-direction:column}.grid{grid-template-columns:1fr}.editor{padding:16px}.login-card{padding:24px}.save-bar{gap:8px}.save-bar button{min-width:100px}summary span{display:block;margin-left:0}#records{grid-template-columns:1fr}}

.record strong,.editor h1{overflow-wrap:anywhere}

.field-guide{font-size:16px;line-height:1.6;color:var(--muted);margin:5px 0 10px;white-space:pre-line}.guide-help{padding:8px;background:var(--wash);border-radius:6px}.script-box p,.script-box #branch-guide{white-space:pre-line;font-size:16px}.save-bar{position:static}.script-box{background:#f4f7f3;padding:12px;border-radius:8px;margin-bottom:12px}

/* v2 — 상담 입력 | 내 기록 표 */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.view-tabs{display:flex;gap:8px;max-width:1320px;margin:0 auto;padding:18px 28px 0}.view-tabs button{flex:0 1 200px;font-weight:700;font-size:18px;background:#fff}.view-tabs button{color:var(--muted)}.view-tabs button[aria-selected=true]{background:#eaf5ee;color:var(--green);border:2px solid var(--green)}
.table-view{max-width:1320px;margin:auto;padding:28px;min-width:0}.table-head{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}.table-head h1{font-size:28px;margin:0 0 4px}.table-head p{margin:0}.table-head button{flex-shrink:0;background:#fff}
.table-tools{max-width:420px;margin:8px 0 4px}#table-status{margin:8px 0 12px}.scroll-hint{display:none}
.table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;max-width:100%;background:#fff;border:1px solid var(--line);border-radius:12px}.table-wrap:focus-visible{outline:3px solid #dbad42;outline-offset:3px}
#record-table{width:100%;min-width:1060px;border-collapse:collapse;font-size:16px}#record-table th{background:var(--wash);text-align:left;font-size:15px;font-weight:700;white-space:nowrap;padding:12px;border-bottom:1px solid var(--line)}#record-table td{padding:6px 12px;border-bottom:1px solid var(--line);white-space:nowrap;vertical-align:middle;height:56px}#record-table tbody tr:last-child td{border-bottom:0}
.table-row{cursor:pointer}.table-row:hover{background:#f4f9f6}.table-row[aria-current=true]{background:#eaf5ee}.table-row[aria-current=true] .c-name{box-shadow:inset 4px 0 0 var(--green)}
#record-table td.c-memo{white-space:normal;min-width:15em;max-width:24em;overflow-wrap:anywhere;color:var(--muted)}#record-table td.c-day{color:var(--muted);font-size:15px}
.row-open{min-height:44px;border:0;border-radius:6px;background:transparent;padding:4px 6px;margin-left:-6px;color:var(--green);font-weight:700;text-align:left;text-decoration:underline;text-underline-offset:3px;max-width:12em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sheet-badge{display:inline-block;padding:3px 10px;border-radius:999px;font-size:15px;font-weight:700;white-space:nowrap}.sheet-badge[data-state=done]{background:#e2f2e8;color:#14573f}.sheet-badge[data-state=wait]{background:#fff2cc;color:#5f4500}.sheet-badge[data-state=check]{background:#fbe3e3;color:#8a1b1b}
.table-empty{background:#fff;border:1px dashed var(--line);border-radius:12px;padding:28px 20px;text-align:center;color:var(--muted)}#table-more{margin-top:14px}.table-view>.hint{margin-top:14px}
@media(max-width:800px){.view-tabs{padding:12px 16px 0}.view-tabs button{flex:1 1 0}.table-view{padding:16px}.table-head h1{font-size:24px}.table-tools{max-width:none}.scroll-hint{display:block;margin:0 0 8px;font-size:15px;color:var(--muted)}}
@media(max-width:440px){.table-head{flex-direction:column;gap:8px}.table-head button{width:100%}}
.wordmark{display:inline-flex;align-items:center;min-height:44px}
/* v2 r1: the tab bar stays at the top while scrolling, so 「내 기록 표」 is one tap away right after a save */
.view-tabs{position:sticky;top:0;z-index:5;background:var(--wash);padding-bottom:10px;box-shadow:0 8px 10px -10px #173a3333}
.tips-on{min-width:88px;min-height:44px;padding:5px 11px}
.tip-layer{position:fixed;z-index:19;top:94px;right:18px;width:min(410px,calc(100vw - 36px));pointer-events:none}
.tip-layer.tip-left{right:auto;left:18px}.tip-card{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:10px;padding:12px 10px 12px 14px;border:1px solid #8fa79c;border-radius:14px;background:#fffef7;box-shadow:0 12px 30px #173a3329;pointer-events:auto;transition:opacity 180ms ease,transform 180ms ease}.tip-card p{margin:1px 0;line-height:1.5;white-space:pre-line}.tip-bulb{font-size:21px}.tip-card button{min-height:44px;padding:5px 10px;white-space:nowrap}.tip-layer.tip-entering .tip-card{opacity:0;transform:translateY(-8px)}.tip-layer.tip-leaving .tip-card{opacity:0;transform:none;transition:opacity 1.2s ease}
.choice-add-open{width:100%;min-height:48px;margin-top:7px;text-align:left;color:var(--green);font-weight:700}.choice-add-panel{margin-top:8px;padding:12px;border:1px solid var(--line);border-radius:10px;background:#f7faf8;scroll-margin-bottom:var(--memo-mobile-space,180px)}.choice-add-panel input{margin:0}.choice-suggestions{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px}.choice-suggestion{min-height:44px;padding:6px 10px;background:#fff}.choice-add-actions{display:flex;gap:8px;margin-top:8px}.choice-add-actions button{min-height:48px;flex:1}.choice-add-panel .error{margin:6px 0 0}
#view-editor,#view-table,#editor-title{scroll-margin-top:84px}
@media(max-width:800px){.view-tabs{padding:8px 16px}#view-editor,#view-table,#editor-title{scroll-margin-top:72px}}
@media(max-width:759px){.tip-layer{top:72px;left:16px;right:16px;width:auto}.tip-card{grid-template-columns:auto minmax(0,1fr) auto;padding-left:12px}.tip-card p{font-size:16px}.tips-on{font-size:15px}}
@media(prefers-reduced-motion:reduce){.tip-card,.tip-layer.tip-entering .tip-card,.tip-layer.tip-leaving .tip-card{transition:none;transform:none}}
/* v2 r2: no table drawn (no rows, nothing found, load failed) → no 「표를 옆으로 밀면…」 hint */
.table-view[data-rows="0"] .scroll-hint{display:none}
/* v3: first-login PIN change screen (same card as the login screen) */
.pin-lead{font-size:18px;font-weight:600;line-height:1.55;margin:14px 0 4px}#pin-who{margin:0}#pin-change .login-card{word-break:keep-all}#pin-change h1{font-size:30px}

/* v3.2.4 — staff-requested question order. Mobile follows DOM; desktop keeps name/phone on row one. */
#basic>div:nth-child(1){grid-column:1;grid-row:1}#basic>div:nth-child(2){grid-column:1;grid-row:2}#basic>div:nth-child(3){grid-column:2;grid-row:1}#basic>div:nth-child(4){grid-column:2;grid-row:2}
.conditions-box{border-top:1px solid var(--line);padding-top:15px}.conditions-box legend span{font-weight:400;font-size:16px;color:var(--muted);margin-left:8px}.required-script{margin-top:14px}.required-script h2{font-size:19px;margin:0 0 8px}.required-badge{display:inline-block;margin-left:7px;padding:1px 8px;border-radius:999px;background:#a02020;color:#fff;font-size:14px;vertical-align:2px}.required-script p{margin:0}

/* v3.2 — the one real memo textarea stays in view while the counselor works. */
.memo-dock{--memo-keyboard:0px;position:fixed;z-index:20;right:18px;top:150px;width:min(380px,calc(100vw - 36px));height:min(470px,calc(100vh - 168px));min-width:300px;min-height:210px;display:flex;flex-direction:column;background:#fff;border:1px solid #8fa79c;border-radius:14px;box-shadow:0 14px 38px #173a3330;resize:both;overflow:hidden}
.memo-titlebar{display:flex;align-items:center;gap:10px;min-height:52px;padding:5px 6px 5px 14px;background:#eaf5ee;border-bottom:1px solid var(--line);cursor:move;user-select:none;touch-action:none}
.memo-titlebar strong{font-size:18px}.memo-titlebar span{margin-left:auto;color:var(--muted);font-size:15px}.memo-titlebar button{min-height:44px;padding:5px 11px;background:#fff;cursor:pointer}.memo-titlebar:focus-visible,.memo-titlebar button:focus-visible{outline:3px solid #dbad42;outline-offset:-3px}
.memo-body{display:flex;min-height:0;flex:1;flex-direction:column;padding:12px}.memo-body textarea{min-height:110px;flex:1;resize:none}.memo-body .hint{flex:0 0 auto;margin-bottom:0}.memo-height-handle{display:none}
.memo-dock.is-collapsed{height:62px!important;min-height:62px;resize:none}.memo-dock.is-collapsed .memo-body{display:none}.memo-dock.is-collapsed .memo-titlebar{border-bottom:0}.memo-dock.is-collapsed #memo-count{display:none}
#view-editor.memo-dock-reserved{max-width:none;padding-right:426px}
@media(max-width:759px){
 body.memo-active{padding-bottom:var(--memo-mobile-space,38vh)}
 .memo-dock{left:0!important;right:0!important;top:auto!important;bottom:var(--memo-keyboard);width:100%!important;height:38vh;min-width:0;min-height:25vh;max-height:70vh;border-radius:14px 14px 0 0;resize:none}
 .memo-height-handle{display:block;position:absolute;z-index:2;left:0;right:0;top:0;height:18px;cursor:ns-resize;touch-action:none}
 .memo-height-handle:before{content:"";display:block;width:58px;height:5px;margin:6px auto 0;border-radius:99px;background:#789087}
 .memo-titlebar{padding-top:12px;cursor:default}.memo-body{padding:8px 12px 12px}.memo-body .hint{font-size:14px;line-height:1.35}
 .memo-dock.is-collapsed{height:62px!important;min-height:62px;max-height:62px}
 body.memo-collapsed{--memo-mobile-space:62px}
 #view-editor.memo-dock-reserved{padding-right:16px;padding-bottom:24px}
 #basic>div:nth-child(n){grid-column:auto;grid-row:auto}.conditions-box legend span{display:block;margin-left:0}
}

/* Red-pen emphasis for scripts: thin hand-drawn strokes, never a highlighter fill. */
.script-mark{position:relative;display:inline;box-decoration-break:clone;-webkit-box-decoration-break:clone}
.script-mark-underline{padding:0 .04em .20em;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='9' viewBox='0 0 180 9'%3E%3Cpath d='M2 6 C38 2 71 8 108 4 S156 7 178 3' fill='none' stroke='%23b42318' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E");background-position:left bottom;background-repeat:repeat-x;background-size:180px 9px}
.script-mark-circle{display:inline-block;margin:-.12em .08em;padding:.02em .18em;line-height:1.45;color:inherit}
.script-mark-circle:after{content:"";position:absolute;inset:-.12em -.12em -.08em;border:2px solid #b42318;border-radius:49% 55% 47% 52%/54% 46% 57% 43%;transform:rotate(-1.7deg);pointer-events:none}

#reset-admin-tools{padding:0 1rem 1rem}.reset-pin-dialog{width:min(28rem,calc(100vw - 2rem));max-height:90dvh;overflow:auto;box-sizing:border-box;border:1px solid #ddd;border-radius:16px;padding:1rem}.reset-pin-dialog::backdrop{background:rgba(0,0,0,.35)}.reset-pin-dialog input,.reset-pin-dialog select{box-sizing:border-box;max-width:100%;width:100%}.reset-pin-dialog button{margin-top:.5rem}

/* 1022 duplicate applicant hint: a yellow band (never blocks saving) + a small 「중복」 badge in the list/table */
.dup-warning{margin:14px 0 0;padding:10px 14px;border:1px solid #e3c35a;border-left:6px solid #c98a00;border-radius:10px;background:#fff7dc;color:#4f3a00}.dup-warning p{margin:0}#dup-warning-text,#dup-warning-top-text{font-weight:700;overflow-wrap:anywhere}.dup-warning-hint{font-size:15px;font-weight:400;color:#5f4500;margin-top:2px!important;overflow-wrap:anywhere}.dup-warning-top{margin-top:12px}
.dup-badge{display:inline-block;margin-left:6px;padding:1px 8px;border-radius:999px;background:#fff2cc;color:#5f4500;border:1px solid #e3c35a;font-size:13px;font-weight:700;line-height:1.5;vertical-align:2px;white-space:nowrap}.record strong .dup-badge{font-size:13px}#record-table td.c-name{white-space:nowrap}
