/* 확인 요청 카드 — 문서 보며 의견 남기기 (옛 /v/ 화면 · 내 사건함 같이 씀, client-kit.js CK.ask) — 내 사건함 주소에서도 받도록 /portal/ 아래에 둠
   변호사 의견 화면(.fv-side · .cm-*)과 같은 짜임: 왼쪽 문서 · 오른쪽 의견 칸(위 제목 · 가운데 목록 · 아래 쓰는 칸 하나)
   폰(700px 이하)은 위 문서 · 아래 의견 칸. 색은 의뢰인 화면의 밝은 색 그대로
   전체 화면(.askv.fs)은 z 55: 아래 메뉴·띠(30~45) 위, 확인 창(60)·알림(90) 아래 — 지우기·확인 완료 창이 가리지 않게 */
.askv { position: relative; display: flex; align-items: stretch; height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 520px; margin-top: 8px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #e9e9e6; }
.askv > .pdfv { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; border-radius: 0; background: #e9e9e6; overflow: hidden; }
.askv > .pdfv > .pdfbar { flex: none; }
.askv > .pdfv > .pages { flex: 1; min-height: 0; max-height: none !important; overflow: auto; padding: 12px; -webkit-overflow-scrolling: touch; }
.askv > .pdfv.askimg > .pages img { display: block; width: 100%; border-radius: 6px; }
.askv > .pdfv.askimg > .pages a.open { display: inline-block; padding: 20px; }
.askv > .docv .docf { flex: 1; height: auto !important; min-height: 0; }
.askv .pdfbar .fsx { display: none; }
/* 보기 맞춤 [한 쪽|두 쪽] [너비|쪽 전체] — 쪽 크기는 client-kit 이 px 로 정함(보기 상자 폭을 넘지 않게), 두 쪽은 옆으로 나란히 */
.askv .pdfbar .ask-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.askv .pdfbar .ask-seg button { border: 0; border-radius: 0; background: none; color: var(--sub); padding: 7px 10px; font-size: .84rem; white-space: nowrap; }
.askv .pdfbar .ask-seg button + button { border-left: 1px solid var(--line); }
.askv .pdfbar .ask-seg button.on { background: var(--soft, var(--accent-soft)); color: var(--accent); font-weight: 700; }
.askv .pages .pg { max-width: 100%; }
.askv .pages.two { display: flex; flex-wrap: wrap; justify-content: center; align-content: flex-start; align-items: flex-start; column-gap: 10px; }
.askv .pages.two .pg { margin: 0 0 10px; }
.askv.fs { position: fixed; inset: 0; z-index: 55; height: auto; min-height: 0; margin: 0; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); }
.askv.fs .pdfbar .fsx { display: inline-block; margin-left: auto; }
.askv.fs .pdfbar [data-fs]:not(.fsx) { display: none; }
.askv.fs .pages { padding: 14px; }

/* 가운데 손잡이 (끌어 의견 칸 크기) */
.ask-split { flex: none; width: 10px; background: var(--card); border-left: 1px solid var(--line); cursor: col-resize; position: relative; touch-action: none; }
.ask-split::after { content: ''; position: absolute; left: 3px; top: 50%; width: 4px; height: 40px; margin-top: -20px; border-radius: 2px; background: var(--line-strong, rgba(0,0,0,.15)); transition: background .15s, height .15s, margin .15s; }
.ask-split:hover::after, .ask-split.on::after { background: var(--accent); height: 64px; margin-top: -32px; }

/* 오른쪽 의견 칸 */
.ask-side { width: 360px; min-width: 280px; max-width: 60%; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--card); color: var(--text); }
.ask-h { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.ask-h b { font-size: 1rem; }
.ask-h .ask-cnt { color: var(--accent); }
.ask-left { margin-left: auto; font-size: .78rem; font-weight: 700; color: var(--amber); background: var(--amber-soft, rgba(196,140,30,.14)); border-radius: 999px; padding: 2px 9px; }
.ask-left:empty { display: none; }
.ask-donebox { flex: none; margin: 10px 14px 0; padding: 9px 11px; border-left: 4px solid var(--green); background: var(--green-soft, rgba(46,125,85,.11)); border-radius: 0 10px 10px 0; font-size: .88rem; }
.ask-donebox b { color: var(--green); }
.ask-list { flex: 1; min-height: 0; overflow: auto; padding: 2px 14px 10px; -webkit-overflow-scrolling: touch; }
.ask-it { border-top: 1px solid var(--line); padding: 11px 0; border-radius: 0; }
.ask-it:first-child { border-top: 0; }
.ask-it.blink { border-radius: 10px; }
.ask-ih { display: flex; align-items: center; gap: 6px; font-size: .84rem; color: var(--sub); }
.ask-ih b { color: var(--text); font-size: .9rem; }
.ask-no { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: #2f3b8f; color: #fff; font-size: .74rem; font-weight: 700; }
.ask-pg { font-weight: 600; }
.ask-qt { margin-top: 5px; font-size: .95rem; font-weight: 600; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; }
.ask-quote { font-size: .82rem; color: var(--sub); border-left: 3px solid var(--line-strong, rgba(0,0,0,.15)); padding-left: 8px; margin-top: 5px; overflow-wrap: anywhere; }
.ask-row { margin-top: 6px; }
.ask-q .ask-row { padding-left: 10px; border-left: 2px solid var(--green); }
.ask-b { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; color: var(--text); }
.ask-row audio { display: block; width: 100%; height: 36px; margin-top: 2px; }
.ask-row .att { width: 140px; margin: 2px 6px 2px 0; }
.ask-m { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: .76rem; color: var(--faint, var(--sub)); }
.ask-del { border: 0; background: none; padding: 2px 0; font: inherit; font-size: .76rem; color: var(--sub); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.ask-del:hover { color: var(--red); }
.ask-ansq { margin-top: 7px; border: 1px solid var(--accent); background: none; color: var(--accent); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.ask-empty { color: var(--sub); font-size: .86rem; padding: 14px 0; }

/* 아래 쓰는 칸 하나 */
.ask-new { flex: none; border-top: 1px solid var(--line); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: var(--card); }
.ask-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ask-chips:not(:empty) { margin-bottom: 6px; }
.ask-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; font-size: .8rem; color: var(--text); background: rgba(255,196,0,.22); border: 1px solid rgba(200,150,0,.45); border-radius: 999px; padding: 2px 4px 2px 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ask-chip.q { background: var(--soft, var(--accent-soft)); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.ask-chip button { flex: none; border: 0; background: none; color: inherit; font-size: .9rem; padding: 0 6px; cursor: pointer; opacity: .7; }
.ask-hint { font-size: .76rem; color: var(--faint, var(--sub)); line-height: 1.45; margin-bottom: 6px; }
.ask-hint:empty { display: none; }
.ask-hint.wait { color: var(--accent); font-weight: 700; }
.ask-new textarea { display: block; width: 100%; resize: vertical; min-height: 64px; font: inherit; font-size: max(16px, .95rem); line-height: 1.45; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-strong, rgba(0,0,0,.15)); background: var(--bg); color: var(--text); }
.ask-act { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.ask-act button { flex: none; border: 1px solid var(--line-strong, rgba(0,0,0,.15)); background: var(--bg); color: var(--text); border-radius: 10px; padding: 7px 11px; font: inherit; font-size: .86rem; cursor: pointer; }
.ask-act button.on { border-color: var(--red); color: var(--red); font-weight: 700; }
.ask-act button.pri { margin-left: auto; background: var(--accent); border-color: var(--accent); color: var(--accent-text, #fff); font-weight: 700; padding: 7px 16px; }
.ask-st { flex: 1; min-width: 0; font-size: .76rem; color: var(--sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-act .ask-st + button.pri { margin-left: 0; }
.ask-fin { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--line); text-align: center; }
.ask-fin .miss { font-size: .78rem; margin: 0 0 3px; }
.ask-fd { font-size: .72rem; color: var(--faint, var(--sub)); line-height: 1.4; margin-bottom: 5px; }
.ask-fin [data-confirm] { border: 1px solid var(--green); background: none; color: var(--green); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; }
.ask-fin [data-confirm]:hover { background: var(--green-soft, rgba(46,125,85,.11)); }

/* 문서 위 띄움 메뉴 (남긴 자리 · 골라만 둔 자리를 다시 누름) */
.ask-pop { position: absolute; z-index: 6; max-width: min(320px, calc(100% - 12px)); background: var(--card); color: var(--text); border: 1px solid var(--line-strong, rgba(0,0,0,.15)); border-radius: 14px; box-shadow: 0 8px 28px rgba(20,20,40,.22); padding: 8px; animation: askpop .12s ease-out; }
@keyframes askpop { from { opacity: 0; transform: translateY(-4px); } }
.ask-pq { font-size: .8rem; color: var(--sub); padding: 2px 4px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ask-pq b { color: #fff; background: #2f3b8f; border-radius: 8px; padding: 0 5px; margin-right: 3px; }
.ask-pb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ask-pb button.here { border-style: dashed; color: var(--sub); font-weight: 500; }
.ask-pb button { min-height: 40px; border: 1px solid var(--line-strong, rgba(0,0,0,.15)); background: var(--bg); color: var(--text); border-radius: 10px; padding: 8px 14px; font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.ask-pb button.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-text, #fff); }
.ask-pb button.dan { color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.ask-pb .d { font-size: .76rem; }

.askv .mflash { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); background: rgba(31,138,91,.95); color: #fff; padding: 8px 14px; border-radius: 18px; font-size: .88rem; z-index: 7; width: max-content; max-width: 90%; text-align: center; word-break: keep-all; pointer-events: none; }
.askv.fs .mflash { position: fixed; }

/* 확인을 마친 요청: 보기만 */
.card.done .ask-new, .card.done .ask-del, .card.done .ask-ansq { display: none !important; }

/* 폴드 펼침·태블릿 세로(600~999px): 좌우 반반 — 의견 칸 기본 폭 화면의 45% (손잡이로 조절) */
@media (min-width: 600px) and (max-width: 999px) {
  .ask-side { width: 45%; min-width: 260px; max-width: 65%; }
  .askv { height: calc(100dvh - 90px); min-height: 480px; }
}
.ask-jump, .ask-shx { display: none; }

/* 좁은 폰(600px 미만, 접은 폰): 문서(모든 쪽, 폭에 맞춘 크기) → 의견 칸이 한 줄로 이어지고 페이지(전체 화면이면 그 상자)를 스크롤.
   오른쪽 아래 떠 있는 '의견 N ↓ / 문서 ↑' 단추, 글자를 고르거나 '답하기'를 누르면 쓰는 칸이 화면 아래 시트로 뜸 */
@media (max-width: 599px) {
  .askv .pdfbar .ask-seg.lay2 { display: none; }   /* 접은 폰: 두 쪽 없음 */
  .askv { display: block; height: auto; min-height: 0; overflow: visible; border-radius: 12px; }
  .askv.fs { overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: 0; }
  .askv > .pdfv { display: block; overflow-x: auto; overflow-y: visible; }
  .askv.fs > .pdfv > .pdfbar { position: sticky; top: 0; z-index: 3; }
  .askv > .pdfv > .pages { overflow: visible; height: auto; padding: 8px; }
  .askv.fs .pages { padding: 8px; }
  .askv > .docv .docf { height: 75svh !important; }
  .ask-split { display: none; }
  .ask-side { display: block; width: auto !important; height: auto !important; min-width: 0; max-width: none; min-height: 0; border-top: 1px solid var(--line); }
  .ask-list { overflow: visible; padding-bottom: 6px; }
  .ask-h { padding: 12px 14px 10px; }
  .ask-new textarea { min-height: 56px; }
  .ask-act button { padding: 9px 12px; }
  .ask-pb button { min-height: 44px; padding: 10px 16px; font-size: .95rem; }
  .askv .mflash, .askv.fs .mflash { position: fixed; top: auto; bottom: calc(150px + env(safe-area-inset-bottom)); }
  /* 쓰는 칸 시트 */
  .ask-new.is-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 57; border-top: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -6px 28px rgba(20,20,40,.22); padding-top: 12px; animation: asksheet .16s ease-out; }
  @keyframes asksheet { from { transform: translateY(30px); opacity: .4; } }
  .ask-new.is-sheet .ask-fin { display: none; }
  .ask-new.is-sheet .ask-shx { display: block; position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--line); color: var(--sub); font-size: 1rem; cursor: pointer; }
  .ask-new.is-sheet .ask-chips { padding-right: 40px; min-height: 26px; }
  .ask-new.is-sheet.is-wait textarea, .ask-new.is-sheet.is-wait .ask-act { display: none; }
  .ask-new.is-sheet.is-wait .ask-hint { font-size: .95rem; padding: 4px 40px 8px 2px; margin: 0; }
  .askv.fs { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }   /* 맨 아래 확인 완료가 떠 있는 단추에 가리지 않게 */
  .askv.sheeton { padding-bottom: 210px; }
  /* 떠 있는 이동 단추 */
  .ask-jump { position: fixed; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom)); z-index: 56; border: 0; border-radius: 999px; padding: 10px 16px; background: var(--accent); color: var(--accent-text, #fff); font: inherit; font-size: .9rem; font-weight: 700; box-shadow: 0 6px 18px rgba(20,20,40,.25); cursor: pointer; }
  .ask-jump.on { display: block; }
  .askv.fs .ask-jump { bottom: calc(18px + env(safe-area-inset-bottom)); }
}

/* 확인·자료 기한 띠 (카드 머리·목록 카드) */
.ask-due { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 8px 0 4px; padding: 9px 12px; border-radius: 12px; background: var(--soft, var(--accent-soft)); color: var(--accent); font-size: .92rem; line-height: 1.4; }
.ask-due b { font-weight: 700; }
.ask-due .dd { font-size: .84rem; opacity: .85; }
.ask-due.soon { background: var(--amber-soft, rgba(196,140,30,.14)); color: var(--amber); }
.ask-due.over { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.ask-due.over .dd { color: var(--sub); }

/* ── 자료 요청 카드 (CK.docReq) — 폰에서 누르기 쉽게 큰 단추 ── */
.dr-card h2 { display: flex; align-items: center; gap: 8px; }
.dr-title { font-size: 1.05rem; font-weight: 700; margin: 2px 0 4px; overflow-wrap: anywhere; }
.dr-note { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .93rem; color: var(--text); background: var(--bg); border-radius: 10px; padding: 9px 11px; margin: 6px 0; }
.dr-prog { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; font-size: .86rem; color: var(--sub); font-weight: 600; }
.dr-bar { flex: 1; height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.dr-bar i { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .3s; }
.dr-items { list-style: none; padding: 0; margin: 6px 0 0; }
.dr-it { border-top: 1px solid var(--line); padding: 12px 0; }
.dr-it:first-child { border-top: 0; }
.dr-it.blink { border-radius: 10px; }
.dr-ih { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.dr-ck { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong, rgba(0,0,0,.2)); font-size: .85rem; font-weight: 800; color: #fff; }
.dr-it.st-ok .dr-ck { background: var(--green); border-color: var(--green); }
.dr-it.st-none .dr-ck { background: var(--sub); border-color: var(--sub); }
.dr-it.st-ok .dr-ih b, .dr-it.st-none .dr-ih b { color: var(--sub); }
.dr-opt { font-size: .74rem; color: var(--sub); border: 1px solid var(--line); border-radius: 999px; padding: 0 7px; }
.dr-hint { font-size: .86rem; color: var(--sub); margin: 3px 0 0 32px; overflow-wrap: anywhere; }
.dr-files { list-style: none; padding: 0; margin: 6px 0 0 32px; }
.dr-files li { display: flex; align-items: center; gap: 8px; font-size: .88rem; padding: 3px 0; }
.dr-fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-fdel, .dr-undo { flex: none; border: 0; background: none; color: var(--sub); text-decoration: underline; text-underline-offset: 2px; font: inherit; font-size: .8rem; cursor: pointer; padding: 4px; }
.dr-nonebox { margin: 6px 0 0 32px; font-size: .86rem; color: var(--sub); }
.dr-acts { display: flex; gap: 8px; margin: 9px 0 0 32px; flex-wrap: wrap; }
.dr-acts button { min-height: 44px; border-radius: 12px; padding: 9px 16px; font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; }
.dr-att { border: 0; background: var(--accent); color: var(--accent-text, #fff); flex: 1 1 auto; max-width: 280px; }
.dr-nob { border: 1px solid var(--line-strong, rgba(0,0,0,.15)); background: var(--card); color: var(--text); }
.dr-noneform { margin: 8px 0 0 32px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dr-noneform[hidden] { display: none; }
.dr-nh { width: 100%; font-size: .84rem; color: var(--sub); }
.dr-nin { flex: 1 1 200px; min-width: 0; font: inherit; font-size: max(16px, .95rem); padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line-strong, rgba(0,0,0,.15)); background: var(--bg); color: var(--text); }
.dr-nsend { min-height: 42px; border: 1px solid var(--accent); background: none; color: var(--accent); border-radius: 10px; padding: 8px 14px; font: inherit; font-weight: 700; cursor: pointer; }
.dr-st { margin: 4px 0 0 32px; font-size: .82rem; color: var(--sub); }
.dr-st:empty { display: none; }
.dr-done { margin-top: 12px; }
.dr-donemsg { margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--green-soft, rgba(46,125,85,.11)); color: var(--green); font-weight: 600; font-size: .92rem; }
@media (max-width: 599px) { .dr-hint, .dr-files, .dr-nonebox, .dr-acts, .dr-noneform, .dr-st { margin-left: 0; } .dr-att { max-width: none; } }

/* 쪽 그림을 못 받았을 때: 그 쪽 가운데에 안내와 원본 열기 */
.pg { position: relative; }
.pg .pgfail { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--card, #fff); border: 1px solid var(--line, #ddd); border-radius: 12px; padding: 14px 18px; font-size: 15px; text-align: center; line-height: 1.6; box-shadow: 0 4px 16px rgba(0,0,0,.08); }
.pg .pgfail a { display: block; margin-top: 6px; font-weight: 600; }

/* 답 아래 주고받은 글 (댓글처럼 — 의뢰인 답글) */
.reply.mine { border-left-color: #ea7a00; background: color-mix(in srgb, #ea7a00 8%, transparent); }
.ask-thr { all: unset; cursor: pointer; font-size: 13px; color: var(--accent); padding: 2px 6px; margin-left: 6px; border-radius: 6px; }
.ask-thr:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.reply .ask-thr { display: inline-block; margin: 4px 0 0 -6px; }
.ask-thbox { margin: 6px 0 4px 14px; }
.ask-thbox textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 15px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, #d9d9d9); background: var(--bg, #fff); color: inherit; resize: vertical; }
.ask-thb { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ask-thst { flex: 1; font-size: 13px; color: #c0392b; }
.ask-thx, .ask-thgo { font: inherit; font-size: 14px; padding: 6px 14px; border-radius: 9px; border: 1px solid var(--line, #d9d9d9); background: transparent; color: inherit; cursor: pointer; }
.ask-thgo { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
/* 확인 요청 내려받기 — 한글 받기 · PDF 받기 (공유 자료 카드의 내려받기와 같은 모양) */
.ask-dl { display: flex; flex-wrap: wrap; gap: 14px; margin: 4px 0 8px; }
.ask-dl a.open { font-weight: 700; font-size: .9rem; }
.ask-dl a.open.ghost { color: var(--sub); }
