/* ===== 기본 색·글꼴 (디자인 2: 깔끔하고 한눈에) ===== */
:root {
  --bg: #f3f5f9; --panel: #fff; --line: #e5e9f0; --line-strong: #d4dae4; --text: #111827; --muted: #6b7280;
  --brand: #2563eb; --brand-dark: #1d4ed8; --brand-soft: #eaf1ff; --navy: #0f1a33;
  --ok: #15803d; --ok-soft: #e6f6ec; --warn: #b45309; --warn-soft: #fef3e2;
  --bad: #dc2626; --bad-soft: #fdecec; --out: #7c3aed; --out-soft: #f2ebfe;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .14);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 1px solid var(--line-strong); background: #fff; border-radius: 9px; padding: 8px 14px; font-weight: 600; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
button:hover { background: #f8fafc; border-color: #c3cad6; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .55; cursor: default; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(37, 99, 235, .3); }
button.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
button.danger { color: var(--bad); }
button.danger:hover { background: var(--bad-soft); border-color: #f3c1c1; }
button.small { padding: 4px 10px; font-size: 13px; border-radius: 7px; }
input, select, textarea { border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px 11px; background: #fff; min-width: 0; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .15); }
textarea { resize: vertical; }
a { color: var(--brand); }
h2 { font-size: 18px; font-weight: 700; margin: 0 0 14px; letter-spacing: -.02em; }
h3 { font-size: 15px; font-weight: 700; margin: 0 0 10px; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }

/* 상단 메뉴 */
header.top { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 22px; padding: 0 22px; height: 60px; position: sticky; top: 0; z-index: 5; box-shadow: 0 2px 10px rgba(15, 26, 51, .25); }
header.top .logo { font-weight: 700; font-size: 17px; }
header.top nav { display: flex; gap: 2px; }
header.top nav button { background: none; border: none; color: #b8c4dc; padding: 8px 12px; border-radius: 8px; font-weight: 600; box-shadow: none; }
header.top nav button:hover { background: rgba(255, 255, 255, .07); color: #fff; }
header.top nav button.on { color: #fff; background: rgba(255, 255, 255, .14); }
header.top .right { margin-left: auto; font-size: 13px; color: #b8c4dc; display: flex; align-items: center; gap: 12px; }
header.top .hdr-btn { background: transparent; border: 1px solid rgba(255, 255, 255, .22); color: #fff; font-size: 13px; }
header.top .hdr-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .4); }
.big-qr svg { width: 240px; height: 240px; display: block; margin: 0 auto; }
main { padding: 24px; max-width: 1440px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; box-shadow: var(--shadow); }

/* 요약 카드 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.stat { position: relative; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 14px; cursor: pointer; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.stat::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand); }
.stat:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.stat > .muted:first-child { font-size: 13px; font-weight: 600; }
.stat .n { font-size: 32px; font-weight: 800; letter-spacing: -.03em; line-height: 1.2; margin: 2px 0; }
.stat .muted { font-size: 12.5px; }
.stat.out::before { background: var(--out); } .stat.out .n { color: var(--out); }
.stat.warn::before { background: #f59e0b; } .stat.warn .n { color: var(--warn); }
.stat.bad::before { background: var(--bad); } .stat.bad .n { color: var(--bad); }

/* 공정별 보드 */
.board { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.col { background: #f6f8fb; border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-height: 84px; }
.col h3 { display: flex; justify-content: space-between; align-items: center; font-size: 14px; margin: 2px 2px 4px; }
.col h3 .muted { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 0 9px; font-size: 12px; font-weight: 700; }
.col.out-col { background: #faf7ff; }
.card { background: #fff; border: 1px solid var(--line); border-left: 4px solid #a3acbb; border-radius: 9px; padding: 9px 11px; margin-top: 8px; cursor: pointer; font-size: 13px; box-shadow: 0 1px 2px rgba(16, 24, 40, .04); transition: box-shadow .15s, transform .15s, border-color .15s; }
.card:hover { box-shadow: 0 6px 16px rgba(16, 24, 40, .1); transform: translateY(-1px); }
.card.working { border-left-color: var(--ok); }
.card.out_sent { border-left-color: var(--out); }
.card b { font-size: 14px; }
.card .id { color: var(--muted); font-size: 12px; }

/* 배지 */
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #eef1f5; color: #4b5563; white-space: nowrap; line-height: 1.5; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.out { background: var(--out-soft); color: var(--out); }
.badge.brand { background: var(--brand-soft); color: var(--brand); }

/* 표 */
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12.5px; color: var(--muted); font-weight: 700; background: #f8fafc; }
th:first-child { border-top-left-radius: 8px; } th:last-child { border-top-right-radius: 8px; }
tbody tr { cursor: pointer; transition: background .1s; } tbody tr:hover { background: #f5f8ff; }
.progress { width: 90px; height: 7px; background: #e7ebf1; border-radius: 99px; overflow: hidden; display: inline-block; vertical-align: middle; margin-right: 6px; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #3b82f6, var(--brand)); border-radius: 99px; }

/* 공정 흐름 (칩) */
.flow { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #eef1f5; color: #4b5563; }
.chip.done { background: var(--ok-soft); color: var(--ok); }
.chip.cur { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(37, 99, 235, .3); }
.chip.cur.out { background: var(--out); box-shadow: 0 2px 6px rgba(124, 58, 237, .3); }
.chip.out:not(.cur):not(.done) { background: var(--out-soft); color: var(--out); }
.flow .arrow { color: #b6bdc8; font-size: 10px; }

/* 폼 */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.form-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 600; color: var(--muted); }
.form-grid .wide { grid-column: span 3; }
.palette { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.palette button { border-radius: 999px; padding: 6px 12px; }
.palette button.out { color: var(--out); border-color: #dccbf6; background: #fcfaff; }
.palette button.both { border-style: dashed; }
.builder { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.builder li { display: flex; gap: 8px; align-items: center; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 7px; background: #fff; }
.builder li::before { counter-increment: s; content: counter(s); width: 24px; height: 24px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; display: grid; place-items: center; font-weight: 800; flex: none; }
.builder li.locked { background: #f7f9fc; color: var(--muted); }
.builder li .pname { font-weight: 700; min-width: 86px; }
.builder .empty { color: var(--muted); padding: 14px; border: 1.5px dashed var(--line-strong); border-radius: 10px; text-align: center; }

/* 상세 창 */
.modal-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); backdrop-filter: blur(2px); display: flex; justify-content: flex-end; z-index: 10; animation: fade-in .15s ease-out both; }
.modal { background: var(--bg); width: min(880px, 100%); height: 100%; overflow: auto; padding: 22px; box-shadow: var(--shadow-lg); animation: slide-in .22s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes slide-in { from { transform: translateX(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal .head { display: flex; gap: 18px; align-items: flex-start; }
.modal .qr svg { width: 124px; height: 124px; display: block; border-radius: 8px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: center; }
.timeline li:last-child { border-bottom: none; }
.timeline .dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: #e7ebf1; color: #6b7280; font-weight: 800; }
.timeline .done .dot { background: var(--ok); color: #fff; }
.timeline .working .dot { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-soft); }
.timeline .out_sent .dot { background: var(--out); color: #fff; box-shadow: 0 0 0 4px var(--out-soft); }
.events { font-size: 13px; }
.events div { padding: 6px 0; border-bottom: 1px solid #eef1f5; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 11px 20px; border-radius: 12px; z-index: 90; box-shadow: var(--shadow-lg); font-weight: 600; }
.toast.err { background: var(--bad); }

/* 로그인 */
.login-screen { position: fixed; inset: 0; background: radial-gradient(circle at 30% 15%, #26478a 0%, #0f1a33 70%); display: grid; place-items: center; z-index: 100; padding: 16px; }
.login-box { background: #fff; border-radius: 16px; padding: 32px 24px 26px; width: min(350px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
/* 로고가 흐릿하게 떠오르며 선명해지고, 이름과 입력칸이 차례로 나타난다 (과하지 않게 한 번만) */
.login-hero { text-align: center; margin-bottom: 24px; }
.hero-logo { width: 200px; max-width: 72%; height: auto; display: block; margin: 0 auto; animation: logo-in 1.1s cubic-bezier(.16, 1, .3, 1) both; }
.login-hero .rule { width: 36px; height: 2px; border-radius: 1px; background: #d9dde5; margin: 18px auto 0; transform-origin: center; animation: rule-in .7s .5s cubic-bezier(.16, 1, .3, 1) both; }
.login-hero .t1 { font-size: 21px; font-weight: 800; margin-top: 14px; color: #14213d; letter-spacing: -.01em; animation: fade-up .7s .55s cubic-bezier(.16, 1, .3, 1) both; }
.login-hero .t2 { font-size: 13px; color: var(--muted); margin-top: 4px; letter-spacing: .04em; animation: fade-up .7s .7s cubic-bezier(.16, 1, .3, 1) both; }
.login-body { animation: fade-up .7s .9s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes logo-in { from { opacity: 0; transform: translateY(6px) scale(.96); filter: blur(10px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes rule-in { from { opacity: 0; transform: scaleX(0); } to { opacity: 1; transform: none; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .login-hero *, .login-body { animation: none !important; } }

/* 회사 이름 · 아이콘 (화면 왼쪽 위) */
.brand { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand-logo { background: #fff; border-radius: 6px; padding: 3px 6px; display: inline-flex; flex: none; }
.brand-logo img { height: 22px; width: auto; display: block; }
.brand-text { display: inline-flex; align-items: baseline; gap: 5px; }
.brand-co { font-weight: 500; font-size: .86em; opacity: .85; letter-spacing: .02em; }
.brand b { font-weight: 800; }
.login-hero .brand-co { opacity: .7; font-weight: 600; }
.login-box form { display: flex; flex-direction: column; gap: 12px; }
.login-box label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.login-box input { padding: 11px; font-size: 16px; }
.login-box button { padding: 12px; font-size: 16px; font-weight: 700; width: 100%; }
.login-err { color: var(--bad); font-size: 14px; min-height: 1em; }
.login-help { text-align: center; font-size: 13px; margin-top: 14px; }
.me-box { display: flex; align-items: center; gap: 8px; }
.me-box a { color: #c9d2e3; }

/* 공정 아이콘 (선 아이콘, 글자색을 따라감) */
.pi { width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-right: 4px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.chip .pi { margin-right: 3px; }
.col h3 .pi { color: var(--brand); }
.col.out-col h3 .pi { color: var(--out); }
.where .pi { width: 1.2em; height: 1.2em; }

/* 알림 */
.bell { position: relative; background: transparent; border: 1px solid #3d4e70; color: #fff; padding: 4px 9px; font-size: 15px; min-height: 0; }
.bell-n { position: absolute; top: -6px; right: -7px; background: var(--bad); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 5px; line-height: 17px; }
.notice-stack { position: fixed; top: 62px; right: 16px; z-index: 70; display: flex; flex-direction: column; gap: 8px; width: min(340px, calc(100vw - 32px)); }
.notice { background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 8px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(15, 26, 51, .18); cursor: pointer; font-size: 14px; animation: fade-up .35s ease-out both; }
.notice.issue { border-left-color: var(--bad); }
.notice .muted { font-size: 12px; }
.notice-panel { position: fixed; top: 58px; right: 12px; z-index: 75; width: min(380px, calc(100vw - 24px)); max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; box-shadow: 0 12px 32px rgba(15, 26, 51, .22); }
.notice-row { padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.notice-row:hover { background: #f6f9ff; }
.notice-row .muted { font-size: 12px; }
@media (max-width: 800px) { /* 핸드폰은 위쪽 메뉴를 가리지 않게 아래에 */
  .notice-stack { top: auto; bottom: 14px; flex-direction: column-reverse; }
  .notice-panel { top: auto; bottom: 12px; max-height: 75vh; }
}

/* 도면 · 공구 요청 */
.pp-preview { margin-top: 8px; }
.pp-preview img { max-width: 100%; max-height: 240px; border-radius: 8px; display: block; margin-bottom: 6px; }
.req-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: #fff; cursor: pointer; color: inherit; text-decoration: none; }
.req-item:hover { border-color: var(--brand); }
.req-item .t { min-width: 0; flex: 1; }
.req-item .t b { display: block; }
.req-item .big { font-size: 22px; }
.file-row { display: flex; gap: 10px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: #fff; }
.file-row.old { opacity: .6; }
.file-row .t { flex: 1; min-width: 0; word-break: break-all; }
.nav-n { background: var(--bad); color: #fff; border-radius: 9px; font-size: 11px; font-weight: 700; padding: 0 6px; margin-left: 4px; line-height: 17px; display: inline-block; }

/* 작업자 화면 ☰ 메뉴 */
.drawer-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 80; }
.drawer-bg[hidden] { display: none; }
.drawer { position: absolute; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); background: #fff; overflow: auto; padding: 14px 10px 24px; box-shadow: 8px 0 30px rgba(15, 26, 51, .25); animation: drawer-in .22s ease-out both; }
@keyframes drawer-in { from { transform: translateX(-100%); } to { transform: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 10px; border-bottom: 1px solid var(--line); color: #14213d; }
.drawer-who { padding: 10px 8px; font-size: 14px; color: var(--muted); }
.drawer-item { display: flex; align-items: center; gap: 12px; padding: 13px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 16px; }
.drawer-item:hover, .drawer-item:active { background: var(--brand-soft); }
.drawer-item .ic { width: 26px; text-align: center; font-size: 19px; }
.drawer-item.strong { font-weight: 700; color: var(--brand); border-top: 1px solid var(--line); margin-top: 6px; border-radius: 0; }

/* 소재관리 */
.mat-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin: 8px 0 12px; }
.mat-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.mat-item { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; background: #fff; cursor: pointer; color: inherit; text-decoration: none; }
.mat-item:hover { border-color: var(--brand); }
.mat-item .pi { color: var(--warn); width: 1.4em; height: 1.4em; }
.mat-item .t { min-width: 0; flex: 1; }
.mat-item .t b { display: block; }

/* 사진 · 특이사항 */
.btn-like { display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; padding: 8px 14px; background: #fff; cursor: pointer; min-height: 42px; font-weight: 600; }
.btn-like.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.uploader .preview img { max-width: 100%; max-height: 280px; border-radius: 8px; display: block; margin: 10px 0; }
.kind-pick { display: flex; gap: 6px; }
.kind-pick label { flex: 1; border: 1px solid var(--line); border-radius: 6px; padding: 9px; text-align: center; cursor: pointer; }
.kind-pick input { display: none; }
.kind-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.kind-pick label.issue:has(input:checked) { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(105px, 1fr)); gap: 8px; }
.photo { padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #fff; text-align: left; min-height: 0; }
.photo img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #eef0f3; }
.photo .cap { display: block; font-size: 12px; padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.photo.issue { border: 2px solid var(--bad); }
.photo.issue .cap { color: var(--bad); font-weight: 600; }
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .88); z-index: 60; display: flex; flex-direction: column; padding: 12px; gap: 10px; }
.lightbox > img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.lightbox .info { background: #fff; border-radius: 8px; padding: 10px 12px; font-size: 14px; max-width: 720px; width: 100%; margin: 0 auto; }
.issue-row { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1px solid #f3c7c3; background: var(--bad-soft); border-radius: 8px; margin-top: 8px; cursor: pointer; }
.issue-row img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; background: #fff; }
.issue-row .t { min-width: 0; font-size: 13px; }
.issue-row .t b { font-size: 14px; color: var(--bad); }

/* QR 라벨 인쇄 (A4, 3열) */
#print-area { display: none; }
@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
  .label { border: 1px solid #000; border-radius: 2mm; padding: 3mm; display: flex; gap: 3mm; height: 38mm; break-inside: avoid; font-size: 9pt; line-height: 1.3; }
  .label svg { width: 30mm; height: 30mm; flex: none; }
  .label .id { font-size: 11pt; font-weight: 700; }
  .label .name { font-weight: 700; }
  .poster { grid-column: 1 / -1; text-align: center; padding-top: 15mm; }
  .poster h1 { font-size: 30pt; margin: 0 0 8mm; }
  .poster svg { width: 120mm; height: 120mm; }
  .poster .url { font-size: 16pt; font-weight: 700; margin: 4mm 0 10mm; }
  .poster ol { display: inline-block; text-align: left; font-size: 14pt; line-height: 1.8; }
}

.mobile-only { display: none; }
a.hdr-btn { border: 1px solid #3d4e70; border-radius: 6px; padding: 6px 10px; text-decoration: none; }

/* 핸드폰: 현장에서 관리자 화면을 손가락으로 쓰기 쉽게 */
@media (max-width: 800px) {
  .stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat { padding: 10px 12px; } .stat .n { font-size: 24px; }
  .form-grid { grid-template-columns: 1fr; } .form-grid .wide { grid-column: auto; }
  header.top { flex-wrap: wrap; height: auto; padding: 8px 12px 0; gap: 4px 10px; }
  header.top .right { gap: 8px; font-size: 12px; }
  header.top #clock, header.top #phone-qr { display: none; }
  header.top nav { order: 3; width: calc(100% + 24px); margin: 0 -12px; overflow-x: auto; }
  header.top nav button { padding: 11px 12px; white-space: nowrap; min-height: 0; }
  .mobile-only { display: inline-flex; }
  main { padding: 10px; }
  .panel { padding: 12px; overflow-x: auto; }
  h2 { font-size: 17px; }
  input, select, textarea { font-size: 16px; padding: 9px; } /* 16px 미만이면 아이폰이 화면을 확대한다 */
  button { min-height: 40px; }
  button.small { min-height: 34px; padding: 4px 10px; }
  .actions button, .actions select { flex: 1 1 auto; }
  .row > #q { flex-basis: 100%; }
  .board { grid-template-columns: 1fr 1fr; gap: 8px; }
  .palette button { padding: 8px 12px; }
  .builder li { flex-wrap: wrap; }
  .builder li select { flex: 1 1 120px; }
  .modal { padding: 12px; }
  .modal .head { flex-direction: column; }
  .modal .qr svg { width: 140px; height: 140px; }
  .timeline li { grid-template-columns: 26px 1fr; }
  .timeline li > .badge { grid-column: 2; justify-self: start; }

  /* 표를 카드처럼 */
  table.cards thead { display: none; }
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; width: 100%; }
  table.cards tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; padding: 8px 10px; background: #fff; position: relative; }
  table.cards td { border: none; padding: 3px 0; display: flex; gap: 8px; align-items: center; }
  table.cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12px; min-width: 58px; flex: none; }
  table.cards td.sel { position: absolute; top: 8px; right: 10px; width: auto; }
  table.cards td.sel input { width: 22px; height: 22px; }
  table.cards td input:not([type=checkbox]), table.cards td select { flex: 1; }
}
@media (max-width: 380px) {
  .board { grid-template-columns: 1fr; }
}

/* 📊 통계 */
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sgrid.three { grid-template-columns: 1fr 1fr 1fr; }
.sgrid > .panel { margin-bottom: 18px; }
.stable { font-size: 14px; }
.stable th, .stable td { padding: 8px 8px; }
.stable tbody tr { cursor: default; }
.sbar { display: inline-block; width: 100%; min-width: 60px; height: 9px; background: #eef1f5; border-radius: 99px; overflow: hidden; vertical-align: middle; }
.sbar i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, var(--brand)); border-radius: 99px; }
.sbar.ok i { background: linear-gradient(90deg, #4ade80, var(--ok)); }
.sbar.warn i { background: linear-gradient(90deg, #fbbf24, #d97706); }
.sbig { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: -2px 0 6px; }
.sbig span { font-size: 15px; font-weight: 600; margin-left: 2px; color: var(--muted); }
@media (max-width: 900px) { .sgrid, .sgrid.three { grid-template-columns: 1fr; gap: 0; } }

/* 통계 리포트 인쇄 (A4 세로) */
@media print {
  #print-area.as-report { display: block !important; }
  .report { font-size: 10pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .report-head { display: flex; align-items: center; gap: 6mm; border-bottom: 2.5px solid #2563eb; padding-bottom: 3mm; margin-bottom: 5mm; }
  .report-head img { width: 32mm; }
  .report-head h1 { margin: 0; font-size: 18pt; color: #0f1a33; }
  .report .panel, .report .stat { box-shadow: none; break-inside: avoid; }
  .report .stats { grid-template-columns: repeat(4, 1fr); gap: 3mm; }
  .report .stat .n { font-size: 20pt; }
  .report .sgrid { grid-template-columns: 1fr 1fr; gap: 4mm; }
  .report .sgrid.three { grid-template-columns: 1fr 1fr 1fr; }
  .report .panel { padding: 3mm 4mm; margin-bottom: 4mm; }
  .report .stable { font-size: 8.5pt; }
  .report .stable th, .report .stable td { padding: 1.5mm 2mm; }
}

/* ================= 위치 이동 방식 (큰 글씨·큰 버튼) ================= */
html.simple body { font-size: 16.5px; }
html.simple button { min-height: 42px; }
html.simple button.small { min-height: 34px; }
.board-search input { width: 100%; font-size: 19px; padding: 15px 18px; border-radius: 14px; border: 2px solid var(--line-strong); box-shadow: var(--shadow); margin-bottom: 16px; }
.board-search input:focus { border-color: var(--brand); }

/* 위치판 칸 */
.loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 18px; }
.loc-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; min-height: 112px; border-radius: 16px; border: 2px solid transparent; text-align: left; box-shadow: var(--shadow); background: #fff; }
.loc-tile .loc-name { font-size: 16px; font-weight: 800; display: flex; align-items: center; gap: 4px; }
.loc-tile .loc-n { font-size: 40px; font-weight: 900; line-height: 1.05; letter-spacing: -.03em; }
.loc-tile .loc-sub { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.loc-tile.big { grid-column: span 2; }
.loc-tile.in { background: #eef4ff; color: #1d4ed8; }
.loc-tile.out { background: #f4eefe; color: #6d28d9; }
.loc-tile.all { background: #0f1a33; color: #fff; }
.loc-tile.all .loc-sub { color: #c7d2e6; }
.loc-tile.hold { background: #fff6e5; color: #b45309; }
.loc-tile.done { background: #e9f8ef; color: #15803d; }
.loc-tile.empty { opacity: .55; }
.loc-tile.on { border-color: currentColor; box-shadow: 0 0 0 3px rgba(37, 99, 235, .15), var(--shadow-lg); opacity: 1; }
.loc-tile:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.warn-red { color: #fff; background: var(--bad); border-radius: 99px; padding: 0 7px; font-size: 12px; }

/* 제품 한 줄 */
.prow { display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; margin-top: 10px; background: #fff; cursor: pointer; transition: box-shadow .15s, transform .15s; }
.prow:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.prow.alert { border: 2px solid #f3b4b4; background: #fffafa; }
.pid { font-size: 13px; font-weight: 700; color: var(--muted); word-break: break-all; }
.pname { font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.psub { font-size: 14px; }
.prow-loc { text-align: right; }
.locbadge { display: inline-block; font-size: 16px; font-weight: 800; padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
.locbadge.in { background: #eef4ff; color: #1d4ed8; }
.locbadge.out { background: #f4eefe; color: #6d28d9; }
.locbadge.done { background: #e9f8ef; color: #15803d; }
.pdays { font-size: 14px; font-weight: 700; color: var(--muted); margin-top: 3px; }
.pdays.red { color: var(--bad); }
.move-btn { font-size: 17px; padding: 12px 18px; border-radius: 12px; }
.big-empty { padding: 24px 0; text-align: center; font-size: 16px; }

/* 제품 화면 */
.modal.product { width: min(820px, 100%); }
.back-btn { font-size: 16px; }
.pid.big { font-size: 15px; }
.pname.big { font-size: 24px; margin: 2px 0 8px; }
.pinfo { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 15px; }
.now-box { border-radius: 18px; padding: 18px 22px; margin-bottom: 14px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.now-box.in { background: linear-gradient(135deg, #2563eb, #1d4ed8); color: #fff; }
.now-box.out { background: linear-gradient(135deg, #7c3aed, #6d28d9); color: #fff; }
.now-box.done { background: linear-gradient(135deg, #16a34a, #15803d); color: #fff; }
.now-label { width: 100%; font-size: 14px; font-weight: 700; opacity: .85; }
.now-where { font-size: 30px; font-weight: 900; letter-spacing: -.03em; }
.now-days { font-size: 20px; font-weight: 800; opacity: .9; }
.act-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.huge { font-size: 20px; font-weight: 800; padding: 18px 22px; border-radius: 14px; flex: 1 1 260px; }
.huge2 { font-size: 16px; padding: 14px 18px; border-radius: 12px; flex: 0 1 auto; }
.qr-panel { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.qr-panel .qr svg { width: 130px; height: 130px; display: block; }

/* 지나온 길 (노선도) */
.route { display: flex; align-items: center; gap: 0; overflow-x: auto; padding: 6px 2px 10px; }
.stop { flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 108px; gap: 3px; position: relative; }
.stop .dot { width: 18px; height: 18px; border-radius: 50%; background: #c7cfdb; border: 3px solid #fff; box-shadow: 0 0 0 2px #c7cfdb; }
.stop.in .dot { background: #2563eb; box-shadow: 0 0 0 2px #2563eb; }
.stop.out .dot { background: #7c3aed; box-shadow: 0 0 0 2px #7c3aed; }
.stop.ship .dot { background: #16a34a; box-shadow: 0 0 0 2px #16a34a; }
.stop.past { opacity: .75; }
.stop.cur .dot { width: 24px; height: 24px; animation: pulse 1.6s ease-in-out infinite; }
.stop b { font-size: 14.5px; }
.stop .when { font-size: 12px; color: var(--muted); }
.stop .here { font-size: 11.5px; font-weight: 800; color: #fff; background: var(--bad); border-radius: 99px; padding: 1px 8px; }
.route .line { flex: 1 0 24px; height: 3px; background: #d4dae4; margin-top: -40px; min-width: 24px; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }

/* 큰 확인 창 */
.bigc-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .55); z-index: 120; display: grid; place-items: center; padding: 16px; animation: fade-in .12s both; }
.bigc { background: #fff; border-radius: 20px; padding: 28px 24px 22px; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow-lg); }
.bigc-msg { font-size: 22px; line-height: 1.5; margin-bottom: 22px; }
.bigc-msg b { color: var(--brand); }
.bigc-btns { display: flex; gap: 10px; }
.bigc-check { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 19px; font-weight: 700; margin: -8px 0 18px; padding: 12px; border-radius: 12px; background: #f1f5f9; cursor: pointer; }
.bigc-check input { width: 24px; height: 24px; }
.bigc-btns button { flex: 1; font-size: 19px; font-weight: 800; padding: 16px; border-radius: 14px; }
.bigdone { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 110; background: #111827; color: #fff; border-radius: 16px; padding: 14px 16px 14px 20px; display: flex; gap: 14px; align-items: center; font-size: 18px; font-weight: 800; box-shadow: var(--shadow-lg); max-width: calc(100vw - 24px); }
.bigdone button { background: #fff; color: #111827; border: none; font-size: 16px; padding: 10px 14px; border-radius: 10px; }

/* 다음은 어디로 선택 창 (화면 가득) */
.chooser-bg { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 100; display: flex; justify-content: center; align-items: flex-end; animation: fade-in .15s both; }
.chooser { background: var(--bg); width: min(760px, 100%); max-height: 100%; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 18px 28px; animation: slide-up .22s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes slide-up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.ch-head { display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); }
.ch-now { font-size: 16px; margin-top: 4px; }
.ch-x { font-size: 20px; min-width: 48px; }
.ch-q { font-size: 24px; text-align: center; margin: 18px 0 12px; }
.ch-group { margin-bottom: 14px; }
.ch-title { font-size: 16px; font-weight: 800; margin: 0 4px 8px; }
.ch-title.in { color: #1d4ed8; }
.ch-title.out { color: #6d28d9; }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ch-btn { min-height: 78px; font-size: 20px; font-weight: 800; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border-width: 2px; }
.ch-btn .pi { width: 26px; height: 26px; margin: 0; }
.ch-btn.in { background: #fff; border-color: #bfd4ff; color: #1d4ed8; }
.ch-btn.out { background: #fff; border-color: #dccbf6; color: #6d28d9; }
.ch-btn.in:hover { background: #eef4ff; }
.ch-btn.out:hover { background: #f4eefe; }
.ch-btn.here { opacity: .5; border-style: dashed; }
.ch-btn small { font-size: 12px; font-weight: 700; color: var(--bad); }
.ch-ship { width: 100%; min-height: 72px; font-size: 22px; font-weight: 900; border-radius: 16px; background: #16a34a; border-color: #16a34a; color: #fff; margin-top: 6px; }
.ch-ship:hover { background: #15803d; }
.ch-memo { width: 100%; margin-top: 12px; font-size: 17px; padding: 14px; border-radius: 12px; }

/* 새 제품 등록 */
.np-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.np-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; color: #374151; }
.np-grid input, .np-grid select { font-size: 17px; padding: 12px 13px; border-radius: 12px; }
.np-grid .wide { grid-column: span 3; }
.pid-preview { margin: 16px 0; padding: 14px 16px; background: #f6f8fb; border: 1px dashed var(--line-strong); border-radius: 12px; font-size: 17px; }
.pid-preview b { font-size: 19px; color: var(--brand); word-break: break-all; }

@media (max-width: 800px) {
  .loc-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .loc-tile.big { grid-column: span 2; }
  .loc-tile { min-height: 96px; }
  .loc-tile .loc-n { font-size: 34px; }
  .prow { grid-template-columns: 1fr auto; gap: 8px 10px; }
  .prow-due { grid-column: 1; }
  .move-btn { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .prow-loc { text-align: left; grid-column: 1; }
  .np-grid { grid-template-columns: 1fr; }
  .np-grid .wide { grid-column: auto; }
  .ch-grid { grid-template-columns: repeat(2, 1fr); }
  .ch-btn { min-height: 70px; font-size: 18px; }
  .now-where { font-size: 26px; }
  .chooser { border-radius: 0; height: 100%; }
}

/* 제품 목록: 보기·정렬, 고른 줄, 꺼진 버튼 */
.list-tools label.mini { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted, #64748b); white-space: nowrap; }
.list-tools label.mini select { min-width: 150px; }
table.cards tr.picked td { background: #eff6ff; }
button:disabled { opacity: .45; cursor: not-allowed; }
@media (max-width: 700px) { .list-tools label.mini { width: 100%; } .list-tools label.mini select { flex: 1; } }

/* 📥 작업 대기 (아직 한 번도 안 옮긴 제품) */
.loc-tile.wait { background: #fff7ed; color: #c2410c; }
.locbadge.wait { background: #fff7ed; color: #c2410c; }
.now-box.wait { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; }
.stop.wait .dot { background: #f59e0b; box-shadow: 0 0 0 2px #f59e0b; }

/* 새로고침 버튼 · 당겨서 새로고침 */
header.top .reload-btn { font-size: 14px; }
.reload-btn .rl-i { display: inline-block; }
.reload-btn.spin .rl-i { animation: rl-spin .8s linear infinite; }
@keyframes rl-spin { to { transform: rotate(360deg); } }
.pull-tip { position: fixed; top: 0; left: 50%; transform: translate(-50%, -120%); z-index: 9999; background: #0f1a33; color: #fff;
  padding: 10px 18px; border-radius: 0 0 14px 14px; font-weight: 700; font-size: 15px; transition: transform .15s; pointer-events: none; }
.pull-tip.show { transform: translate(-50%, 0); }
.pull-tip.ready { background: #2563eb; }
@media (max-width: 700px) { .reload-btn .rl-t { display: none; } header.top .reload-btn { font-size: 18px; padding: 4px 10px; } }

/* 제품이 많을 때: 더 보기 */
.more-btn { display: block; width: 100%; margin-top: 10px; padding: 14px; font-size: 16px; font-weight: 700; background: #eef4ff; color: #1d4ed8; border: 1px dashed #93c5fd; }
tr.more-row td { padding: 6px 0 !important; }

/* 특이사항·메모 (글만) */
.note-box { width: 100%; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid #cbd5e1; resize: vertical; font-family: inherit; }
.note-box:focus { outline: 2px solid #93c5fd; border-color: #2563eb; }
.uploader .kind-pick { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
.note-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.note-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; width: 100%; padding: 10px 12px;
  border-radius: 10px; border: 1px solid #e2e8f0; background: #f8fafc; color: inherit; font-weight: 400; min-height: 0; }
.note-item.issue { border-color: #fca5a5; background: #fef2f2; }
.note-item.resolved { opacity: .7; }
.note-tag { font-size: 12px; font-weight: 700; color: #475569; }
.note-item.issue .note-tag { color: #dc2626; }
.note-text { font-size: 16px; font-weight: 600; white-space: pre-wrap; word-break: break-all; }
.note-meta { font-size: 12px; color: #64748b; }
.lightbox .info:only-child { margin: auto; max-width: 520px; }
.uploader .row .btn-like, .uploader .row button { white-space: nowrap; }
@media (max-width: 480px) { .uploader .row .btn-like, .uploader .row button { font-size: 14px; padding-left: 8px; padding-right: 8px; } }
/* 핸드폰: '보냈습니다 · 되돌리기' 알림이 찌그러지지 않게 */
.bigdone { width: max-content; }
.bigdone span { word-break: keep-all; }
.bigdone button { white-space: nowrap; flex: none; }
@media (max-width: 600px) { .bigdone { left: 12px; right: 12px; transform: none; width: auto; font-size: 16px; justify-content: space-between; } }
.list-tools.exact { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px 10px; }
.list-tools.exact label.mini input { min-width: 0; }

/* 📷 앱 안 QR 찍기 */
header.top .scan-btn { background: #2563eb; border-color: #2563eb; font-weight: 700; }
.board-search { display: flex; gap: 10px; }
.board-search input { flex: 1; min-width: 0; }
.scan-big { white-space: nowrap; font-size: 17px; font-weight: 800; padding: 0 18px; border-radius: 14px; }
.scan-bg { position: fixed; inset: 0; z-index: 300; background: #000; display: flex; flex-direction: column; color: #fff; }
.scan-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: 17px; }
.scan-top b { flex: 1; }
.scan-x { background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.35); font-size: 16px; padding: 8px 14px; }
.scan-view { position: relative; flex: 1; min-height: 0; overflow: hidden; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 50%; top: 50%; width: min(70vw, 70vh, 340px); aspect-ratio: 1; transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); border-radius: 18px; }
.scan-frame i { position: absolute; width: 38px; height: 38px; border: 5px solid #22c55e; }
.scan-frame i:nth-child(1) { left: -3px; top: -3px; border-right: 0; border-bottom: 0; border-radius: 16px 0 0 0; }
.scan-frame i:nth-child(2) { right: -3px; top: -3px; border-left: 0; border-bottom: 0; border-radius: 0 16px 0 0; }
.scan-frame i:nth-child(3) { left: -3px; bottom: -3px; border-right: 0; border-top: 0; border-radius: 0 0 0 16px; }
.scan-frame i:nth-child(4) { right: -3px; bottom: -3px; border-left: 0; border-top: 0; border-radius: 0 0 16px 0; }
.scan-msg { text-align: center; padding: 12px 16px; font-size: 16px; line-height: 1.5; }
.scan-bottom { display: flex; flex-direction: column; gap: 10px; padding: 0 16px 20px; }
.scan-torch { background: #facc15; color: #111; font-weight: 800; font-size: 17px; border: 0; padding: 12px; }
.scan-type { display: flex; gap: 8px; }
.scan-type input { flex: 1; min-width: 0; font-size: 17px; color: #0f172a; background: #fff; caret-color: #2563eb; }
.scan-type input::placeholder { color: #94a3b8; }
@media (max-width: 700px) { header.top .scan-btn { font-size: 18px; padding: 4px 10px; } .scan-big { font-size: 16px; padding: 0 14px; } }
/* QR 읽은 뒤 잠깐 보여 주기 */
.scan-bg.found .scan-frame i { border-color: #22c55e; }
.scan-bg.found .scan-frame { box-shadow: 0 0 0 100vmax rgba(0,0,0,.65); outline: 4px solid #22c55e; }
.scan-found { position: absolute; left: 16px; right: 16px; bottom: 18px; background: #16a34a; color: #fff; border-radius: 18px; padding: 16px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4); text-align: center; }
.scan-found .sf-t { font-size: 20px; font-weight: 800; }
.scan-found .sf-id { font-size: 18px; font-weight: 700; margin-top: 4px; word-break: break-all; }
.scan-found .sf-bar { height: 6px; background: rgba(255,255,255,.3); border-radius: 3px; margin: 12px 0; overflow: hidden; }
.scan-found .sf-bar i { display: block; height: 100%; width: 0; background: #fff; transition: width linear; }
.scan-found .sf-btns { display: flex; gap: 10px; }
.scan-found .sf-btns button { flex: 1; font-size: 17px; font-weight: 800; padding: 12px; border-radius: 12px; }
.scan-found .sf-again { background: #fff; color: #15803d; border: 0; }
.scan-found .sf-go { background: #0f172a; color: #fff; border: 0; }
/* 선택 창: 2공장(이현테크)처럼 버튼 하나뿐인 공장은 넓게 */
.ch-grid.one { grid-template-columns: 1fr; }
/* QR 창 품번 자동완성 */
.scan-sugg { max-height: 42vh; overflow: auto; background: #111827; border-radius: 12px; display: flex; flex-direction: column; }
.scan-sugg button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; background: transparent; color: #fff;
  border: 0; border-bottom: 1px solid rgba(255,255,255,.12); border-radius: 0; padding: 11px 14px; min-height: 0; }
.scan-sugg button:last-child { border-bottom: 0; }
.scan-sugg button:active { background: rgba(255,255,255,.12); }
.scan-sugg b { font-size: 16px; word-break: break-all; }
.scan-sugg span { font-size: 13px; color: #cbd5e1; }
.scan-sugg .none { padding: 12px 14px; color: #94a3b8; font-size: 14px; }
/* 품번 입력 중: 카메라 접고 입력 칸·후보를 위로 (자판에 안 가려지게) */
.scan-back { display: none; }
.scan-bg.typing { height: var(--vvh, 100%); bottom: auto; }
.scan-bg.typing .scan-view, .scan-bg.typing .scan-msg, .scan-bg.typing .scan-torch { display: none; }
.scan-bg.typing .scan-bottom { flex: 1; min-height: 0; padding-top: 4px; }
.scan-bg.typing .scan-type { order: -1; }
.scan-bg.typing .scan-sugg { flex: 1 1 auto; max-height: none; min-height: 0; }
.scan-bg.typing .scan-back { display: block; order: 5; background: rgba(255,255,255,.15); color: #fff; border: 1px solid rgba(255,255,255,.3); font-size: 15px; padding: 10px; }

/* 📦 여러 개 한꺼번에 옮기기 */
.board-search { margin-bottom: 12px; }
.board-search input { margin-bottom: 0; }
.multi-big { width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 0 0 16px; padding: 12px 16px;
  font-size: 17px; font-weight: 800; color: #1e3a8a; background: #fff; border: 2px dashed #93c5fd; border-radius: 14px; }
.multi-big span { font-size: 14px; font-weight: 600; color: var(--muted); }
.scan-bg.multi .scan-view { flex: 1 1 40%; }
.scan-basket { background: #111827; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.sb-head { display: flex; align-items: center; gap: 8px; font-size: 17px; }
.sb-head b { flex: 1; } .sb-n { color: #4ade80; font-size: 20px; }
.sb-clear { background: transparent; color: #cbd5e1; border: 1px solid rgba(255,255,255,.3); font-size: 13px; padding: 5px 10px; }
.sb-list { max-height: 22vh; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.sb-item { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.07); border-radius: 10px; padding: 7px 10px; }
.sb-item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sb-item b { font-size: 15px; word-break: break-all; } .sb-item span { font-size: 12.5px; color: #cbd5e1; }
.sb-item button { background: transparent; color: #fca5a5; border: 1px solid rgba(252,165,165,.4); font-size: 14px; padding: 4px 10px; }
.sb-empty { color: #94a3b8; font-size: 14px; padding: 4px 2px; }
.sb-go { font-size: 18px; font-weight: 800; padding: 14px; border-radius: 12px; }
.sb-go:disabled { opacity: .45; }
.scan-flash { position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 12px 14px; border-radius: 14px; font-size: 17px; font-weight: 800;
  text-align: center; word-break: break-all; box-shadow: 0 8px 24px rgba(0,0,0,.4); }
.scan-flash.ok { background: #16a34a; color: #fff; }
.scan-flash.dup { background: #f8fafc; color: #0f172a; }
.scan-flash.bad { background: #dc2626; color: #fff; }
.scan-bg.typing .sb-list, .scan-bg.typing .sb-go { display: none; }
.ch-many { max-height: 96px; overflow: auto; font-size: 14px; margin-top: 6px; line-height: 1.5; }

/* 🧩 세트(아세이) */
.setbadge { display: inline-block; font-size: 12px; font-weight: 800; color: #7c2d12; background: #ffedd5; border: 1px solid #fdba74; border-radius: 999px; padding: 1px 8px; vertical-align: middle; }
.set-panel h3 { margin-top: 0; }
.set-kids { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.set-kid { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line-strong); background: #fff; }
.set-kid b { font-size: 14px; word-break: break-all; } .set-kid span { font-size: 13px; color: var(--muted); }
.set-kid .loc { font-weight: 800; color: #1e3a8a; }
.set-kid.ready { border-color: #16a34a; background: #f0fdf4; } .set-kid.ready .loc { color: #15803d; }
.set-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: #fff7ed; border: 2px solid #fdba74; font-size: 15px; }
.set-banner .muted { flex: 1; min-width: 200px; }
.ch-set { margin-top: 4px; font-size: 14px; font-weight: 800; color: #9a3412; }
.ch-title.set { color: #9a3412; }
.loc-tile.set { background: #fff7ed; } .loc-tile.set .loc-name, .loc-tile.set .loc-n { color: #9a3412; }
.np-hint { font-size: 13px; background: #f8fafc; border: 1px dashed var(--line-strong); border-radius: 10px; padding: 8px 10px; }
.new-product textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); }
/* 🧩 세트 화면 쉽게: 단계 안내 + 큰 버튼 하나 */
.set-steps { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 4px 0 12px; }
.set-steps .ss { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #f1f5f9; color: #94a3b8; font-weight: 700; font-size: 14px; }
.set-steps .ss b { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; align-items: center; justify-content: center; background: #cbd5e1; color: #fff; font-size: 13px; }
.set-steps .ss.on { background: #fff7ed; color: #9a3412; outline: 2px solid #fb923c; } .set-steps .ss.on b { background: #ea580c; }
.set-steps .ss.past { color: #475569; } .set-steps .ss.past b { background: #64748b; }
.ss-arrow { color: #cbd5e1; font-weight: 800; }
.set-big { width: 100%; font-size: 19px; font-weight: 800; padding: 16px; border-radius: 14px; border: 0; background: #ea580c; color: #fff; margin-bottom: 8px; }
.set-big.go { background: #16a34a; }
.modal.product > .set-big { margin: 0 0 12px; }
.set-tip { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 10px; }
.set-prog { height: 12px; border-radius: 6px; background: #e2e8f0; overflow: hidden; margin-bottom: 8px; }
.set-prog i { display: block; height: 100%; background: #16a34a; }
.set-kid b small { font-weight: 600; color: var(--muted); }
.set-add { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.set-add textarea { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong); }
.set-panel.plain { padding-top: 12px; padding-bottom: 12px; }
.set-add[hidden] { display: none; }
/* ← 뒤로 · 🏠 홈 */
.nav-back { background: rgba(255,255,255,.12); color: #fff; border: 1px solid rgba(255,255,255,.3); font-size: 22px; font-weight: 800; width: 44px; height: 40px; padding: 0; border-radius: 10px; flex: none; margin-right: -10px; }
.nav-back:active { background: rgba(255,255,255,.25); }
header.top .logo { cursor: pointer; }
.home-btn { margin-left: 8px; }
@media (max-width: 700px) { .nav-back { width: 40px; height: 38px; font-size: 20px; margin-right: -6px; } }

/* 🚚 묶어서 출하 · 🧾 거래명세표 */
.multi-row { display: flex; gap: 10px; margin: 0 0 16px; }
.multi-row .multi-big { margin: 0; flex: 1; }
.multi-big.ship { color: #14532d; border-color: #86efac; }
@media (max-width: 700px) { .multi-row { flex-direction: column; } }
.ship-box, .stmt-box { max-width: 1100px; }
.ship-pick { display: flex; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.ship-pick label, .ship-opts label { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.ship-pick select, .ship-pick input { min-width: 160px; }
.ship-list { max-height: 50vh; overflow: auto; border: 1px solid var(--line-strong); border-radius: 12px; }
.ship-tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.ship-tbl th { position: sticky; top: 0; background: #f1f5f9; text-align: left; padding: 8px; font-size: 13px; }
.ship-tbl td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
.ship-tbl td.c { text-align: center; } .ship-tbl td.r { text-align: right; font-variant-numeric: tabular-nums; }
.ship-tbl input[type=checkbox] { width: 20px; height: 20px; }
.ship-tbl input:not([type=checkbox]) { padding: 6px 8px; font-size: 15px; }
.ship-opts { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
.ship-opts .grow { min-width: 200px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.chk input { width: 18px; height: 18px; }
.ship-go { width: 100%; font-size: 19px; font-weight: 800; padding: 15px; border-radius: 14px; }
.ship-go:disabled { opacity: .45; }
.stmt-top { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 12px; margin: 6px 0 12px; }
.stmt-top label { display: flex; flex-direction: column; font-size: 13px; font-weight: 700; color: var(--muted); gap: 3px; }
.stmt-top label.wide { grid-column: span 2; }
@media (max-width: 800px) { .stmt-top { grid-template-columns: 1fr 1fr; } }
.stmt-tbl input { width: 100%; }
.stmt-sum { font-size: 16px; padding: 10px 12px; background: #f8fafc; border-radius: 10px; }
.stmt-sum .big { font-size: 20px; }
.stmt-memo { width: 100%; margin-top: 8px; }
.stmt-hist { margin-top: 10px; font-size: 13px; } .stmt-hist div { padding: 3px 0; }
.stmt-row { display: flex; align-items: center; gap: 8px; padding: 8px 4px; border-top: 1px solid var(--line); cursor: pointer; }
.partner { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-top: 8px; }
.partner summary { cursor: pointer; }
.partner-form { margin-top: 10px; }

/* 🧾 거래명세표 인쇄 (A4 한 장에 위아래 두 부) */
@media print {
  #print-area.as-statement { display: block !important; }
  #print-area.as-statement .st-page { break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid; }
  #print-area.as-statement .st-page:last-child { break-after: auto; page-break-after: auto; }
}
.as-statement { font-family: Pretendard, 'Malgun Gothic', sans-serif; color: #111; font-size: 8.4pt; -webkit-print-color-adjust: exact; print-color-adjust: exact; --ink: #1f2a44; --mid: #c9d0dc; --soft: #eef1f6; }
.as-statement .st-sheet { height: 129mm; display: flex; flex-direction: column; overflow: hidden; }
.as-statement .st-cut { height: 6mm; display: flex; align-items: center; gap: 2mm; color: #888; font-size: 7.5pt; }
.as-statement .st-cut::before, .as-statement .st-cut::after { content: ''; flex: 1; border-top: .3mm dashed #999; }
.as-statement .st-head { display: flex; align-items: flex-end; gap: 4mm; border-bottom: .9mm solid var(--ink); padding-bottom: 2mm; }
.as-statement .st-head img { height: 9mm; }
.as-statement .st-title { flex: 1; text-align: center; }
.as-statement .st-title h1 { margin: 0; font-size: 17pt; font-weight: 900; letter-spacing: 7pt; color: var(--ink); }
.as-statement .st-title .copy { display: inline-block; margin-top: .8mm; font-size: 8pt; font-weight: 800; border: .3mm solid var(--ink); padding: 0 2.5mm; }
.as-statement .st-doc { width: 46mm; font-size: 8pt; line-height: 1.55; text-align: right; }
.as-statement .st-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5mm; margin-top: 2.5mm; }
.as-statement .party { border: .45mm solid var(--ink); display: grid; grid-template-columns: 6.5mm 1fr; }
.as-statement .party .side { background: var(--ink); color: #fff; font-weight: 800; font-size: 8.2pt; writing-mode: vertical-rl; text-orientation: upright; display: flex; align-items: center; justify-content: center; letter-spacing: 1.5pt; }
.as-statement .party table { width: 100%; border-collapse: collapse; }
.as-statement .party td { border-bottom: .2mm solid var(--mid); border-left: .2mm solid var(--mid); padding: .4mm 1.6mm; height: 4.8mm; vertical-align: middle; }
.as-statement .party tr:last-child td { border-bottom: 0; }
.as-statement .party td.k { background: var(--soft); font-weight: 700; width: 15mm; white-space: nowrap; font-size: 7.8pt; }
.as-statement .party td.v { font-weight: 600; }
.as-statement .party td.big { font-size: 9.4pt; font-weight: 800; }
.as-statement .stamp { position: relative; }
.as-statement .stamp .seal { position: absolute; right: 1.5mm; top: 50%; transform: translateY(-50%); width: 9mm; height: 9mm; border: .35mm solid #c0392b; border-radius: 50%; color: #c0392b; font-size: 6.5pt; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.as-statement .st-sum { margin-top: 2.5mm; display: grid; grid-template-columns: 26mm 1fr 30mm 34mm; border: .45mm solid var(--ink); }
.as-statement .st-sum div { padding: 1.1mm 2.5mm; display: flex; align-items: center; }
.as-statement .st-sum .k { background: var(--ink); color: #fff; font-weight: 800; justify-content: center; }
.as-statement .st-sum .kor { font-size: 10.2pt; font-weight: 900; }
.as-statement .st-sum .k2 { background: var(--soft); font-weight: 700; justify-content: center; border-left: .3mm solid var(--ink); font-size: 7.6pt; }
.as-statement .st-sum .num { font-size: 11pt; font-weight: 900; justify-content: flex-end; }
.as-statement .st-items { width: 100%; border-collapse: collapse; margin-top: 2.5mm; table-layout: fixed; border: .45mm solid var(--ink); }
.as-statement .st-items th { background: var(--soft); border: .2mm solid var(--mid); border-bottom: .35mm solid var(--ink); font-weight: 800; font-size: 7.8pt; padding: 1.1mm 1mm; }
.as-statement .st-items td { border: .2mm solid var(--mid); padding: .4mm 1.4mm; height: 5.1mm; font-size: 8.2pt; vertical-align: middle; overflow: hidden; white-space: nowrap; }
.as-statement .st-items td.c { text-align: center; }
.as-statement .st-items td.r { text-align: right; }
.as-statement .st-items td.sm { font-size: 7pt; }
.as-statement .st-items tr.empty td { color: transparent; }
.as-statement .st-items tfoot td { background: var(--soft); font-weight: 800; border-top: .35mm solid var(--ink); height: 5.4mm; }
.as-statement .st-bottom { margin-top: 2.2mm; display: grid; grid-template-columns: 1fr 58mm; gap: 2.5mm; }
.as-statement .memo { border: .3mm solid var(--mid); padding: 1.6mm 2.2mm; font-size: 7.8pt; line-height: 1.5; }
.as-statement .sign { border: .45mm solid var(--ink); display: grid; grid-template-columns: 1fr 1fr; }
.as-statement .sign div { padding: 1.4mm 2mm; font-size: 7.8pt; }
.as-statement .sign .k { background: var(--soft); font-weight: 800; text-align: center; border-bottom: .2mm solid var(--mid); }
.as-statement .sign .s { height: 8mm; border-left: .2mm solid var(--mid); display: flex; align-items: flex-end; justify-content: flex-end; color: #888; }
.as-statement .sign .s:nth-child(3) { border-left: 0; }
.as-statement .st-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 7pt; color: #666; }
.as-statement, .as-statement * { line-height: 1.25; }
.as-statement .memo { line-height: 1.45; }
.stmt-scroll { overflow-x: auto; }
.stmt-tbl { min-width: 900px; }
.stmt-tbl input[data-f=name] { min-width: 160px; }
/* 거래명세표 · 묶어서 출하 창: 넓게, 칸이 창 밖으로 안 나가게 */
.chooser.stmt-box, .chooser.ship-box { width: min(1100px, 100%); }
.stmt-top { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stmt-top input { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 800px) { .stmt-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 📄 서류 메뉴 · 견적서 · 발주서 */
.doc-tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.doc-tabs button { font-size: 16px; font-weight: 800; padding: 10px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line-strong); }
.doc-tabs button.on { background: var(--navy, #0f1a33); color: #fff; border-color: transparent; }
.go-green { background: #16a34a !important; border-color: #16a34a !important; }
.as-statement .st-sheet.full { height: 272mm; }
.as-statement .st-sheet.full .st-items td { height: 8mm; }
.as-statement .st-sheet.full .party td { height: 5.6mm; }
.as-statement .st-sheet.full .sign .s { height: 11mm; }
.as-statement .doc-to { margin-top: 2.5mm; font-size: 11pt; }
.as-statement .doc-to b { font-size: 12.5pt; border-bottom: .4mm solid var(--ink); padding: 0 2mm; }
.as-statement .doc-to span { font-size: 9pt; color: #333; }
.as-statement .st-bottom.one { grid-template-columns: 1fr; }
.as-statement .st-bottom.one .memo { min-height: 18mm; }
/* 알림 글씨(토스트)는 모든 창(선택 창·확인 창·서류 창)보다 위에 */
.toast { z-index: 300; }

/* 단가 나눠 적기 · PART NO */
.cost-box { border: 1px dashed var(--line, #d1d5db); border-radius: 12px; padding: 10px 12px; }
.cost-box summary { cursor: pointer; font-weight: 700; }
.cost-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 10px; }
.cost-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
@media (max-width: 720px) { .cost-grid { grid-template-columns: repeat(2, 1fr); } }
input.auto { background: #f1f5f9; color: #334155; }
.pn-in { margin-top: 4px; font-size: 12px !important; padding: 5px 8px !important; }
.as-statement .st-items td.nm .pn { font-size: 6.8pt; color: #555; font-weight: 400; margin-left: 1mm; }

/* 출하대기 */
.loc-tile.shipw { border-color: #fdba74; background: #fff7ed; }
.loc-tile.shipw .loc-n { color: #c2410c; }
.ch-title.ship { color: #c2410c; }
