/* HanFlow PDF 모바일·태블릿 셸 — 하단 5탭(폰) / 좌측 레일(태블릿).  260726 PHY 모바일 2.0
   · 문서를 열면 셸은 사라지고 뷰어가 전면(iLovePDF 와 같은 흐름) — body.hf-doc
   · 탭 화면은 .screen, 한 번에 하나만 보인다. 뷰어(.stage)는 홈 탭의 내용으로 취급한다. */

:root{ --tab-h:58px; --rail-w:82px; }

/* 셸 그릇: 폰=세로 한 칸(화면 하나가 남는 높이를 다 쓴다) · 태블릿=[레일 | 화면] 2단(아래 미디어쿼리) */
.shellwrap{ flex:1 1 auto; min-height:0; display:flex; flex-direction:column; }

/* ===== 탭바(폰) ===== */
.tabbar{
  flex:0 0 auto; display:flex; align-items:stretch; z-index:45;
  height:calc(var(--tab-h) + var(--safe-b)); padding-bottom:var(--safe-b);
  background:var(--surface); border-top:1px solid var(--line);
  box-shadow:0 -1px 0 rgba(20,40,90,.03);
}
.tabbtn{
  flex:1 1 0; min-width:0; border:0; background:transparent; color:#6a778f;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  font-size:11px; font-weight:700; letter-spacing:-.01em; padding:0 2px;
}
.tabbtn svg{ width:23px; height:23px; }
.tabbtn .tb-lbl{ max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tabbtn.active{ color:var(--brand); }
.tabbtn.active svg{ transform:translateY(-1px); }
.tabbtn:active{ background:var(--brand-soft); }
body.hf-doc .tabbar{ display:none; }
body.immersive .tabbar{ display:none; }

/* ===== 화면 ===== */
.screen{
  flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch;
  background:var(--bg); padding:14px 14px calc(18px + var(--safe-b));
}
.screen h2.sc-title{ margin:2px 0 12px; font-size:21px; font-weight:800; letter-spacing:-.02em; }
.sechd{ margin:18px 2px 8px; font-size:12.5px; font-weight:800; color:var(--ink-soft); letter-spacing:.01em; }
.sechd:first-of-type{ margin-top:4px; }

/* 빈 화면 */
.empty{ text-align:center; color:var(--ink-soft); padding:44px 16px; }
.empty .em-ic{ font-size:38px; line-height:1; margin-bottom:10px; }
/* ★260822 — 빈 화면의 이모지 자리를 우리 SVG 로 바꿀 때. 색은 도구 카드와 같은 묶음 색을 쓴다
   (스캔·인식=파랑) — 탭마다 다른 그림체가 섞이지 않게 한다. */
.empty .em-ic-svg{ --ti-1:#cfe0ff; --ti-2:#3b74e0; margin-bottom:14px; }
.empty .em-ic-svg svg{ width:56px; height:56px; }
body[data-bg="dark"] .empty .em-ic-svg{ --ti-1:#2b3b57; --ti-2:#7fa9f0; }
.empty .em-t{ font-weight:800; color:var(--ink); font-size:15.5px; margin-bottom:4px; }
.empty .em-d{ font-size:13.5px; }

/* ===== 도구 격자(3열) ===== */
.tgrid{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.tcard{
  position:relative; border:1px solid var(--line); background:var(--surface); border-radius:var(--radius);
  padding:14px 8px 12px; display:flex; flex-direction:column; align-items:center; gap:8px;
  color:var(--ink); font-size:12.5px; font-weight:700; line-height:1.28; text-align:center; min-height:96px;
  box-shadow:var(--shadow);
}
.tcard .tc-ic{ font-size:25px; line-height:1; }
.tcard:active{ transform:translateY(1px); background:#f7f9ff; }

/* ===== ★260810 ⑧-2 — 도구 묶음 제목 + SVG 아이콘 (PHY: iLovePDF 식으로 재편) =====
 *   교수님: 「아이콘들도 디자인측면에서 초대폭 개선시키고 … 화면 나오는 순서도 뒤죽박죽이다.」
 *   ① 묶음마다 제목을 달고 ② 이모지를 우리 SVG 로 갈고 ③ 묶음마다 색을 준다. */
.tgrp{
  margin:18px 2px 8px; font-size:12.5px; font-weight:800; letter-spacing:.01em;
  color:var(--ink-dim, #6b7280); text-transform:none;
}
.tgrp:first-of-type{ margin-top:6px; }
/* 아이콘 두 색 — 기본값(묶음이 없을 때도 회색으로라도 제대로 보이게) */
.tcard{ --ti-1:#dfe3ea; --ti-2:#9aa3b2; }
.tcard.tc-svg .tc-ic{
  display:flex; align-items:center; justify-content:center;
  width:38px; height:38px; font-size:0;      /* 이모지 자리 흔적 제거 */
}
.tcard.tc-svg .tc-ic svg{ width:34px; height:34px; display:block; }
/* 묶음별 두 색 — 옅은 색(뒷장) / 진한 색(앞장·획). iLovePDF 의 파스텔 계열을 따랐다. */
.tcard[data-grp="read"]{ --ti-1:#cfe0ff; --ti-2:#3b74e0; }   /* 스캔·인식 = 파랑 */
.tcard[data-grp="conv"]{ --ti-1:#ffe6ae; --ti-2:#e0920c; }   /* 변환   = 노랑 */
.tcard[data-grp="edit"]{ --ti-1:#e8d7fb; --ti-2:#8b4fd6; }   /* 편집   = 보라 */
.tcard[data-grp="org"] { --ti-1:#cdeed6; --ti-2:#2f9e5c; }   /* 정리   = 초록 */
.tcard[data-grp="send"]{ --ti-1:#ffd9d0; --ti-2:#e8563c; }   /* 보내기 = 살구 */
/* 묶음 제목에도 같은 색을 옅게 — 제목과 카드가 한 덩어리로 읽히게 */
.tgrp[data-grp="read"]{ color:#3b74e0; }
.tgrp[data-grp="conv"]{ color:#b8770a; }
.tgrp[data-grp="edit"]{ color:#8b4fd6; }
.tgrp[data-grp="org"] { color:#2f9e5c; }
.tgrp[data-grp="send"]{ color:#e8563c; }
/* ★sol 반증 260810 — 어두운 화면을 `prefers-color-scheme` 으로만 잡고 있었다. 그런데 이 앱의
 *   어두운 모드는 손님이 **직접 고르는** `body[data-bg="dark"]` 다(style.css:34). 즉 손님이 고른
 *   어두운 모드에서는 내 손질이 하나도 안 먹었다. 두 갈래를 다 잡는다.
 *   카드 바탕이 어두워지면 옅은 색(--ti-1)이 배경에 묻히므로 조금 진하게, 진한 색은 밝게 올린다. */
@media (prefers-color-scheme: dark){ .tgrp{ color:#9aa3b2; } }
body[data-bg="dark"] .tgrp{ color:#9aa3b2; }
body[data-bg="dark"] .tcard{ --ti-1:#3a4150; --ti-2:#aab4c6; }
body[data-bg="dark"] .tcard[data-grp="read"]{ --ti-1:#2b3b57; --ti-2:#7fa9f0; }
body[data-bg="dark"] .tcard[data-grp="conv"]{ --ti-1:#4a3c1e; --ti-2:#f0b654; }
body[data-bg="dark"] .tcard[data-grp="edit"]{ --ti-1:#3b2d51; --ti-2:#bb8ef0; }
body[data-bg="dark"] .tcard[data-grp="org"] { --ti-1:#24402f; --ti-2:#6ecb95; }
body[data-bg="dark"] .tcard[data-grp="send"]{ --ti-1:#4d2f28; --ti-2:#ff8a72; }
body[data-bg="dark"] .tgrp[data-grp="read"]{ color:#7fa9f0; }
body[data-bg="dark"] .tgrp[data-grp="conv"]{ color:#f0b654; }
body[data-bg="dark"] .tgrp[data-grp="edit"]{ color:#bb8ef0; }
body[data-bg="dark"] .tgrp[data-grp="org"] { color:#6ecb95; }
body[data-bg="dark"] .tgrp[data-grp="send"]{ color:#ff8a72; }
.tcard .tc-pro{
  position:absolute; top:6px; right:6px; font-size:9.5px; font-weight:800; color:#7a5a00;
  background:#ffe9a8; border-radius:999px; padding:2px 6px; letter-spacing:.02em;
}
body.hf-pro .tcard .tc-pro{ display:none; }

/* ===== 파일 목록 ===== */
.searchrow{ display:flex; gap:8px; margin-bottom:12px; }
.searchrow input{
  flex:1 1 auto; min-width:0; height:42px; border:1px solid var(--line); border-radius:11px;
  background:var(--surface); padding:0 12px; font:inherit; font-size:14.5px; color:var(--ink);
}
.searchrow input:focus{ outline:2px solid var(--brand-soft); border-color:var(--brand-2); }
/* 파일 탭의 «열기» — 상단바 .btn-open 과 모양은 같되, 좁은 화면에서 라벨을 숨기지 않는다 */
.searchrow .fopenbtn{
  flex:0 0 auto; height:42px; padding:0 16px; border:0; border-radius:11px;
  background:var(--brand); color:#fff; font:inherit; font-weight:700; font-size:14px; white-space:nowrap;
}
.searchrow .fopenbtn:active{ transform:translateY(1px); }
.frow{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left;
  border:1px solid var(--line); background:var(--surface); border-radius:12px;
  padding:11px 12px; margin-bottom:8px; box-shadow:var(--shadow); color:var(--ink);
}
.frow:active{ background:#f7f9ff; }
/* ★260726 정렬·보기 전환(참고앱 공통) */
.fopt{ display:flex; gap:8px; align-items:center; justify-content:flex-end; margin:-4px 2px 10px; }
.fchip{
  border:1px solid var(--line); background:var(--surface); color:var(--ink-soft);
  border-radius:999px; padding:6px 12px; font-size:12.5px; font-weight:700; font-family:inherit;
}
.fchip.fview{ padding:6px 11px; font-size:14px; }
.fgrid{ display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.fgrid .sechd{ grid-column:1/-1; }
.fgrid .frow{ flex-direction:column; align-items:flex-start; gap:7px; margin-bottom:0; padding:13px 12px; }
.fgrid .fr-body{ width:100%; }
.fgrid .fr-fav, .fgrid .fr-del{ position:absolute; top:8px; }
.fgrid .fr-fav{ right:34px; } .fgrid .fr-del{ right:8px; }
.fgrid .frow{ position:relative; }
@media (min-width:820px){ .fgrid{ grid-template-columns:repeat(3,1fr); } }
@media (min-width:1180px){ .fgrid{ grid-template-columns:repeat(4,1fr); } }
.frow .fr-ic{ width:34px; height:34px; flex:0 0 auto; border-radius:9px; background:var(--brand-soft);
  display:flex; align-items:center; justify-content:center; font-size:17px; }
.frow .fr-body{ flex:1 1 auto; min-width:0; }
.frow .fr-name{ display:block; font-size:14.5px; font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.frow .fr-meta{ display:block; font-size:12px; color:var(--ink-soft); margin-top:2px; }
.frow .fr-fav{ flex:0 0 auto; width:34px; height:34px; border:0; background:transparent; font-size:17px; color:#c8cede; border-radius:9px; }
.frow .fr-fav.on{ color:#f2b01e; }
.frow .fr-del{ flex:0 0 auto; width:34px; height:34px; border:0; background:transparent; font-size:15px; color:#9aa4bb; border-radius:9px; }

/* ===== 설정 목록 ===== */
.setlist{ border:1px solid var(--line); background:var(--surface); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); }
.srow{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left; border:0; border-bottom:1px solid var(--line);
  background:transparent; padding:13px 13px; font:inherit; font-size:14.5px; font-weight:600; color:var(--ink);
}
.setlist .srow:last-child{ border-bottom:0; }
.srow:active{ background:#f7f9ff; }
.srow .sr-ic{ width:26px; text-align:center; font-size:16px; flex:0 0 auto; }
.srow .sr-t{ flex:1 1 auto; min-width:0; }
.srow .sr-v{ flex:0 0 auto; color:var(--ink-soft); font-weight:600; font-size:13.5px; max-width:52%;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.srow .sr-ch{ flex:0 0 auto; color:#b9c2d6; font-size:15px; }

/* OCR 인식 언어 선택 (260728 PHY: 기본=화면언어+영어, 필요시 펼쳐서 추가 체크) */
.ocr-lang-row{
  display:flex; align-items:center; gap:11px; width:100%; text-align:left; border:1px solid var(--line);
  border-radius:var(--radius); background:var(--surface); box-shadow:var(--shadow); padding:13px 13px;
  font:inherit; font-size:14.5px; font-weight:600; color:var(--ink);
}
.ocr-lang-row:active{ background:#f7f9ff; }
.ocr-lang-row .sr-t{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ocr-lang-panel{
  display:grid; grid-template-columns:1fr 1fr; gap:2px 10px; max-height:38vh; overflow:auto;
  border:1px solid var(--line); border-radius:var(--radius); background:var(--surface); padding:8px 10px;
}
.ocr-lang-panel.hidden{ display:none; }
.ocr-lang-item{ display:flex; align-items:center; gap:7px; padding:6px 2px; font-size:13.5px; }
.ocr-lang-item input{ flex:0 0 auto; width:16px; height:16px; }
.ocr-lang-item span{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* ★260801-4 (법칙 383 · PHY 결정 ㉣): «이번 문서만»과 «기본값»을 가르는 자리.
   26개 언어가 2열로 깔린 격자 아래에 가로줄 하나로 갈라 붙인다 — 언어 하나로 오해되면 안 된다. */
.ocr-lang-save{ grid-column:1 / -1; margin-top:6px; padding-top:8px; border-top:1px solid var(--line); }
.ocr-lang-note{ grid-column:1 / -1; font-size:12px; color:var(--ink-soft); padding:0 2px 2px; }
@media (max-width:420px){ .ocr-lang-panel{ grid-template-columns:1fr; } }

/* 화면 테마 3선택 */
.segrow{ display:flex; gap:8px; }
.segrow .seg{
  flex:1 1 0; height:44px; border:1px solid var(--line); background:var(--surface); border-radius:11px;
  font:inherit; font-size:13.5px; font-weight:700; color:var(--ink);
}
.segrow .seg.on{ border-color:var(--brand); color:var(--brand); background:var(--brand-soft); }

/* Pro 배너 */
.probanner{
  display:flex; align-items:center; gap:12px; border-radius:var(--radius); padding:13px 14px; margin-bottom:14px;
  background:linear-gradient(135deg,#1b45c4,#3a63e0); color:#fff; box-shadow:0 6px 18px rgba(27,69,196,.22);
}
.probanner .pb-body{ flex:1 1 auto; min-width:0; }
.probanner .pb-t{ display:block; font-weight:800; font-size:14.5px; }
.probanner .pb-d{ display:block; font-size:12.5px; opacity:.92; margin-top:2px; }
.probanner .pb-go{ flex:0 0 auto; border:0; border-radius:999px; background:#fff; color:var(--brand);
  font-weight:800; font-size:13px; padding:9px 14px; }
body.hf-pro .probanner{ display:none; }

/* ===== 태블릿: 좌측 레일 + 넓은 본문 ===== */
@media (min-width:820px){
  .shellwrap{ flex-direction:row; }
  .tabbar{
    order:-1; flex-direction:column; height:auto; width:var(--rail-w); padding:8px 0 calc(8px + var(--safe-b));
    border-top:0; border-right:1px solid var(--line); box-shadow:1px 0 0 rgba(20,40,90,.03);
  }
  .tabbtn{ flex:0 0 auto; height:64px; font-size:11.5px; gap:4px; border-radius:12px; margin:2px 8px; }
  .tabbtn.active{ background:var(--brand-soft); }
  .screen{ padding:20px 22px; }
  .screen h2.sc-title{ font-size:24px; }
  .tgrid{ grid-template-columns:repeat(4,1fr); gap:12px; }
  .tcard{ min-height:110px; font-size:13.5px; }
  .frow{ padding:13px 14px; }
  /* 태블릿에서 문서를 열면 레일은 남긴다(문서 사이 이동이 잦다) */
  body.hf-doc .tabbar{ display:flex; }
  body.hf-doc.immersive .tabbar{ display:none; }
}

/* RTL: 레일 위치 반전 */
html.hf-rtl .tabbar{ border-right:0; border-left:1px solid var(--line); }
html.hf-rtl .frow, html.hf-rtl .srow, html.hf-rtl .ocr-lang-row{ text-align:right; }
html.hf-rtl .ocr-lang-item{ flex-direction:row-reverse; }

/* ===== 스캔(카메라) ===== */
.scan-cta{
  /* ★260822 — 아이콘(SVG)+글씨 한 줄. display:block 이면 둘이 위아래로 쌓인다(실측).
     .cta 의 inline-flex 를 살리되 가운데 정렬은 margin auto 가 하게 width:max-content 를 준다. */
  display:flex; align-items:center; justify-content:center;
  width:max-content; max-width:100%; margin:6px auto 0;
}
.scan-cta .cta-ic{ width:20px; height:20px; flex:0 0 auto; }
/* ★260822 — 스캔 탭 둘째 버튼(사진에서 가져오기). 주버튼과 무게를 갈라 «둘 중 하나»로 보이게 한다.
   높이는 .cta 그대로 52px 이라 손가락 기준(44px)을 넘는다 — 보조라고 작게 만들지 않는다. */
.scan-cta.cta-2nd{
  margin-top:10px; background:#fff; color:var(--brand);
  box-shadow:0 2px 10px rgba(27,69,196,.12); border:1px solid #d7e0f5;
}
.scan-cta.cta-2nd:hover{ background:#f4f7ff; }
/* ★260808 PHY 지시 ② — 다크(#0b0d12)+초록(#26c592) 퇴역, 브랜드 라이트(설계 §C).
   토큰: 블루 #1b45c4 · sky #5b86ff · 바탕 #fbfcff · 잉크 #1a2233(웹앱 정본) · 보조 #5b6b86. */
.scanui{
  position:fixed; inset:0; z-index:120; background:#fbfcff; color:#1a2233;
  display:flex; flex-direction:column;
  padding-top:var(--safe-t); padding-bottom:var(--safe-b);
}
.scanui[hidden]{ display:none !important; }
.sc-top{ flex:0 0 auto; height:52px; display:flex; align-items:center; gap:8px; padding:0 8px; }
.sc-ic{
  width:40px; height:40px; border:0; border-radius:12px; background:#eef2fb;
  color:#1a2233; font-size:17px; display:flex; align-items:center; justify-content:center;
}
.sc-ic.on{ background:#1b45c4; color:#fff; }
/* 상단 칩은 카메라 위 — 반투명 화이트로 띄운다 */
.sc-top .sc-ic{ background:rgba(255,255,255,.92); box-shadow:0 1px 6px rgba(21,32,58,.14); }
/* 벡터 아이콘(260808) — 이모지 퇴역. currentColor 라 켜짐(.on)에서 저절로 흰색이 된다 */
.sc-ic svg{ width:22px; height:22px; display:block; }
.sc-q svg{ width:16px; height:16px; vertical-align:-3px; margin-right:2px; }
.sc-doc-bar button svg{ width:21px; height:21px; display:block; }
.sc-doc-ocr svg{ width:16px; height:16px; vertical-align:-3px; margin-right:3px; }
/* 자동 촬영 버튼은 글자(AUTO)라 이모지 크기로는 넘친다 */
#scAuto{ font-size:11.5px; font-weight:900; letter-spacing:.5px; }
.sc-mode{ flex:1 1 auto; text-align:center; font-size:13px; font-weight:700; opacity:.85; }
.sc-stage{ flex:1 1 auto; min-height:0; position:relative; overflow:hidden; background:#000; }
.sc-stage video{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; }
.sc-stage canvas{ position:absolute; inset:0; width:100%; height:100%; }
.sc-stage.sc-flash::after{ content:""; position:absolute; inset:0; background:#fff; opacity:.75; }
/* ★260808 카메라 부트 커버 — getUserMedia 대기 중 소스 없는 <video>(안드 웹뷰가 재생버튼
   자리표를 그리는 자리)를 브랜드 화면으로 덮는다. 영상이 흐르면 scan.js 가 hidden 을 건다. */
.sc-boot{
  position:absolute; inset:0; z-index:6; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:12px; background:#fbfcff;
}
.sc-boot[hidden]{ display:none !important; }
.sc-boot-logo{ font-weight:800; font-size:18px; color:#1b45c4; letter-spacing:.2px; }
.sc-boot-spin{
  width:28px; height:28px; border-radius:50%; border:3px solid #eaf0ff; border-top-color:#1b45c4;
  animation:hfscanspin .9s linear infinite;
}
@keyframes hfscanspin{ to{ transform:rotate(360deg); } }
.sc-boot-txt{ font-size:13px; color:#5b6b86; font-weight:600; }
.sc-guide{
  position:absolute; left:50%; top:46%; transform:translate(-50%,-50%);
  background:rgba(0,0,0,.62); color:#fff; font-size:13.5px; font-weight:700;
  padding:9px 14px; border-radius:999px; opacity:0; transition:opacity .18s; pointer-events:none;
  max-width:86%; text-align:center; line-height:1.35;
}
/* ★260801-2 «지금 어떤 모드이고, 무엇이 무료인가»를 찍기 전에 계속 보여 주는 칩.
   참고앱(vFlat)은 화면 왼쪽에 「두 페이지 모드 · 무료 4장」을 늘 띄운다 — 사용자가
   **다 찍고 나서** 유료임을 알게 되는 일이 없다. 우리는 장수를 막지 않으므로(스캔은 무제한)
   대신 «저장이 구매자 기능»임을 같은 자리에서 미리 알린다. */
.sc-chip{
  position:absolute; left:10px; top:10px; display:flex; flex-direction:column; gap:3px;
  background:rgba(0,0,0,.52); color:#fff; border-radius:12px; padding:7px 11px;
  font-size:12px; font-weight:700; line-height:1.3; pointer-events:none; max-width:62%;
}
.sc-chip b{ color:#5b86ff; font-weight:800; }
.sc-chip .sc-chip-buy{ font-weight:600; opacity:.82; font-size:11px; }
/* ★260809 «펼친 책 같습니다» 제안 띠 — 미리보기 아래쪽, 셔터 바로 위.
   판정이 틀릴 수 있으므로 **누르기 전에는 아무것도 안 바뀐다**(scan.js spreadWide 주석). */
.sc-sug{
  position:absolute; left:10px; right:10px; bottom:12px; display:flex; gap:8px; align-items:stretch;
}
.sc-sug[hidden]{ display:none; }
.sc-sug-yes{
  flex:1 1 auto; display:flex; align-items:center; justify-content:center; gap:8px;
  background:#1b45c4; color:#fff; border:0; border-radius:14px; padding:11px 14px;
  font-size:13.5px; font-weight:800; line-height:1.25; box-shadow:0 6px 18px rgba(21,32,58,.28);
}
.sc-sug-yes:active{ transform:scale(.98); }
.sc-sug-yes svg{ width:18px; height:18px; flex:0 0 auto; }
.sc-sug-no{
  flex:0 0 auto; width:44px; border:0; border-radius:14px; background:rgba(0,0,0,.55);
  color:#fff; font-size:15px; font-weight:800;
}
/* ★260809 «한 장으로 합치기» — 나뉜 직후 9초. 제안 띠와 같은 자리를 쓴다(둘이 함께 뜨는 일은 없다:
   제안은 책 모드가 꺼져 있을 때만, 합치기는 나뉜 직후에만 뜬다). */
.sc-merge{ position:absolute; left:10px; right:10px; bottom:12px; display:flex; }
.sc-merge[hidden]{ display:none; }
.sc-merge-yes{
  flex:1 1 auto; display:flex; align-items:center; justify-content:center; gap:8px;
  background:rgba(17,24,39,.92); color:#fff; border:0; border-radius:14px; padding:11px 14px;
  font-size:13.5px; font-weight:800; line-height:1.25; box-shadow:0 6px 18px rgba(21,32,58,.28);
}
.sc-merge-yes:active{ transform:scale(.98); }
/* 하단 = 흰 패널(둥근 상단) — 아이콘 열 / 셔터 열 / [저장 폴더 ⌃] 필 (vFlat 5번째 화면의 위계) */
.sc-bot{
  flex:0 0 auto; display:flex; flex-direction:column; align-items:center; gap:8px;
  padding:10px 18px 12px; background:#fbfcff; border-radius:20px 20px 0 0;
  box-shadow:0 -4px 18px rgba(21,32,58,.08);
}
.sc-icons{ display:flex; gap:14px; }
.sc-shotrow{ width:100%; display:flex; align-items:center; justify-content:space-between; padding:0 10px; }
.sc-thumb{
  width:52px; height:52px; flex:0 0 auto; border-radius:10px; border:2px solid #d7dfef;
  background:#eef2fb center/cover no-repeat; position:relative;
}
.sc-thumb.has{ border-color:#1b45c4; }
.sc-cnt{
  position:absolute; right:-6px; top:-6px; min-width:21px; height:21px; border-radius:999px;
  background:#1b45c4; color:#fff; font-size:11.5px; font-weight:800; line-height:21px; text-align:center; padding:0 5px;
}
.sc-shot{
  width:74px; height:74px; flex:0 0 auto; border-radius:999px; border:5px solid #1b45c4;
  background:#fff; box-shadow:inset 0 0 0 3px #eaf0ff;
}
.sc-shot:active{ transform:scale(.94); }
.sc-libbtn{ width:52px; height:52px; border-radius:14px; }
.sc-pill{
  border:1px solid #d7dfef; border-radius:999px; background:#fff; color:#1a2233;
  font-size:13px; font-weight:700; padding:8px 18px;
}
.sc-pill b{ color:#1b45c4; }
.sc-filters{ margin-bottom:10px; }
/* 퀵액션 스택(vFlat 8번째 화면 상당) — 촬영 ≥1장일 때 스테이지 우측 */
.sc-quick{
  position:absolute; right:10px; bottom:8px; z-index:7; display:flex; flex-direction:column; gap:8px;
}
.sc-quick[hidden]{ display:none !important; }
.sc-q{
  border:0; border-radius:12px; background:rgba(255,255,255,.94); color:#1a2233;
  font-size:12.5px; font-weight:700; padding:9px 12px; box-shadow:0 1px 8px rgba(21,32,58,.16); text-align:left;
}
/* 시트(더보기·저장위치·라이브러리·OCR 결과) */
.sc-pane .sc-prow{
  display:block; width:100%; text-align:left; border:1px solid var(--line); border-radius:12px;
  background:#fff; color:#1a2233; font-size:14px; font-weight:600; padding:12px 14px; margin:6px 0;
}
.sc-pane .sc-prow.on{ border-color:#1b45c4; background:#eaf0ff; }
.sc-pane .sc-plbl{ margin:10px 2px 6px; font-size:12px; font-weight:700; color:#5b6b86; }
/* ★260810 #51 — 「스캔 완료」 이름 짓기(iLovePDF 10번째 화면) */
.sc-nameform{ display:block; }
.sc-namein{ width:100%; box-sizing:border-box; min-height:48px; padding:0 12px;
  border:1px solid #d7deec; border-radius:12px; background:#fff; color:#12203a;
  font-size:16px; /* 16px 미만이면 iOS 가 입력칸에서 화면을 확대한다 */ }
.sc-namein:focus{ outline:none; border-color:#3b66ff; box-shadow:0 0 0 3px rgba(59,102,255,.15); }
.sc-namebtns{ display:flex; flex-direction:column; gap:8px; margin-top:14px; }
.sc-namego{ min-height:52px; border:0; border-radius:12px; background:#3b66ff; color:#fff;
  font-size:15px; font-weight:800; }
.sc-namemore{ min-height:46px; border:1px solid #d7deec; border-radius:12px;
  background:#f2f5fb; color:#1f2b45; font-size:14px; font-weight:700; }
.sc-namego:active{ transform:scale(.98); background:#2f57e6; }
.sc-namemore:active{ transform:scale(.98); background:#e2e8f6; }
.sc-libgrid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; }
.sc-libcard{ border:1px solid var(--line); border-radius:12px; background:#fff; overflow:hidden; padding:0; }
.sc-libcard img{ display:block; width:100%; height:110px; object-fit:cover; background:#eef2fb; }
.sc-libcap{ padding:7px 9px; font-size:12.5px; font-weight:700; color:#1a2233; text-align:left; }
/* ★260824 PHY 3차 신고④ — 「선택된 폴더는 따로 표기」·「폴더 추가도 쉽게」 */
.sc-libcard.on{ border-color:var(--brand,#2b5bd7); box-shadow:0 0 0 2px rgba(43,91,215,.18); }
.sc-libtag{ padding:0 9px 8px; font-size:11.5px; font-weight:800; color:var(--brand,#2b5bd7); text-align:left; }
.sc-libadd{ display:flex; flex-direction:column; align-items:center; justify-content:center;
            min-height:110px; border-style:dashed; color:#5b6478; }
.sc-libplus{ font-size:30px; line-height:1; color:#8a94a8; margin-top:14px; }
/* ★260824 PHY 3차 신고⑤ — 문서 화면의 «여러 장 고르기» 격자 */
.sc-doc-grid{ flex:1; overflow:auto; padding:10px; display:grid;
              grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:8px; align-content:start; }
.sc-gcell{ position:relative; padding:0; border:2px solid var(--line); border-radius:10px;
           background:#eef2fb; overflow:hidden; aspect-ratio:3/4; }
.sc-gcell img{ display:block; width:100%; height:100%; object-fit:cover; }
.sc-gcell.on{ border-color:var(--brand,#2b5bd7); }
.sc-gtick{ position:absolute; top:6px; right:6px; width:22px; height:22px; border-radius:50%;
           display:flex; align-items:center; justify-content:center; font-size:13px; font-weight:900;
           color:#fff; background:rgba(20,28,45,.35); }
.sc-gcell.on .sc-gtick{ background:var(--brand,#2b5bd7); }
.sc-doc-selbar{ display:flex; gap:6px; padding:8px 10px; border-top:1px solid var(--line); background:#fff; }
.sc-doc-selbar button{ flex:1; padding:11px 4px; border:1px solid var(--line); border-radius:10px;
                       background:#fff; font-size:12.5px; font-weight:700; color:#1a2233; }
.sc-doc-selbar button.danger{ color:#b3261e; border-color:#f0c8c4; }
.sc-ocrtxt{ width:100%; min-height:180px; border:1px solid var(--line); border-radius:10px; padding:10px; font-size:13px; }
/* 문서 화면(vFlat 7번째 상당) — 전면 층. scanui(120)·sc-modal(130)보다 아래·위 관계: 문서 화면 위에 시트가 떠야 한다 */
.sc-doc{
  position:fixed; inset:0; z-index:126; background:#fbfcff; color:#1a2233;
  display:flex; flex-direction:column; padding-top:var(--safe-t); padding-bottom:var(--safe-b);
}
.sc-doc-top{ flex:0 0 auto; height:52px; display:flex; align-items:center; gap:8px; padding:0 8px; }
.sc-doc-name{ flex:1 1 auto; text-align:left; border:0; background:none; color:#1a2233; font-size:15px; font-weight:800; }
.sc-doc-n{ font-size:13px; font-weight:700; color:#5b6b86; padding-right:6px; }
.sc-doc-body{ flex:1 1 auto; min-height:0; position:relative; display:flex; align-items:center; justify-content:center; }
.sc-doc-body img{ max-width:94%; max-height:96%; border-radius:8px; box-shadow:0 2px 14px rgba(21,32,58,.16); background:#fff; }
.sc-doc-prev,.sc-doc-next{
  position:absolute; top:50%; transform:translateY(-50%); width:38px; height:56px; border:0;
  border-radius:12px; background:rgba(255,255,255,.9); color:#1a2233; font-size:22px; font-weight:800;
  box-shadow:0 1px 8px rgba(21,32,58,.14);
}
.sc-doc-prev{ left:6px; } .sc-doc-next{ right:6px; }
.sc-doc-prev:disabled,.sc-doc-next:disabled{ opacity:.3; }
.sc-doc-ocr{ align-self:center; margin:4px 0; }
/* ★260810 #51 — 문서 화면의 «보이는» 필터 띠(iLovePDF 5번째 화면).
 *   가로로 넘치면 **띠 안에서만** 밀린다 — 화면 전체가 가로로 흔들리면 안 된다. */
.sc-doc-fx{ flex:0 0 auto; display:flex; gap:8px; padding:8px 12px; overflow-x:auto;
  background:#fff; border-top:1px solid var(--line); -webkit-overflow-scrolling:touch; }
.sc-doc-fx::-webkit-scrollbar{ display:none; }
.sc-fx{ flex:0 0 auto; min-height:36px; padding:0 14px; border:1px solid #d7deec;
  border-radius:999px; background:#f2f5fb; color:#1f2b45; font-size:13px; font-weight:700; }
.sc-fx.on{ background:#3b66ff; border-color:#3b66ff; color:#fff; }
.sc-fx:active{ transform:scale(.96); }
.sc-doc-bar{ flex:0 0 auto; display:flex; border-top:1px solid var(--line); background:#fff; }
.sc-doc-bar button{
  flex:1 1 0; border:0; background:none; color:#1a2233; font-size:16px; padding:9px 0 10px;
  display:flex; flex-direction:column; align-items:center; gap:2px;
}
.sc-doc-bar button span{ font-size:11px; font-weight:700; color:#5b6b86; }
/* 자르기 편집기 */
.sc-crop .sc-ce-body{ flex:1 1 auto; min-height:0; display:flex; align-items:center; justify-content:center; }
.sc-crop canvas{ touch-action:none; border-radius:8px; box-shadow:0 2px 14px rgba(21,32,58,.16); }
.sc-ce-apply{ background:#1b45c4; color:#fff; border-color:#1b45c4; }
/* ★260810 자르기 화면 아래 두 버튼(전체 테두리 / 테두리 감지) — iLovePDF 2번째 화면.
 *   ⚠️폰 아래 «제스처 막대»에 가리지 않게 safe-area 를 더한다. 그 한 줄이 없으면 기기에 따라
 *     버튼 절반이 시스템 막대 밑으로 들어가 «눌러도 안 눌리는» 자리가 된다. */
.sc-ce-bar{
  flex:0 0 auto; display:flex; justify-content:center; gap:12px;
  padding:10px 14px calc(10px + env(safe-area-inset-bottom));
}
.sc-ce-b{
  flex:1 1 0; max-width:220px; min-height:56px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px;
  background:#f2f5fb; border:1px solid #d7deec; border-radius:12px; color:#1f2b45;
}
.sc-ce-i{ font-size:19px; line-height:1; }
.sc-ce-l{ font-size:12px; font-weight:700; }
.sc-ce-b:active{ transform:scale(.96); background:#e2e8f6; }
body.hf-scan .tabbar, body.hf-scan .appbar{ display:none; }

/* ★260808 PHY 실기기 신고 ③ 「해당 프로그램 전반적으로 터치 시 바로 반응하여 터치 즉시 화면에
 *   출력되도록 조치를 취해야한다」 — 스캔 계열 버튼에는 «눌림» 표시가 **하나도 없었다.**
 *
 *   왜 아무 반응이 없었나: style.css 40 이 `*{ -webkit-tap-highlight-color:transparent }` 로
 *   **브라우저 기본 눌림 효과를 전역에서 껐다.** 다른 화면들은 `:active` 로 대체 효과를 넣었는데
 *   (.tabbtn·.tcard·.frow·.iconbtn…), 260808 에 새로 만든 스캔 화면 계열만 빠져 있었다.
 *   그래서 손님이 자르기·PDF 만들기를 눌러도 화면이 **티끌만큼도 안 변한다** →
 *   «안 눌렸다»고 읽고 한 번 더 누른다 → 그것이 신고 ② 의 두 겹 열림을 만들었다.
 *   즉 이 CSS 한 조각이 «반응 없음»과 «강제 종료»를 잇는 첫 칸이었다(법칙 449).
 *
 *   ＋`touch-action:manipulation` — 안드로이드 웹뷰가 «두 번 눌러 확대»를 기다리느라 두는
 *     지연을 없앤다. 손가락이 떨어지자마자 click 이 간다. */
.sc-ic:active, .sc-pill:active, .sc-q:active, .sc-prow:active,
.sc-doc-bar button:active, .sc-doc-name:active,
.sc-doc-prev:active, .sc-doc-next:active, .sc-thumb:active{
  transform:scale(.96); background:var(--brand-soft);
}
.sc-ic.on:active, .sc-ce-apply:active{ transform:scale(.96); background:#12318f; }
.sc-doc-bar button:active span{ color:#1b45c4; }
.sc-ic, .sc-pill, .sc-q, .sc-prow, .sc-doc-bar button, .sc-doc-name,
.sc-doc-prev, .sc-doc-next, .sc-thumb, .sc-shot, .sc-ce-apply{
  touch-action:manipulation;
  transition:transform .06s ease, background .06s ease;   /* 손가락을 «따라오는» 느낌 — 길면 굼떠 보인다 */
}
.sc-doc-prev:disabled:active, .sc-doc-next:disabled:active{ transform:none; background:transparent; }

/* ★260808 PHY 실기기 신고 ④ — 텍스트 인식 결과 «판».
 *   팝업(가운데 뜨는 모달 + 어두운 막)이 아니다: 아래에서 올라와 화면의 절반만 덮으므로
 *   **사진은 위에 그대로 보인다.** 문서 화면(126)보다 위, 시트(130)·진행 표시(140)보다 아래. */
.sc-ocrpane{
  position:fixed; left:0; right:0; bottom:0; z-index:128;
  max-height:62%; display:flex; flex-direction:column;
  background:#fff; border-top:1px solid var(--line); border-radius:16px 16px 0 0;
  box-shadow:0 -8px 28px rgba(21,32,58,.18); padding-bottom:var(--safe-b);
  animation:scOpUp .16s ease-out;
}
@keyframes scOpUp{ from{ transform:translateY(14px); opacity:.6; } to{ transform:none; opacity:1; } }
.sc-op-top{ flex:0 0 auto; display:flex; align-items:center; gap:8px; padding:12px 14px 6px; }
.sc-op-title{ flex:1 1 auto; font-size:14px; font-weight:800; color:#1a2233; }
.sc-op-x{ border:0; background:none; font-size:17px; color:#5b6b86; padding:4px 6px; touch-action:manipulation; }
.sc-op-x:active{ transform:scale(.9); }
.sc-op-body{ flex:1 1 auto; min-height:64px; overflow-y:auto; padding:2px 14px 8px; -webkit-overflow-scrolling:touch; }
/* ★260809 PHY 신고 5 — «편집 가능한 형태»(textarea). 260808 에는 읽기 전용 글덩이였는데,
   실기기에서 드래그가 매끄럽지 않다고 하셔서 뒤집었다. 테두리·배경은 없애 «글판»처럼 보이게 둔다. */
.sc-op-txt{
  display:block; width:100%; box-sizing:border-box; min-height:96px; resize:none;
  border:0; outline:none; background:transparent; padding:0; margin:0;
  font-family:inherit; font-size:14px; line-height:1.62; color:#1a2233;
  white-space:pre-wrap; word-break:break-word;
  -webkit-user-select:text; user-select:text; -webkit-touch-callout:default;
}
/* ★260823 PHY 신고 3번 — 「영역별로 잘 나누어서 그 영역 글자만 복사」.
 *   행 높이를 44px 아래로 내리지 말 것: A4 를 폰(390px)에 넣으면 영역의 76.9%가 44px 미만이라
 *   **사진 위 상자를 직접 짚는 길은 못 쓴다**(실측). 짚는 것은 이 목록의 «행»이다. */
.sc-op-tabs{ display:flex; gap:6px; padding:2px 0 8px; }
.sc-op-tab{
  flex:0 0 auto; min-height:34px; padding:0 14px; border-radius:999px;
  border:1px solid var(--line); background:#fff; color:#5b6b86;
  font-size:12.5px; font-weight:700; touch-action:manipulation;
}
.sc-op-tab b{ font-weight:800; opacity:.75; }
.sc-op-tab.on{ background:#1b45c4; color:#fff; border-color:#1b45c4; }
.sc-op-tab:active{ transform:scale(.96); }
.sc-op-host{ display:block; }
.sc-op-list{ display:flex; flex-direction:column; gap:6px; }
.sc-op-row{
  display:flex; align-items:center; gap:10px; width:100%;
  min-height:44px;                     /* ★손가락이 짚는 최소 크기 — 내리지 말 것 */
  padding:8px 10px; text-align:left;
  border:1px solid var(--line); border-radius:10px; background:#fff;
  touch-action:manipulation;
}
.sc-op-row:active{ background:var(--brand-soft); transform:scale(.995); }
.sc-op-rt{
  flex:1 1 auto; min-width:0; font-size:13px; line-height:1.45; color:#1a2233;
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden;
}
.sc-op-rc{ flex:0 0 auto; font-size:15px; opacity:.7; }
/* 사진 위에 «지금 고른 영역» 표시 — 문서 화면 몸통(.sc-doc-body)이 position:relative 다. */
.sc-rgn-hi{
  position:absolute; pointer-events:none; z-index:2;
  border:2px solid #1b45c4; border-radius:4px; background:rgba(27,69,196,.14);
  box-shadow:0 0 0 2px rgba(255,255,255,.55);
}
.sc-op-wait{ display:flex; align-items:center; gap:10px; padding:14px 0; font-size:13px; color:var(--ink-soft); font-weight:600; }
.sc-op-wait .spin{ width:20px; height:20px; border-width:2.5px; }
.sc-op-bar{ flex:0 0 auto; display:flex; gap:8px; padding:8px 14px 12px; border-top:1px solid var(--line); }
.sc-op-b{
  flex:1 1 0; padding:11px 8px; border:1px solid var(--line); border-radius:11px; background:#fff;
  font-size:13.5px; font-weight:700; color:#1a2233; touch-action:manipulation;
  transition:transform .06s ease, background .06s ease;
}
.sc-op-b.on{ background:#1b45c4; color:#fff; border-color:#1b45c4; }
.sc-op-b:active{ transform:scale(.96); background:var(--brand-soft); }
.sc-op-b.on:active{ background:#12318f; }

/* 스캔 화면 위에 뜨는 모달(찍은 페이지) — .scanui 가 z-index 120 이라 그보다 위여야 보인다 */
.tool-modal.sc-modal{ z-index:130; }
/* ★260808 뒤로가기용 닫기 버튼 — back.js 가 «눌러서» 닫는다(닫는 길을 한 곳에 두려고).
 *   눈에는 안 보이되 **있어야** 한다: 없으면 뒤로가기가 hidden 만 세우고 시트는 그대로 남았다.
 *   `display:none` 은 쓰지 않는다 — 지우개처럼 보이지만 click() 은 여전히 먹으므로 굳이 위험을
 *   감수할 필요가 없고, 크기 0 + 투명이 더 확실하다. */
.sc-sheet-close{ position:absolute; left:0; top:0; width:0; height:0; padding:0; margin:0; border:0; opacity:0; overflow:hidden; pointer-events:none; }
/* ★260804 #87 «모든 도구» 시트 — 도구 탭의 .tgrid/.tcard 를 그대로 쓰되, 카드 안이라 스크롤만 허용 */
.ts-card .tgrid{ overflow-y:auto; padding:2px; }
.ts-card{ z-index:1; }

/* 스캔 결과 페이지 타일 — 작은 격자(원본 비율 유지). pe-grid 는 원래 PDF 페이지용이라 크기가 다르다 */
.sc-modal .pe-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(104px,1fr)); gap:10px; }
.sc-modal .pe-tile{ position:relative; border:1px solid var(--line); border-radius:10px; overflow:hidden; background:#fff; }
.sc-modal .pe-tile img{ display:block; width:100%; height:132px; object-fit:contain; background:#f3f5fa; }
.sc-modal .pe-bar{ display:flex; }
.sc-modal .pe-bar button{ flex:1 1 0; border:0; border-top:1px solid var(--line); background:#fff; padding:6px 0; font-size:12px; color:var(--ink-soft); }
/* ★260810 #50 — 도구 끝 화면(프로세스 완료). shell.js showDone() 이 그린다.
   토스트와 달리 «사라지지 않는다» — 손님이 파일로 갈지 닫을지 스스로 정한다. */
.done-scr{
  position:fixed; inset:0; z-index:1200; display:flex; align-items:center; justify-content:center;
  background:rgba(16,20,28,.55); backdrop-filter:blur(3px); padding:24px;
  animation:doneFade .18s ease-out;
}
@keyframes doneFade{ from{ opacity:0 } to{ opacity:1 } }
.done-in{
  width:100%; max-width:340px; background:var(--surface); border-radius:20px;
  padding:34px 22px 22px; text-align:center; box-shadow:0 18px 48px rgba(0,0,0,.24);
}
.done-ring{ width:96px; height:96px; margin:0 auto 18px; }
.done-ring svg{ width:100%; height:100%; }
/* 초록 고리 + 체크 — 그려지는 동안 «방금 끝났다»가 눈에 남는다 */
.dr-c{ fill:none; stroke:#22a06b; stroke-width:4; opacity:.22; }
.dr-k{
  fill:none; stroke:#22a06b; stroke-width:5; stroke-linecap:round; stroke-linejoin:round;
  stroke-dasharray:48; stroke-dashoffset:48; animation:doneKick .42s .1s ease-out forwards;
}
@keyframes doneKick{ to{ stroke-dashoffset:0 } }
.done-t{ margin:0 0 6px; font-size:19px; font-weight:800; color:var(--ink); }
.done-s{
  margin:0 0 20px; font-size:13.5px; line-height:1.45; color:var(--ink-soft);
  word-break:break-all;                    /* 긴 파일 이름이 상자를 밀어내지 않게 */
}
.done-go{
  width:100%; height:48px; border:0; border-radius:12px;
  background:var(--brand); color:#fff; font-weight:700; font-size:15px; cursor:pointer;
}
.done-go:hover{ background:var(--brand-2); }
/* 끝 화면이 열리면 이 버튼에 초점을 준다(키보드·읽어주기 손님). 그런데 크로뮴 기본 초점테는
   파랑 버튼 위에서 **검은 굵은 테**로 그려져 «고장 난 것처럼» 보인다 — 초점은 남기고 모양만 바꾼다.
   :focus-visible 이라 마우스로 누른 손님에게는 아무것도 안 보인다. */
.done-go:focus{ outline:none; }
.done-go:focus-visible{ outline:2px solid #fff; outline-offset:-5px; box-shadow:0 0 0 3px var(--brand-2); }
.done-x{
  width:100%; height:40px; margin-top:6px; border:0; border-radius:12px;
  background:transparent; color:var(--ink-soft); font-weight:600; font-size:13.5px; cursor:pointer;
}
/* 어두운 화면 — 앱은 prefers-color-scheme 이 아니라 body[data-bg] 로 갈아탄다(260810 sol 지적) */
body[data-bg="dark"] .done-in{ background:#1b2130; box-shadow:0 18px 48px rgba(0,0,0,.5); }
body[data-bg="dark"] .done-t{ color:#eef1f6; }
body[data-bg="dark"] .done-s,
body[data-bg="dark"] .done-x{ color:#9aa3b2; }
/* 움직임을 줄이는 설정을 켠 손님에게는 체크를 그냥 그려 둔다 */
@media (prefers-reduced-motion:reduce){
  .done-scr{ animation:none } .dr-k{ animation:none; stroke-dashoffset:0 }
}
