:root {
  --bg:          #f3f6fb;
  --panel:       #ffffff;
  --panel-soft:  #f8faff;
  --line:        #dbe3f0;
  --line-strong: #c9d5e7;
  --text:        #142033;
  --muted:       #627188;
  --primary:     #2563eb;
  --primary-d:   #1d4ed8;
  --secondary:   #eef4ff;
  --danger:      #dc2626;
  --success:     #16a34a;
  --warning:     #f59e0b;
  --shadow:      0 18px 60px rgba(18,38,63,.14);
  --r-xl:  28px;
  --r-lg:  22px;
  --r-md:  16px;
  --r-sm:  12px;
  --tab-h: 62px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  font-family: "Pretendard","Apple SD Gothic Neo","Noto Sans KR",sans-serif;
  background: radial-gradient(circle at top left, #eaf1ff, #f5f7fb 45%, #eef2f8 100%);
  color: var(--text);
}
body { min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 0; }

/* ── 레이아웃 ────────────────────────────────────────────────────────── */
.app-shell {
  width: min(560px, 100% - 16px);
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  padding: 24px 0 32px;
}

/* ── (legacy) 좌측 데스크탑 패널 — 더 이상 사용하지 않음. 메뉴얼 탭으로 이전됨 ── */
.desktop-panel { display: none !important; }

.brand-card, .summary-card, .screen-card, .modal-card, .camera-card {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--shadow);
}
.brand-card, .summary-card { border-radius: var(--r-xl); padding: 22px; }
.brand-card h1             { margin: 8px 0 10px; font-size: 28px; line-height:1.2; }
.brand-card h1 span        { color: var(--primary); }
.summary-card h2           { margin: 0 0 12px; font-size: 17px; }
.summary-card ul           { margin: 0; padding-left: 18px; display: grid; gap: 10px; color: var(--muted); }
.summary-card.compact      { padding: 16px 22px; }
.summary-card code         { display:block; padding: 10px 14px; border-radius: 14px; background:#0f172a; color:#dbeafe; font-size:12px; word-break:break-all; }

.sidebar-sync { display: grid; gap: 10px; margin-top: 8px; }
.sync-row     { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.sync-row span{ color: var(--muted); }

/* ── 텍스트 유틸 ────────────────────────────────────────────────────── */
.eyebrow { margin:0; color:var(--primary); font-size:11px; letter-spacing:.14em; text-transform:uppercase; font-weight:700; }
.muted   { color: var(--muted); }
.small   { font-size: 12px; }
.center  { text-align: center; }
.label   { font-size: 12px; color: var(--muted); display: block; margin-bottom: 4px; }

/* ── 모바일 폰 프레임 ────────────────────────────────────────────────── */
.phone-stage  { display: grid; place-items: center; }
.phone-frame  {
  width: min(430px, 100%);
  min-height: 860px;
  background: linear-gradient(180deg,#152033,#0f1727);
  border-radius: 42px;
  padding: 16px;
  box-shadow: 0 35px 90px rgba(15,23,39,.35);
  position: relative;
}
.phone-notch {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 26px; border-radius: 0 0 18px 18px; background:#0b1020; z-index:3;
}
.screen {
  background: linear-gradient(180deg,#f9fbff,#eef4fb);
  border-radius: 32px;
  min-height: 828px;
  padding: 22px 16px 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── 탑바 ───────────────────────────────────────────────────────────── */
.topbar    { display:flex; justify-content:space-between; align-items:flex-start; padding:8px 4px 10px; flex-shrink:0; }
.topbar h2 { margin: 4px 0 0; font-size: 22px; }
.status-group { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.clock        { font-size: 11px; color: var(--muted); }

/* ── 작업자 스트립 ───────────────────────────────────────────────────── */
.operator-strip {
  background: rgba(255,255,255,.7); border:1px solid var(--line); border-radius: 18px;
  padding: 10px 14px; display:flex; justify-content:space-between; align-items:center; gap:12px;
  margin-bottom: 12px; flex-shrink:0;
}

/* ── 스크린 카드 ────────────────────────────────────────────────────── */
.screen-card {
  display: none;
  border-radius: 24px;
  padding: 16px 16px 80px;
  flex: 1;
  position: relative;
  overflow-y: auto;
}
.screen-card.active { display: block; }

/* ── 히어로 아이콘 ──────────────────────────────────────────────────── */
.hero-icon {
  width:74px; height:74px; border-radius:24px;
  background: linear-gradient(135deg,#dbeafe,#bfdbfe);
  display: grid; place-items: center; margin: 8px auto 14px;
  font-size: 28px; color: var(--primary-d); font-weight: 800;
}
.hero-icon.success { background: linear-gradient(135deg,#dcfce7,#bbf7d0); color: var(--success); }

/* ── 카드 헤더 ──────────────────────────────────────────────────────── */
.card-header, .section-title-row, .recent-header {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.card-header h3, .section-title-row h4 { margin: 0; }

/* ── 버튼 ───────────────────────────────────────────────────────────── */
.action-group        { display: flex; gap: 10px; margin-top: 14px; }
.action-group.two-col   > * { flex: 1; }
.action-group.three-col > * { flex: 1; }
.sticky-actions {
  position: sticky; bottom: 0;
  background: linear-gradient(180deg,rgba(255,255,255,0),rgba(255,255,255,.95) 30%,#fff);
  padding-top: 14px;
}

.primary-btn, .secondary-btn, .danger-btn, .ghost-btn, .wide-btn {
  min-height: 50px; border-radius: 16px; font-weight: 700; transition: .18s ease;
}
.primary-btn, .wide-btn {
  background: linear-gradient(135deg,var(--primary),#3b82f6);
  color: white; box-shadow: 0 10px 24px rgba(37,99,235,.26);
}
.primary-btn:active, .wide-btn:active { transform: scale(.97); }
.secondary-btn { background: var(--secondary); color: var(--primary-d); border: 1px solid #cfe1ff; }
.danger-btn    { background: linear-gradient(135deg,#ef4444,#dc2626); color:white; box-shadow: 0 10px 24px rgba(220,38,38,.22); }
.ghost-btn     { background: white; border: 1px solid var(--line); color: var(--text); padding: 0 14px; }
.wide-btn      { width: 100%; margin-top: 10px; display: block; }
.link-btn      { background: transparent; color: var(--primary); font-size: 13px; padding: 0; }
.icon-btn      { width:34px; height:34px; border-radius:12px; background:#eef2ff; color:#334155; display:grid; place-items:center; }
.small-btn     { min-height: 36px; font-size: 13px; padding: 0 12px; border-radius: 12px; }

/* ── 입력 ───────────────────────────────────────────────────────────── */
.text-input, .text-area, .form-grid input {
  width: 100%; border: 1px solid var(--line-strong); background: white;
  border-radius: 16px; padding: 14px 16px; min-height: 52px; outline: none;
}
.text-input:focus, .text-area:focus, .form-grid input:focus {
  border-color: #8fb5ff; box-shadow: 0 0 0 4px rgba(59,130,246,.12);
}
.text-area   { min-height: 88px; resize: vertical; }
.input-label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 8px; }

/* ── 정보 패널 ──────────────────────────────────────────────────────── */
.info-panel   { background:var(--panel-soft); border:1px solid var(--line); border-radius:20px; padding:12px 14px; display:grid; gap:12px; margin-top:14px; }
.info-row     { display:flex; justify-content:space-between; gap:12px; align-items:center; }
.info-row span{ color:var(--muted); font-size:13px; }
.info-row strong{ text-align:right; font-size:15px; }
.compact-panel{ margin-top:14px; }

/* ── 라이브 카드 ────────────────────────────────────────────────────── */
.live-card, .finish-summary {
  background:var(--panel-soft); border:1px solid var(--line); border-radius:20px;
  padding:14px; display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px;
}
.live-card div, .finish-summary div {
  background:white; border-radius:16px; border:1px solid var(--line); padding:12px;
}
.live-card span, .finish-summary span { display:block; font-size:12px; color:var(--muted); margin-bottom:8px; }
.live-card strong, .finish-summary strong { font-size:15px; }

/* ── 최근 작업 ──────────────────────────────────────────────────────── */
.recent-box  { background:var(--panel-soft); border:1px solid var(--line); border-radius:20px; padding:14px; margin-top:14px; }
.recent-list { display:grid; gap:10px; margin-top:10px; }
.recent-item {
  background:white; border:1px solid var(--line); border-radius:16px; padding:12px; display:grid; gap:6px;
}
.recent-item button { justify-self:start; border-radius:12px; background:#eff6ff; color:var(--primary-d); padding:8px 12px; min-height:auto; font-size:13px; }
.empty-state { padding:20px 12px; text-align:center; color:var(--muted); border:1px dashed var(--line-strong); border-radius:16px; }

/* ── 타임 슬롯 ──────────────────────────────────────────────────────── */
.time-section    { margin-top: 16px; }
.time-grid       { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-top:12px; }
.small-grid      { grid-template-columns: repeat(2,1fr); }
.time-card       { background:var(--panel-soft); border:1px solid var(--line); border-radius:20px; padding:12px; }
.time-card h5    { margin:0 0 6px; font-size:14px; }
.time-card p     { margin:0; color:var(--muted); font-size:12px; }
.time-card input { width:100%; margin-top:10px; min-height:44px; border-radius:14px; border:1px solid var(--line-strong); padding:10px 12px; outline:none; }
.time-card input:focus      { border-color:#8fb5ff; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.time-card input:disabled   { background:#f1f5f9; color:#94a3b8; }
.time-card.active           { grid-column:1/-1; background:#fff; border:1.5px solid var(--primary); box-shadow:0 6px 20px rgba(37,99,235,.1); }
.time-card.active.is-running{ border-color:#16a34a; box-shadow:0 6px 20px rgba(22,163,74,.16); }
.time-card.done             { background:#f1f5f9; opacity:.85; }
.time-card.done .time-total { color:#475569; }
.time-total      { margin-top:8px; color:var(--primary-d); font-weight:700; font-size:13px; }
.slot-input-row  { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:10px; }
.slot-input      { display:flex; flex-direction:column; gap:4px; font-size:12px; color:var(--muted); }
.slot-input > span { font-weight:600; color:#475569; }
.slot-input input{ width:100%; min-height:44px; border-radius:14px; border:1px solid var(--line-strong); padding:10px 12px; outline:none; font-size:15px; font-weight:600; color:#0f172a; }
.slot-input input:focus    { border-color:#8fb5ff; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.slot-input input:disabled { background:#f1f5f9; color:#94a3b8; }
.time-totals     { display:grid; grid-template-columns:repeat(3,1fr); gap:6px; margin-top:10px; }
.time-totals > div { display:flex; flex-direction:column; gap:2px; padding:6px 8px; background:#fff; border:1px solid var(--line); border-radius:10px; }
.time-totals span  { font-size:11px; color:var(--muted); }
.time-totals strong{ font-size:13px; font-weight:700; }

/* ── 작업자별 입력 행 (활성 슬롯) ─────────────────────────────────── */
.op-input-list  { margin-top:12px; display:flex; flex-direction:column; gap:6px; }
.op-input-head  {
  display:grid; grid-template-columns: 1fr 90px 90px; gap:8px;
  font-size:11px; color:var(--muted); font-weight:700;
  padding:0 4px;
}
.op-input-head > span:nth-child(2),
.op-input-head > span:nth-child(3) { text-align:center; }
.op-input-row {
  display:grid; grid-template-columns: 1fr 90px 90px; gap:8px;
  align-items:center;
  padding:6px; background:#fff; border:1px solid var(--line); border-radius:12px;
}
.op-input-row .op-name {
  font-size:13px; font-weight:700; color:#0f172a;
  padding-left:6px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.op-input-row .op-input { display:flex; flex-direction:column; gap:2px; font-size:11px; color:var(--muted); }
.op-input-row .op-input > span { display:none; }   /* 헤더가 라벨 역할 */
.op-input-row .op-input input {
  width:100%; min-height:40px; border-radius:10px; border:1px solid var(--line-strong);
  padding:6px 8px; outline:none; font-size:14px; font-weight:600; color:#0f172a; text-align:right;
}
.op-input-row .op-input input:focus    { border-color:#8fb5ff; box-shadow:0 0 0 3px rgba(59,130,246,.12); }
.op-input-row .op-input input:disabled { background:#f1f5f9; color:#94a3b8; }
.op-empty {
  margin-top:10px; padding:10px 12px; border-radius:12px;
  background:#fff7ed; color:#9a3412; border:1px solid #fed7aa;
}
@media (max-width: 360px) {
  .op-input-head, .op-input-row { grid-template-columns: 1fr 72px 72px; }
}
.time-totals .tt-good strong { color:var(--primary-d); }
.time-totals .tt-bad  strong { color:#dc2626; }
.time-totals .tt-rate strong { color:#b45309; }
.time-card.done .time-totals > div { background:#f8fafc; }
.instruct-hint   { display:inline-block; margin-left:6px; padding:2px 8px; font-size:11px; border-radius:999px; font-weight:500; vertical-align:middle; }
.instruct-hint.is-prev  { background:#dcfce7; color:#15803d; }
.instruct-hint.is-order { background:#fef3c7; color:#b45309; }
.instruct-hint.is-qr    { background:#e2e8f0; color:#475569; }
.time-badge      { display:inline-flex; align-items:center; padding:3px 8px; font-size:11px; border-radius:999px; background:#e2e8f0; color:#334155; margin-bottom:8px; }
.time-badge.overtime { background:#fff1cc; color:#9a6700; }

/* ── 종료 폼 ────────────────────────────────────────────────────────── */
.form-grid       { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin-top:14px; }
.form-grid label { display:grid; gap:8px; color:var(--muted); font-size:13px; }
.form-grid label.full-col { grid-column: 1 / -1; }

/* ── 완료 요약 ──────────────────────────────────────────────────────── */
.done-summary {
  margin-top:18px; padding:14px; background:#f0fdf4; border:1px solid #bbf7d0;
  border-radius:18px; display:grid; gap:10px;
}
.done-summary strong { display: block; }

/* ── 기록 현황 ──────────────────────────────────────────────────────── */
.records-list     { display:grid; gap:12px; margin-top:14px; padding-bottom:16px; }
.records-sync-bar {
  background:#eff6ff; border:1px solid #bfdbfe; border-radius:14px;
  padding:10px 14px; font-size:13px; color:var(--primary-d); margin-top:10px; text-align:center;
}
.record-item {
  background:white; border:1px solid var(--line); border-radius:18px; padding:14px; display:grid; gap:8px;
}
.record-header  { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.record-header strong { flex:1; }
.record-detail  { display:flex; gap:10px; flex-wrap:wrap; font-size:13px; color:var(--muted); }
.record-meta    { display:flex; justify-content:space-between; font-size:12px; color:var(--muted); }
.record-seq     {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:34px; height:22px; padding:0 8px; border-radius:8px;
  background:#0f172a; color:#dbeafe; font-size:11px; font-weight:700;
}
.small-pill     { padding:2px 8px; min-height:auto; font-size:11px; }

/* ── 설정 화면 ──────────────────────────────────────────────────────── */
.settings-group { margin-top: 20px; }
.settings-group:first-child { margin-top: 0; }
.settings-group h4 { margin: 0 0 12px; font-size: 15px; }
.connection-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 14px;
}
.connection-badge.connected    { background:#dcfce7; color:#166534; }
.connection-badge.disconnected { background:#fee2e2; color:#991b1b; }
#cameraStatus { line-height:1.6; padding:0 12px; }
#cameraStatus code { background:#0f172a; color:#dbeafe; padding:2px 6px; border-radius:6px; font-size:11px; }
.gas-hint {
  display:block; padding:10px 14px; border-radius:14px;
  background:#0f172a; color:#dbeafe; font-size:12px; word-break:break-all; margin-top:8px;
}

/* ── 탭 바 ──────────────────────────────────────────────────────────── */
.tab-bar {
  position: sticky;
  bottom: 0;
  left: 0; right: 0;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  display: flex;
  height: var(--tab-h);
  z-index: 10;
  border-radius: 0 0 32px 32px;
  overflow: hidden;
}
/* 글로벌 hidden 유틸 — 모든 element에 적용 */
.hidden { display: none !important; }
.tab-bar.hidden { display: none; }
.tab-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 600;
  position: relative; transition: color .18s;
}
.tab-btn.active        { color: var(--primary); }
.tab-btn .tab-icon     { font-size: 20px; line-height: 1; }
.tab-badge {
  position: absolute; top: 8px; right: calc(50% - 18px);
  background: var(--danger); color: white; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 999px; display: grid; place-items: center; padding: 0 4px;
}
.tab-badge.hidden { display: none; }

/* ── 동기화 배지 (탑바) ──────────────────────────────────────────────── */
.sync-idle    { background:#e2e8f0; color:#334155; }
.sync-ok      { background:#dcfce7; color:#166534; }
.sync-pending { background:#fef3c7; color:#92400e; }

/* ── 필 (공통) ──────────────────────────────────────────────────────── */
.pill {
  display:inline-flex; align-items:center; justify-content:center;
  min-height:28px; padding:0 10px; border-radius:999px; font-size:11px; font-weight:700;
}
.pill.online  { background:#dcfce7; color:#166534; }
.pill.neutral { background:#e2e8f0; color:#334155; }
.pill.working { background:#dbeafe; color:#1d4ed8; }
.pill.finish  { background:#fff7ed; color:#c2410c; }

/* ── 모달 ───────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; background: rgba(15,23,42,.45);
  display: grid; place-items: center; padding: 20px; z-index: 50;
  backdrop-filter: blur(4px);
}
.modal.hidden { display: none; }
.modal-card   { width: min(520px,100%); border-radius: 28px; padding: 22px; }

/* ── 확인 다이얼로그 (예/아니오) ─────────────────────────────────────── */
.confirm-card { width: min(420px, 100%); text-align: center; padding: 28px 24px; background:#fff; }
.confirm-card h3 { margin: 12px 0 8px; font-size: 18px; }
.confirm-card #confirmMessage { font-size: 15px; line-height: 1.55; margin: 0 0 18px; white-space: pre-line; color:#334155; }
.confirm-icon { font-size: 34px; line-height: 1; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions button { min-height: 52px; font-size: 16px; font-weight: 700; border-radius: 14px; }
.confirm-actions .confirm-no  { background:#f1f5f9; color:#475569; border:1px solid #e2e8f0; }
.confirm-actions .confirm-yes { background:#2563eb; color:#fff; }
.confirm-card.is-danger .confirm-yes { background:#dc2626; }
.confirm-card.is-success .confirm-yes { background:#16a34a; }

/* ── 카메라 모달 ────────────────────────────────────────────────────── */
.camera-card {
  width: min(460px, 100%); border-radius: 28px; padding: 20px;
}
.camera-viewport {
  position: relative; margin-top: 16px; border-radius: 20px; overflow: hidden;
  background: #000; aspect-ratio: 1 / 1;
}
#cameraVideo  { width:100%; height:100%; object-fit:cover; display:block; }
#cameraCanvas { display:none; }
.scan-overlay {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.35);
}
.scan-frame {
  width: 200px; height: 200px; position: relative;
}
.corner {
  position: absolute; width: 24px; height: 24px;
  border-color: white; border-style: solid;
}
.corner.tl { top:0; left:0;  border-width:3px 0 0 3px; }
.corner.tr { top:0; right:0; border-width:3px 3px 0 0; }
.corner.bl { bottom:0; left:0;  border-width:0 0 3px 3px; }
.corner.br { bottom:0; right:0; border-width:0 3px 3px 0; }
.scan-line {
  position: absolute;
  left: calc(50% - 100px); width: 200px; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(37,99,235,.9), transparent);
  animation: scanMove 2s ease-in-out infinite;
  top: calc(50% - 100px);
}
@keyframes scanMove {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(196px); }
  100% { transform: translateY(0); }
}

/* ── 토스트 ──────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: white;
  padding: 12px 18px; border-radius: 999px; font-size: 14px;
  z-index: 100; box-shadow: var(--shadow); white-space: nowrap;
  animation: fadeUp .25s ease;
}
.toast.success { background: rgba(22,163,74,.92); }
.toast.error   { background: rgba(220,38,38,.92); }
.toast.warn    { background: rgba(217,119,6,.92); }
@keyframes fadeUp { from { opacity:0; transform:translateX(-50%) translateY(12px); } to { opacity:1; transform:translateX(-50%) translateY(0); } }

/* ── 작업 버튼 (시작/중지/재개) ─────────────────────────────────────── */
.work-btn-area     { padding-top: 14px; }
.pause-btn {
  flex: 1; min-height: 50px; border-radius: 16px; font-weight: 700;
  background: linear-gradient(135deg,#f59e0b,#d97706); color:white;
  box-shadow: 0 10px 24px rgba(245,158,11,.28);
}
.resume-btn {
  flex: 1; min-height: 50px; border-radius: 16px; font-weight: 700;
  background: linear-gradient(135deg,#10b981,#059669); color:white;
  box-shadow: 0 10px 24px rgba(16,185,129,.28);
}
.pause-pill { background:#fff7ed; color:#c2410c; }

/* ── 중지 상태 바 ────────────────────────────────────────────────────── */
.pause-status-bar {
  display: flex; align-items: center; gap: 12px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 18px;
  padding: 12px 14px; margin-top: 12px;
}
.pause-status-bar.hidden { display: none; }
.pause-icon  { font-size: 20px; }
.pause-label { display: block; font-size: 12px; color: var(--muted); }
.pause-time  { font-size: 18px; font-weight: 700; color: #c2410c; }
.over-ten-badge {
  margin-left: auto; background: #dc2626; color: white;
  font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px;
}
.over-ten-badge.hidden { display: none; }
.text-warning { color: #d97706; }

/* ── 공정 선택 버튼 (topbar) ────────────────────────────────────────── */
.process-select-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; padding: 6px 4px; margin: 0;
  font-size: 22px; font-weight: 800; color: var(--text);
  border-radius: 10px; transition: background .15s;
}
.process-select-btn:active { background: rgba(37,99,235,.08); }
.process-select-btn .caret { font-size: 14px; color: var(--primary); margin-left: 2px; }
#processLabel { color: var(--primary-d); }

/* ── 공정 선택 그리드 ──────────────────────────────────────────────── */
.process-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-top: 14px;
}
.process-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; padding: 16px 8px; min-height: 84px;
  background: var(--panel-soft); border: 1.5px solid var(--line);
  border-radius: 16px; transition: .15s; color: var(--text);
}
.process-item:active   { transform: scale(.96); }
.process-item.selected { background: #eef4ff; border-color: var(--primary); color: var(--primary-d); }
.process-item .process-icon { font-size: 22px; line-height: 1; }
.process-item .process-name { font-size: 13px; font-weight: 700; }

/* ── 작업구역 모달 ─────────────────────────────────────────────────── */
.zone-list-box {
  margin-top: 8px; padding: 6px;
  max-height: 320px; overflow-y: auto;
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px;
}
.zone-list-box .empty-state { width: 100%; padding: 24px 8px; text-align: center; }
.zone-group { padding: 8px 6px 12px; }
.zone-group + .zone-group { border-top: 1px dashed var(--line); margin-top: 4px; }
.zone-group-title {
  font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: 0.04em; margin-bottom: 8px;
}
.zone-group-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
}
.zone-item {
  padding: 12px 8px; min-height: 52px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 14px;
  font-size: 13px; font-weight: 700; color: var(--text);
  transition: .15s;
}
.zone-item:active   { transform: scale(.96); }
.zone-item.selected { background: #eef4ff; border-color: var(--primary); color: var(--primary-d); }

/* ── 작업자 등록 리스트 ────────────────────────────────────────────── */
.worker-list-box {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 56px; padding: 10px; margin-top: 6px;
  background: var(--panel-soft); border: 1px solid var(--line); border-radius: 14px;
}
.worker-list-box .empty-state { width: 100%; padding: 8px; font-size: 12px; }
.worker-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px 6px 12px;
  background: #eef4ff; border: 1px solid #bfdbfe; border-radius: 999px;
  color: var(--primary-d); font-size: 13px; font-weight: 600;
}
.worker-chip-del {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff; color: #475569; font-size: 11px; line-height: 1;
  border: 1px solid var(--line-strong);
}
.worker-chip-del:active { background: #f1f5f9; }

/* ── QR 인식 실패 진단 박스 ─────────────────────────────────────────── */
.qr-diag-box {
  margin-top: 12px; padding: 12px 14px;
  background: #fef2f2; border: 1px solid #fecaca; border-radius: 16px;
  display: none;
}
.qr-diag-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.qr-diag-head strong { color: #991b1b; font-size: 13px; flex: 1; }
.qr-diag-raw {
  margin: 0 0 8px; padding: 10px; border-radius: 10px;
  background: #0f172a; color: #fef9c3; font-size: 12px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-all; max-height: 160px; overflow-y: auto;
  font-family: "SFMono-Regular","Consolas",monospace;
}

/* ── 중지 사유 입력 ──────────────────────────────────────────────────── */
.stop-reasons-section {
  margin-top: 18px; padding: 14px;
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: 20px;
}
.stop-reasons-section.hidden { display: none; }
.stop-reasons-section h4 { margin: 0 0 12px; font-size: 14px; color: #c2410c; }
.stop-reason-item { margin-top: 12px; }

/* ── 종료 화면 힌트 ──────────────────────────────────────────────────── */
.form-hint { font-size: 11px; color: var(--muted); font-weight: 400; margin-left: 6px; }

/* ── 기간별 다운로드 ─────────────────────────────────────────────────── */
.period-download-box {
  background: var(--panel-soft); border: 1px solid var(--line);
  border-radius: 20px; padding: 14px; margin-top: 14px;
}
.period-btns { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }
.period-btn  {
  min-height: 44px; border-radius: 14px; font-weight: 700; font-size: 13px;
  background: white; border: 1px solid var(--line-strong); color: var(--primary-d);
  transition: .18s;
}
.period-btn:active { background: var(--secondary); }

/* ── 설정 안내 ──────────────────────────────────────────────────────── */
.setup-guide {
  background: #f8faff; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px; margin-top: 14px; font-size: 13px;
}
.setup-guide strong { display: block; margin-bottom: 8px; }
.setup-guide ol { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--muted); }
.setup-guide code {
  background: #0f172a; color: #dbeafe; padding: 2px 6px; border-radius: 6px; font-size: 11px;
}

/* ── 공지사항 ──────────────────────────────────────────────────────── */
.notice-list { display: grid; gap: 10px; }
.notice-item {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px;
}
.notice-item header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-bottom: 6px; font-size: 11px; color: var(--muted);
}
.notice-item h4   { margin: 0 0 4px; font-size: 14px; }
.notice-item p    { margin: 0; color: #475569; font-size: 13px; line-height: 1.55; }
.notice-tag {
  display: inline-flex; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700;
}
.notice-tag.tag-feature   { background: #dcfce7; color: #15803d; }
.notice-tag.tag-stability { background: #dbeafe; color: #1d4ed8; }
.notice-tag.tag-ops       { background: #fef3c7; color: #b45309; }
.notice-tag.tag-urgent    { background: #fee2e2; color: #b91c1c; }
.notice-tag.tag-default   { background: #e2e8f0; color: #475569; }

/* ── 메뉴얼 ───────────────────────────────────────────────────────── */
.manual-embed-box {
  background: #f8faff; border: 1px solid var(--line); border-radius: 16px;
  padding: 12px; margin-bottom: 14px;
}
.manual-embed-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 8px; font-size: 13px;
}
.manual-embed-frame {
  position: relative; width: 100%; padding-top: 60%;  /* 5:3 비율 슬라이드 */
  border-radius: 12px; overflow: hidden; background: #0f172a;
}
.manual-embed-frame iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  border: 0;
}
.manual-summary h4 { margin: 18px 0 8px; font-size: 14px; }
.manual-steps      { margin: 0; padding-left: 18px; display: grid; gap: 8px; color: #334155; font-size: 13px; line-height: 1.55; }
.manual-list       { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.manual-code {
  display: block; padding: 10px 14px; border-radius: 12px;
  background: #0f172a; color: #dbeafe; font-size: 12px; word-break: break-all;
}
.manual-faq {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-top: 8px; font-size: 13px;
}
.manual-faq summary { cursor: pointer; font-weight: 600; color: #0f172a; }
.manual-faq p       { margin: 8px 0 0; color: #475569; line-height: 1.55; }

/* ── 개발모드 ──────────────────────────────────────────────────────── */
.dev-mode-banner {
  position: sticky; top: 0; z-index: 1000;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
  color: #fff; text-align: center;
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  letter-spacing: .03em;
}
body.is-dev-mode .phone-frame { box-shadow: 0 0 0 3px rgba(239,68,68,.5), 0 35px 90px rgba(15,23,39,.35); }
.dev-mode-group { background: #fff7ed; border: 1px dashed #fdba74; border-radius: 14px; padding: 12px 14px; }
.dev-toggle { display: flex; align-items: center; gap: 8px; margin: 10px 0; cursor: pointer; }
.dev-toggle input { width: 18px; height: 18px; }
.dev-toggle-label { font-weight: 600; color: #c2410c; }
.dev-tools-box { display: grid; gap: 8px; margin-top: 10px; }
.dev-sample-row { display: grid; gap: 4px; margin-top: 8px; }
.dev-sample-line { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: center; }
.dev-sample-line select { min-height: 40px; }
.dev-sample-line .secondary-btn { min-height: 40px; padding: 0 14px; font-size: 12px; }

/* ── 탭바: 5개 컬럼 ─────────────────────────────────────────────── */
.tab-bar.tab-bar-5 { grid-template-columns: repeat(5, 1fr); }

/* ── 반응형 ──────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .phone-stage   { order: 1; }
}
@media (max-width: 520px) {
  .app-shell   { width: calc(100% - 16px); padding-top: 10px; gap: 14px; }
  .phone-frame { width:100%; min-height:auto; padding:10px; border-radius:26px; }
  .screen      { min-height:auto; padding:18px 12px 0; border-radius:20px; }
  .screen-card { min-height:auto; }
  .form-grid, .time-grid, .live-card, .finish-summary { grid-template-columns: 1fr; }
  .form-grid label.full-col { grid-column: 1; }
  .topbar h2   { font-size: 19px; }
  .action-group.three-col { flex-wrap: wrap; }
  .action-group.three-col > * { min-width: calc(50% - 5px); }
}


/* ── 구역실적(zone) 작업진행 카드 — 8종 인라인 입력 ──────────
   컨베이어 작업 — 조원 전체가 한 작업. 개별 양품/불량 분배 없이
   조 단위로 8종(생산/불량/폐기/QA/QC/반제품/샘플/외주) 인라인 입력. */
.zone-input-block {
  margin: 12px 0;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff7e6 0%, #fff3d4 100%);
  border: 1.5px dashed #f59e0b;
  border-radius: 10px;
}
.zone-input-block .zb-title {
  font-weight: 700;
  color: #b45309;
  font-size: 14px;
  margin-bottom: 6px;
}
.zone-input-block .zb-members {
  padding: 6px 0 10px;
  border-bottom: 1px dashed #f5d39a;
  margin-bottom: 10px;
  font-size: 13px;
  color: #5b3d10;
  word-break: keep-all;
  line-height: 1.6;
}
.zone-input-block .zone-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
.zone-input-block .zone-fld-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  color: #5b3d10;
  font-weight: 600;
}
.zone-input-block .zone-fld-row input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #e5c889;
  border-radius: 8px;
  font-size: 15px;
  background: #fff;
}
.zone-input-block .zone-fld-row input:focus {
  outline: 2px solid #f59e0b;
  border-color: #f59e0b;
}
.zone-input-block .zone-fld-row input:disabled {
  background: #faf5e9;
  color: #92400e;
}
.zone-input-block .zb-hint {
  margin-top: 10px;
  color: #92400e;
}

@media (max-width: 520px) {
  .zone-input-block .zone-form-grid { grid-template-columns: 1fr; }
}

