/* 레이아웃: 휴대폰 한 화면 앱. 상단 내비 + 스크롤 본문 + 하단 탭바, iOS 그룹 리스트 구조 */
:root {
  --bg: #F2F2F7;
  --surface: #FFFFFF;
  --fill: rgba(118,118,128,.12);
  --label: #1C1C1E;
  --label2: #6C6C70;
  --label3: #AEAEB2;
  --sep: rgba(60,60,67,.16);
  --accent: #007AFF;
  --accent-soft: rgba(0,122,255,.10);
  --warn: #B25600;
  --warn-soft: rgba(255,149,0,.16);
  --danger: #D70015;
  --ok: #1F7A36;
  --ok-dot: #34C759;
  --vf: #121316;
  --vf-line: rgba(255,255,255,.85);
  --bar: rgba(249,249,251,.86);
  --shadow: 0 10px 30px rgba(0,0,0,.12);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;
  --r: 12px;
  /* 글자 크기 단계 — 화면 전체가 이 9단계만 씀 */
  --fs-2xs: 11px;   /* 탭 이름 */
  --fs-xs: 12px;    /* 꼬리표·배지·보조 숫자 */
  --fs-sm: 13px;    /* 설명·시각·안내 */
  --fs-md: 15px;    /* 보조 본문·버튼 글자 */
  --fs-body: 16px;  /* 본문·입력칸 */
  --fs-lg: 17px;    /* 창 제목·주요 버튼 */
  --fs-xl: 20px;    /* 목록 수량·소제목 숫자 */
  --fs-2xl: 24px;   /* 결과 제목·위치 코드 */
  --fs-3xl: 28px;   /* 화면 큰 제목·보조 재고 숫자 */
  --fs-hero: 48px;  /* 대표 재고 숫자 */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000; --surface: #1C1C1E; --fill: rgba(118,118,128,.24);
    --label: #F2F2F7; --label2: #98989F; --label3: #5A5A5E; --sep: rgba(84,84,88,.6);
    --accent: #0A84FF; --accent-soft: rgba(10,132,255,.18);
    --warn: #FF9F0A; --warn-soft: rgba(255,159,10,.18); --danger: #FF453A;
    --ok: #30D158; --ok-dot: #30D158; --vf: #1C1C1E; --bar: rgba(22,22,24,.86);
    --shadow: 0 10px 30px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #000000; --surface: #1C1C1E; --fill: rgba(118,118,128,.24);
  --label: #F2F2F7; --label2: #98989F; --label3: #5A5A5E; --sep: rgba(84,84,88,.6);
  --accent: #0A84FF; --accent-soft: rgba(10,132,255,.18);
  --warn: #FF9F0A; --warn-soft: rgba(255,159,10,.18); --danger: #FF453A;
  --ok: #30D158; --ok-dot: #30D158; --vf: #1C1C1E; --bar: rgba(22,22,24,.86);
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overscroll-behavior-y: none; }   /* 화면을 끌어내려도 새로고침되지 않게 (창·빈 곳 포함) */
/* 화면 확대·축소 막기: 두 번 눌러 확대 안 됨 (손가락 벌리기는 index.html viewport 에서 막음) */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--label); font: var(--fs-body)/1.45 var(--font); letter-spacing: -0.01em; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.app { position: relative; height: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
@media (min-width: 480px) { .app { border-inline: 1px solid var(--sep); } }

/* 내비게이션 바 */
.nav { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: calc(44px + env(safe-area-inset-top, 0px)); padding-top: env(safe-area-inset-top, 0px); padding-inline: 8px; background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 0.5px solid transparent; z-index: 5; }
.nav.scrolled { border-bottom-color: var(--sep); }
.nav-back { display: inline-flex; align-items: center; gap: 2px; color: var(--accent); font-size: var(--fs-lg); height: 44px; padding-right: 8px; justify-self: start; }
.nav-back svg { width: 12px; height: 20px; }
.nav-title { font-size: var(--fs-lg); font-weight: 600; opacity: 0; transition: opacity .15s; white-space: nowrap; }
.nav.scrolled .nav-title { opacity: 1; }
.nav-action { justify-self: end; color: var(--accent); font-size: var(--fs-lg); padding-inline: 8px; height: 44px; }

.content { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px 32px; }
.large { font-size: var(--fs-3xl); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; margin: 2px 0 2px; text-wrap: balance; }
.large.mono { font-family: var(--mono); font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -0.01em; }
.meta { margin: 0 0 18px; color: var(--label2); font-size: var(--fs-md); }

.section-label { margin: 24px 16px 6px; font-size: var(--fs-sm); color: var(--label2); text-transform: none; }
.footnote { margin: 8px 16px 0; font-size: var(--fs-sm); color: var(--label2); line-height: 1.45; }

/* 그룹 리스트 */
.group { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; position: relative; width: 100%; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
button.row:active, .row-btn:active { background: var(--fill); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-size: var(--fs-body); }
.row-sub { font-size: var(--fs-sm); color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-value { color: var(--label2); font-size: var(--fs-body); text-align: right; }
.chev { width: 8px; height: 13px; color: var(--label3); flex: none; }
.mono-loc { font-family: var(--mono); letter-spacing: 0; }
.pn { font-family: var(--mono); font-size: var(--fs-md); letter-spacing: 0; }
.qty { font-variant-numeric: tabular-nums; font-size: var(--fs-xl); font-weight: 600; text-align: right; min-width: 44px; }
.qty small { font-size: var(--fs-xs); font-weight: 500; color: var(--label2); margin-left: 2px; }
.row-link { color: var(--accent); }
.row-danger { color: var(--danger); }

/* 위치 목록 행: 본문 버튼 + 체크 버튼 */
.prow { display: flex; align-items: stretch; position: relative; }
.prow + .prow::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 0.5px solid var(--sep); }
.prow .row-btn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 10px 4px 10px 16px; }
.check { flex: none; width: 52px; display: grid; place-items: center; }
.check i { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--label3); display: grid; place-items: center; }
.check.on i { background: var(--warn); border-color: var(--warn); }
.check.on i::after { content: ""; width: 10px; height: 2px; background: var(--surface); border-radius: 1px; }
.diff-note { font-size: var(--fs-xs); color: var(--warn); font-weight: 600; font-variant-numeric: tabular-nums; }

/* 스캔 화면 */
.viewfinder { position: relative; height: 150px; border-radius: 18px; background: var(--vf); overflow: hidden; display: grid; place-items: center; }
.vf-frame { position: relative; width: 78%; height: 64px; }
.vf-frame span { position: absolute; width: 22px; height: 22px; border: 3px solid var(--vf-line); }
.vf-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.vf-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.vf-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.vf-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }
.vf-line { position: absolute; left: 8%; right: 8%; top: 50%; height: 2px; background: #FF3B30; opacity: .9; border-radius: 1px; }
@media (prefers-reduced-motion: no-preference) { .vf-line { animation: pulse 1.6s ease-in-out infinite; } }
@keyframes pulse { 50% { opacity: .35; } }
.vf-caption { position: absolute; bottom: 10px; left: 0; right: 0; text-align: center; font-size: var(--fs-sm); color: rgba(255,255,255,.72); }
.vf-mode { position: absolute; top: 12px; left: 12px; display: flex; background: rgba(255,255,255,.14); border-radius: 9px; padding: 2px; }
.vf-mode button { color: rgba(255,255,255,.8); font-size: var(--fs-sm); padding: 5px 10px; border-radius: 7px; }
.vf-mode button.on { background: rgba(255,255,255,.92); color: #000; font-weight: 600; }
.vf-flash { position: absolute; inset: 0; background: rgba(255,255,255,.0); transition: background .25s; pointer-events: none; }
.vf-flash.go { background: rgba(255,255,255,.35); transition: none; }

.status { display: flex; align-items: center; gap: 8px; margin: 12px 4px 0; font-size: var(--fs-sm); color: var(--label2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); flex: none; }

.search { display: flex; align-items: center; gap: 8px; margin-top: 14px; height: 40px; padding-inline: 10px; background: var(--fill); border-radius: 10px; }
.search svg { width: 16px; height: 16px; color: var(--label2); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: var(--fs-body); }
.search input::placeholder { color: var(--label2); }
.search button { color: var(--accent); font-size: var(--fs-md); font-weight: 600; padding: 6px 2px; }

.tag { display: inline-flex; align-items: center; height: 22px; padding-inline: 8px; border-radius: 6px; font-size: var(--fs-xs); font-weight: 600; background: var(--fill); color: var(--label2); flex: none; }
.tag.loc { background: var(--accent-soft); color: var(--accent); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }

/* 위치 요약 */
.summary { display: flex; gap: 24px; margin: 0 4px 16px; }
.summary div { display: flex; flex-direction: column; }
.summary b { font-size: var(--fs-xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.summary span { font-size: var(--fs-sm); color: var(--label2); }
.summary .w b { color: var(--warn); }

.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--fill); border-radius: 9px; padding: 2px; margin: 10px 0 14px; }
.seg button { font-size: var(--fs-sm); padding: 6px 0; border-radius: 7px; text-align: center; color: var(--label); }
.seg button.on { background: var(--surface); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }

/* 부품 재고 */
.stock { display: grid; grid-template-columns: 1.55fr 1fr; gap: 10px; }
.stock > .tile:first-child { grid-row: span 2; }   /* 지점 현재고 왼쪽 크게, 오른쪽에 RR·RDC */
.tile { background: var(--surface); border-radius: var(--r); padding: 14px 16px 14px; display: flex; flex-direction: column; min-width: 0; }
.tile-label { font-size: var(--fs-sm); color: var(--label2); }
.tile-num { font-size: var(--fs-hero); line-height: 1.05; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tile-num small { font-size: var(--fs-lg); font-weight: 500; color: var(--label2); margin-left: 4px; letter-spacing: 0; }
.tile-num.zero { color: var(--label3); }
.tile .tag { margin-top: 10px; align-self: flex-start; }
.tile.rdc .tile-num { font-size: var(--fs-3xl); margin-top: 10px; font-weight: 600; }
.tile-foot { margin-top: auto; padding-top: 10px; font-size: var(--fs-xs); color: var(--label2); }
.shimmer { height: 30px; margin-top: 12px; width: 60%; border-radius: 6px; background: var(--fill); }
@media (prefers-reduced-motion: no-preference) { .shimmer { animation: pulse 1s ease-in-out infinite; } }

.banner { display: flex; gap: 10px; align-items: center; margin-top: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-md); font-weight: 500; }

/* 체크 기록 */
.diff { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.diff b { font-size: var(--fs-body); font-weight: 600; }
.empty { text-align: center; padding: 48px 24px; color: var(--label2); font-size: var(--fs-md); }
.btn-secondary { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding-inline: 14px; border-radius: 17px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-md); font-weight: 600; }

/* 스위치 */
.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 16px; background: var(--fill); transition: background .2s; pointer-events: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + i { background: var(--ok-dot); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 탭바 */
.tabbar { flex: none; display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px)); background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 0.5px solid var(--sep); z-index: 5; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: var(--fs-2xs); font-weight: 500; color: var(--label3); position: relative; padding-top: 2px; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--accent); }
.badge { position: absolute; top: -2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding-inline: 5px; border-radius: 9px; background: #FF3B30; color: #fff; font-size: var(--fs-xs); font-weight: 600; display: grid; place-items: center; }

/* 시트 */
.backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.32); z-index: 20; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--bg); border-radius: 14px 14px 0 0; padding: 6px 16px calc(20px + env(safe-area-inset-bottom, 0px)); box-shadow: var(--shadow); max-height: 88%; overflow-y: auto; overscroll-behavior: contain; }
@media (prefers-reduced-motion: no-preference) { .sheet { animation: up .28s cubic-bezier(.2,.8,.2,1); } }
@keyframes up { from { transform: translateY(100%); } }
.grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label3); margin: 0 auto 6px; opacity: .6; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 44px; }
.sheet-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.sheet-head .cancel { color: var(--accent); font-size: var(--fs-lg); justify-self: start; }
.sheet-sub { text-align: center; color: var(--label2); font-size: var(--fs-md); margin: 0 0 16px; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.stepper-ctl { display: flex; align-items: center; gap: 4px; }
.stepper-ctl button { width: 44px; height: 36px; border-radius: 9px; background: var(--fill); font-size: var(--fs-xl); line-height: 1; display: grid; place-items: center; }
.stepper-ctl input { width: 64px; height: 36px; text-align: center; border: 0; background: transparent; font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; outline: none; }
.field { width: 100%; border: 0; background: transparent; outline: none; font-size: var(--fs-body); padding: 0; resize: none; }
.btn-primary { display: block; width: 100%; height: 50px; border-radius: 12px; background: var(--accent); color: #fff; font-size: var(--fs-lg); font-weight: 600; text-align: center; margin-top: 20px; }
.btn-primary:disabled { opacity: .4; }
.btn-plain { display: block; width: 100%; height: 44px; color: var(--danger); font-size: var(--fs-body); text-align: center; margin-top: 6px; }

/* 토스트 */
.toast { position: absolute; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: flex; justify-content: center; pointer-events: none; }
.toast div { background: rgba(28,28,30,.92); color: #fff; font-size: var(--fs-sm); padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); max-width: 100%; }
/* 스캔 영역은 위에 고정, 결과는 아래에서 바로 확인 */
.scanner { position: sticky; top: 0; z-index: 3; background: var(--bg); margin-inline: -16px; padding: 8px 16px 12px; }
.scanner .search { margin-top: 8px; }
.viewfinder.bt { height: 56px; display: flex; align-items: center; justify-content: space-between; padding-inline: 14px 8px; }
.viewfinder.bt .vf-mode { position: static; }
.bt-line { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.88); font-size: var(--fs-md); }
.nav-title.always { opacity: 1; }
.nav-meta { justify-self: end; font-size: var(--fs-sm); color: var(--label2); padding-right: 8px; font-variant-numeric: tabular-nums; }
.rhead { display: flex; align-items: flex-start; gap: 10px; margin-top: 4px; }
.rhead .rmain { flex: 1; min-width: 0; }
.rtitle { margin: 0; font-size: var(--fs-2xl); line-height: 1.2; font-weight: 700; letter-spacing: -0.01em; }
.rtitle.mono { font-family: var(--mono); font-weight: 600; letter-spacing: 0; }
.rback { display: inline-flex; align-items: center; gap: 4px; height: 30px; color: var(--accent); font-size: var(--fs-md); }
.rback svg { width: 9px; height: 15px; }
.rclose { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--fill); color: var(--label2); display: grid; place-items: center; margin-top: 2px; }
.rclose svg { width: 12px; height: 12px; }
.divider { display: flex; align-items: center; gap: 8px; margin: 4px 4px 10px; font-size: var(--fs-sm); color: var(--label2); }
.divider::after { content: ""; flex: 1; border-top: 0.5px solid var(--sep); }
.idle { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 48px 24px 8px; color: var(--label2); }
.idle svg { width: 48px; height: 48px; color: var(--label3); margin-bottom: 14px; }
.idle-title { margin: 0; font-size: var(--fs-lg); font-weight: 600; color: var(--label); }
.idle-sub { margin: 4px 0 0; font-size: var(--fs-md); }
.banner.info { background: var(--accent-soft); color: var(--accent); }
.banner.ok { background: var(--fill); color: var(--ok); }
.spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; flex: none; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin .8s linear infinite; } }
@keyframes spin { to { transform: rotate(360deg); } }
/* 재고조사 */
.acards { display: flex; flex-direction: column; gap: 12px; }
.stale { margin: 12px 0; padding: 12px 14px; border-radius: var(--r); background: var(--warn-soft); }
.stale-h { font-size: var(--fs-md); font-weight: 600; color: var(--warn); margin-bottom: 6px; }
.stale-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.stale-row .row-main { flex: 1; min-width: 0; }
.stale-t { font-size: var(--fs-md); font-weight: 600; }
.stale .footnote { margin: 6px 0 0; }
.acard { display: flex; flex-direction: column; gap: 10px; width: 100%; background: var(--surface); border-radius: var(--r); padding: 14px 16px; }
.acard:active { background: var(--fill); }
.acard-top { display: flex; align-items: center; gap: 10px; }
.acard-title { font-size: var(--fs-lg); font-weight: 600; }
.acard-foot { font-size: var(--fs-sm); color: var(--label2); font-variant-numeric: tabular-nums; }
.pill { flex: none; display: inline-flex; align-items: center; height: 22px; padding-inline: 8px; border-radius: 11px; font-size: var(--fs-xs); font-weight: 600; background: var(--fill); color: var(--label2); font-variant-numeric: tabular-nums; }
.pill.ok { color: var(--ok); }
.pill.run { background: var(--accent-soft); color: var(--accent); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.warn-text { color: var(--warn); }
.pbar { height: 6px; border-radius: 3px; background: var(--fill); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.aprog { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.aprog-nums { font-size: var(--fs-md); color: var(--label2); font-variant-numeric: tabular-nums; }
.aprog-nums b { font-size: var(--fs-xl); color: var(--label); }
.row.done .pn, .row.done .row-sub { color: var(--label3); }
.row:disabled { cursor: default; }
.locchip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-md); }
.locchip button { width: 28px; height: 28px; display: grid; place-items: center; color: var(--accent); }
.locchip svg { width: 11px; height: 11px; }
.bigqty { display: flex; align-items: baseline; justify-content: center; gap: 6px; padding: 8px 0 4px; }
.bigqty span { font-size: var(--fs-md); color: var(--label2); margin-right: 6px; }
.bigqty b { font-size: var(--fs-hero); line-height: 1; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.bigqty small { font-size: var(--fs-lg); color: var(--label2); }
.btn-ghost { display: block; width: 100%; height: 50px; border-radius: 12px; background: var(--fill); color: var(--label); font-size: var(--fs-lg); font-weight: 600; text-align: center; margin-top: 10px; }
.tab { font-size: var(--fs-2xs); }
.peers { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--fill); font-size: var(--fs-sm); color: var(--label2); }
.peers b { color: var(--label); font-weight: 600; }
.peers span { display: inline-flex; align-items: center; gap: 5px; }
.peers .mono-loc { font-style: normal; font-size: var(--fs-xs); color: var(--accent); }
.peer-tag { margin: 0 auto 0 10px; padding: 1px 9px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); font-weight: 600; }
.peer { margin: 10px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); font-weight: 600; }
.peer.warn { background: var(--warn-soft); color: var(--warn); }
#aPeer:empty { display: none; }
.loc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 22px 4px 8px; }
.loc-head .mono-loc { font-size: var(--fs-xl); font-weight: 700; color: var(--label); }
.loc-head span:last-child { font-size: var(--fs-sm); color: var(--label2); }
.sheet-loc { text-align: center; font-size: var(--fs-xl); font-weight: 700; color: var(--accent); margin: 2px 0 0; }
/* 확인 창의 품번: 위치와 함께 가장 중요한 정보라 크게 */
.sheet-pn { text-align: center; font-family: var(--mono); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: 0.02em; color: var(--label); margin: 2px 0 2px; word-break: break-all; }
.loc-btn { margin-top: 10px; align-self: flex-start; display: inline-flex; align-items: baseline; gap: 6px; padding: 6px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-md); }
.loc-btn b { font-size: var(--fs-xl); font-weight: 700; }

/* ---------- 실제 앱 추가분 ---------- */
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder .vf-frame, .viewfinder .vf-line, .viewfinder .vf-caption, .viewfinder .vf-mode { z-index: 1; }
.vf-off { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.8); font-size: var(--fs-sm); text-align: center; padding: 0 24px; z-index: 1; }
.vf-off button { margin-top: 10px; color: #fff; background: rgba(255,255,255,.16); padding: 8px 14px; border-radius: 9px; font-size: var(--fs-sm); font-weight: 600; }

.login { min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 32px 4px 48px; }
.login h1 { font-size: var(--fs-3xl); margin: 0 0 4px; letter-spacing: -0.02em; }
.login p.meta { margin-bottom: 24px; }
.login .group .row input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: var(--fs-body); }
.login .row label { width: 72px; flex: none; color: var(--label); }
.login-error { color: var(--danger); font-size: var(--fs-md); margin: 10px 4px 0; min-height: 20px; }

.notice { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 10px; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: var(--fs-sm); line-height: 1.4; }
.loading { text-align: center; color: var(--label2); padding: 48px 0; font-size: var(--fs-md); }
.btn-inline { color: var(--accent); font-weight: 600; font-size: var(--fs-md); padding: 6px 0; }
.rdc-err { font-size: var(--fs-sm); color: var(--danger); margin-top: 10px; }

/* 카메라 도구: 플래시·줌, 초점 표시 */
.viewfinder video { transform-origin: 50% 50%; }
.vf-tools { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 6px; }
.vf-tool { color: rgba(255,255,255,.9); background: rgba(255,255,255,.16); font-size: var(--fs-sm); font-weight: 600; padding: 5px 10px; border-radius: 9px; min-width: 36px; text-align: center; }
#torchBtn.on { background: #FFD60A; color: #000; }
.focus-ring { position: absolute; z-index: 2; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid #FFD60A; border-radius: 8px; pointer-events: none; }
@media (prefers-reduced-motion: no-preference) { .focus-ring { animation: focusring .9s ease-out forwards; } }
@keyframes focusring { 0% { transform: scale(1.4); opacity: 0; } 25% { transform: scale(1); opacity: 1; } 100% { opacity: 0; } }

/* 카메라 v2 (태블릿 앱 방식): 화면 약 35% 높이, 안내 칸은 카메라 그림 좌표에 맞춰 배치 */
.viewfinder.cam { height: clamp(220px, 35vh, 340px); }
.viewfinder.cam .vf-frame { position: absolute; z-index: 1; }
.viewfinder.cam .vf-frame span { width: 18px; height: 18px; }
#camFreeze { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.viewfinder.cam .vf-caption { z-index: 3; left: 12px; right: 12px; bottom: 10px; padding: 6px 10px; border-radius: 10px; background: rgba(0,0,0,.5); color: rgba(255,255,255,.92); }
.viewfinder.cam .vf-caption.ok { background: rgba(48,209,88,.92); color: #04210D; font-weight: 600; }
.viewfinder.cam .vf-mode, .viewfinder.cam .vf-tools { z-index: 3; }
.vf-zooms { display: flex; gap: 2px; background: rgba(0,0,0,.4); border-radius: 10px; padding: 2px; }
.vf-tool.on { background: #fff; color: #000; }
.vf-tool.on.torch { background: #FFD60A; }
.vf-flash { z-index: 4; }
.vf-tool.photo { background: #fff; color: #000; }
.viewfinder.cam .vf-tools { flex-wrap: wrap; justify-content: flex-end; max-width: calc(100% - 140px); }
.rdc-btn { margin-top: 12px; align-self: flex-start; }
.tile-foot .btn-inline { font-size: var(--fs-xs); padding: 0; }

/* 알림: 위쪽 상단 바 아래, 작게, 누르면 닫힘 (아래 결과를 가리지 않게) */
.toast { top: calc(50px + env(safe-area-inset-top, 0px)); bottom: auto; left: 50%; right: auto; transform: translateX(-50%); width: max-content; max-width: calc(100% - 32px); pointer-events: auto; }
.toast div { font-size: var(--fs-sm); padding: 7px 12px; border-radius: 16px; background: rgba(28,28,30,.86); line-height: 1.35; }
.toast.err div { background: var(--danger); }
/* 위치 변경 진행 표시 (모든 탭 상단) */
.movebar { flex: none; display: flex; align-items: center; gap: 8px; width: 100%; min-height: 34px; padding: 6px 16px; font-size: var(--fs-sm); font-weight: 500; text-align: left; background: var(--accent-soft); color: var(--accent); z-index: 4; }
.movebar.ok { background: var(--fill); color: var(--ok); }
.movebar.err { background: rgba(215,0,21,.10); color: var(--danger); }
.movebar .mb-text { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.movebar b { font-weight: 600; font-variant-numeric: tabular-nums; }
.movebar .mb-more { flex: none; opacity: .75; }
/* hidden 속성은 항상 숨김 (display 를 지정한 버튼·배지도) */
[hidden] { display: none !important; }
.app:has(.movebar:not([hidden])) .toast { top: calc(88px + env(safe-area-inset-top, 0px)); }

/* 재고조사 보고서 미리보기 (시트는 report.js 의 A4 양식) */
.reportview { position: absolute; inset: 0; z-index: 25; display: flex; flex-direction: column; background: #3b3f46; }
.rv-bar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: calc(48px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 12px 0; background: #1f2329; color: #fff; }
.rv-bar b { font-size: var(--fs-lg); }
.rv-close { justify-self: start; color: #8ab4ff; font-size: var(--fs-lg); }
.rv-n { justify-self: end; font-size: var(--fs-sm); color: rgba(255,255,255,.7); }
.rv-scroll { flex: 1; overflow: auto; padding: 12px; }
.rv-pages .rp-page { margin: 0 auto 12px; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.rv-panel { flex: none; background: var(--bg); border-radius: 14px 14px 0 0; padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }
.rv-name { display: flex; align-items: center; background: var(--surface); border-radius: 10px; padding: 0 12px; }
.rv-name input { flex: 1; min-width: 0; height: 44px; border: 0; background: transparent; color: var(--label); font-size: var(--fs-body); outline: none; }
.rv-name span { color: var(--label2); }
.rv-state { margin: 8px 2px 0; font-size: var(--fs-sm); color: var(--label2); }
.rv-state.err { color: var(--danger); }
.rv-chrome { display: flex; align-items: center; justify-content: center; margin-top: 8px; text-decoration: none; }
.rr-split { color: var(--accent); font-variant-numeric: tabular-nums; }

/* 재고조사 제목 옆 작은 버튼 (DMS 갱신) — 제목 줄 높이 안에서 */
.rtitle-row { display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; }
.rtitle-row .rtitle { min-width: 0; }
.title-btn { flex: none; display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 10px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.title-btn svg { width: 13px; height: 13px; }
.title-btn:disabled { opacity: .6; }
@media (prefers-reduced-motion: no-preference) { .title-btn.busy svg { animation: spin .8s linear infinite; } }
/* 검색칸 부분 일치 목록 (검색칸 바로 아래에 겹쳐 펼침) */
.suggest { position: absolute; left: 16px; right: 16px; top: calc(100% - 6px); z-index: 20; max-height: min(55vh, 440px); overflow-y: auto; overscroll-behavior: contain; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow); }
.suggest[hidden] { display: none; }
.sug-head { padding: 9px 14px 6px; font-size: var(--fs-xs); color: var(--label2); }
.sug { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 8px 14px; text-align: left; }
.sug + .sug::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; border-top: 0.5px solid var(--sep); }
.sug:active { background: var(--fill); }
.sug.done { opacity: .55; }
.sug-main { flex: 1; min-width: 0; }
.sug-code { font-size: var(--fs-body); font-weight: 600; }
.sug-code mark { background: var(--accent-soft); color: var(--accent); border-radius: 3px; padding: 0 1px; }
.sug-sub { font-size: var(--fs-sm); color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug-qty { flex: none; font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.sug-qty small { font-size: var(--fs-xs); font-weight: 500; color: var(--label2); margin-left: 2px; }
/* 일일장기 이월 표시 (품번 옆 작은 꼬리표) */
.tag.carry { height: 18px; padding-inline: 6px; margin-left: 6px; vertical-align: 2px; font-family: var(--font); letter-spacing: 0; }

/* 부품별 마지막 재고조사 (참고용, 작게) */
.lastaudit { margin-top: auto; padding-top: 12px; font-size: var(--fs-xs); line-height: 1.45; color: var(--label2); font-variant-numeric: tabular-nums; }
.lastaudit .la-head { color: var(--label3); }
.lastaudit .la-memo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lastaudit-line { text-align: center; margin: 0 0 4px; font-size: var(--fs-xs); color: var(--label2); font-variant-numeric: tabular-nums; }
.la-ok { color: var(--ok); font-weight: 600; }
.la-diff { color: var(--warn); font-weight: 600; }
.la-dim { color: var(--label3); }


/* ---------- 재고 확인 창 (애플 시트 형태) ----------
   크기 단계: 품번 28 / 수량 22 / 버튼 17 / 본문 15 / 보조 13 */
.ai-hero { padding: 6px 4px 16px; }
.ai-loc { display: flex; align-items: center; gap: 4px; font-size: var(--fs-md); font-weight: 600; color: var(--accent); }
.ai-loc svg { width: 14px; height: 14px; flex: none; }
.ai-loc .tag.carry { margin-left: 6px; }
.ai-pn { margin-top: 4px; font-family: var(--mono); font-size: var(--fs-3xl); line-height: 1.15; font-weight: 700; letter-spacing: 0.01em; color: var(--label); word-break: break-all; }
.ai-nm { margin-top: 4px; font-size: var(--fs-md); color: var(--label2); }
.ai-last { text-align: left; margin: 6px 0 0; font-size: var(--fs-sm); color: var(--label3); font-variant-numeric: tabular-nums; }
.ai-last .la-ok, .ai-last .la-diff { font-weight: 500; }
.ai-card { overflow: hidden; }
.ai-row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; }
.ai-card .ai-row + .ai-row, .ai-card > .ai-row + #aNow > .ai-row:first-child { border-top: 0.5px solid var(--sep); }
.ai-l .ai-when { margin-left: 6px; font-size: var(--fs-sm); color: var(--label3); font-variant-numeric: tabular-nums; }
.ai-l { flex: 1; min-width: 0; font-size: var(--fs-md); color: var(--label); }
.ai-l small { display: block; margin-top: 2px; font-size: var(--fs-sm); color: var(--label2); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-v { flex: none; font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.ai-v small { margin-left: 3px; font-size: var(--fs-sm); font-weight: 400; color: var(--label2); }
.ai-v.warn { color: var(--warn); }
.ai-refresh { flex: none; width: 32px; height: 32px; margin-right: -6px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); }
.ai-refresh svg { width: 17px; height: 17px; }
.ai-refresh:active { background: var(--fill); }
.ai-card > #aNow + #aMove > .ai-row { border-top: 0.5px solid var(--sep); }
.ai-moved { min-height: 44px; padding-block: 8px; font-size: var(--fs-sm); color: var(--warn); justify-content: space-between; }
.ai-moved.ok { color: var(--ok); }
.ai-moved span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: inline-flex; align-items: center; gap: 4px; }
.ai-moved svg, .ai-done svg { width: 13px; height: 13px; flex: none; }
.ai-moved .ai-link { font-size: var(--fs-sm); }
.ai-link { flex: none; color: var(--accent); font-size: var(--fs-md); font-weight: 600; padding: 4px 0; }
.ai-row .spin { display: inline-block; vertical-align: -2px; }
.ai-foot { margin: 8px 16px 0; font-size: var(--fs-sm); }
.ai-status { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 14px 0 0; font-size: var(--fs-sm); text-align: center; font-variant-numeric: tabular-nums; }
.ai-status .proof-line { margin: 0; color: var(--label2); font-size: var(--fs-sm); }
.ai-done { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.ai-done.warn { color: var(--warn); }
.ai-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.ai-actions .btn-primary, .ai-actions .btn-ghost { margin: 0; }
.ai-diff { margin-top: 16px; }
#aDiffBox .btn-primary { margin-top: 12px; }
.ai-lock { margin-top: 16px; padding: 18px 16px 12px; border-radius: var(--r); background: var(--surface); text-align: center; }
.ai-lock-t { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-lg); font-weight: 600; color: var(--label); }
.ai-lock-t svg { width: 16px; height: 16px; color: var(--label2); }
.ai-lock-s { margin-top: 4px; font-size: var(--fs-sm); color: var(--label2); }
.ai-lock .ai-link { margin-top: 8px; font-size: var(--fs-sm); font-weight: 500; }
.ai-exempt { margin-top: 10px; background: var(--bg); text-align: left; }
.ai-lock .btn-ghost { margin-top: 10px; }

/* 알림 속 되돌리기 */
/* 되돌리기 남은 시간 막대 (5초 동안 줄어듦) */
#toastText { position: relative; overflow: hidden; }
.toast-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: #64D2FF; transform-origin: left; animation: tbar 5s linear forwards; }
@keyframes tbar { to { transform: scaleX(0); } }
/* 값이 바뀐 칸 한 번 강조 · 확인해서 목록에서 빠지는 줄 */
@media (prefers-reduced-motion: no-preference) { .flash { animation: flash 1s ease-out; border-radius: 6px; } }
@keyframes flash { from { background-color: var(--accent-soft); box-shadow: 0 0 0 4px var(--accent-soft); } }
.row.leaving { overflow: hidden; pointer-events: none; }
.toast-undo { white-space: nowrap; margin-left: 12px; padding: 2px 0; color: #64D2FF; font-weight: 600; font-size: inherit; }

/* 재고 확인 창 버튼: 창 맨 아래 고정 (엄지로 바로) */
.ai-dock { position: sticky; bottom: calc(-20px - env(safe-area-inset-bottom, 0px)); z-index: 2; margin: 16px -16px calc(-20px - env(safe-area-inset-bottom, 0px)); padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--bar); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-top: 0.5px solid var(--sep); }
.ai-dock .ai-actions { margin-top: 0; }
.ai-dock #aDiffSave { margin-top: 0; }
#aDiffBox .ai-diff { margin-top: 16px; }

/* 위치 완료 */
.done-wrap { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 18px 0 20px; }
.done-ic { width: 56px; height: 56px; color: var(--ok-dot); }
@media (prefers-reduced-motion: no-preference) { .done-ic { animation: pop .35s cubic-bezier(.2,1.4,.4,1); } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.done-t { margin: 14px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.done-s { margin: 4px 0 0; font-size: var(--fs-md); color: var(--label2); }
.ai-v.mono-loc { font-family: var(--mono); font-size: var(--fs-lg); font-weight: 600; }

/* 연결 상태 (상단 왼쪽) */
.netpill { justify-self: start; display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 8px; margin-left: 2px; border-radius: 14px; font-size: var(--fs-xs); font-weight: 600; font-variant-numeric: tabular-nums; }
.netpill i { width: 8px; height: 8px; border-radius: 50%; background: var(--ok-dot); flex: none; }
.netpill.ok { padding-right: 8px; }
.netpill.wait, .netpill.dms { background: var(--warn-soft); color: var(--warn); }
.netpill.wait i, .netpill.dms i { background: #FF9500; }
.netpill.off { background: rgba(255,59,48,.12); color: var(--danger); }
.netpill.off i { background: #FF3B30; }
/* 긴 재고조사 목록: 화면 밖 위치 묶음은 그리기를 미룸 (높이는 app.js 가 줄 수로 넣음) */
.group.cv { content-visibility: auto; }

/* 스캔 탭 재고 일치 (자주 쓰는 버튼) */
.btn-spot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 100%; min-height: 58px; padding: 8px 12px; margin-top: 12px; border-radius: 14px; background: #1F7A36; color: #fff; font-size: var(--fs-lg); font-weight: 700; text-align: center; }
.btn-spot small { font-size: 12px; font-weight: 500; opacity: .85; }
.btn-spot:active { opacity: .8; }
.btn-spot:disabled { opacity: .5; }
.btn-spot.off { background: var(--fill); color: var(--label2); font-weight: 600; }
.btn-spot.done { background: rgba(52,199,89,.16); color: var(--ok); box-shadow: inset 0 0 0 1.5px var(--ok); }
.btn-spot.diff { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1.5px var(--warn); }
/* 부품번호는 길게 눌러 복사 (앱이 직접 복사하므로 기본 글자 선택·메뉴는 끔) */
.pn, .ai-pn, .rtitle.mono { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.movebar.warn { background: var(--warn-soft); color: var(--warn); }
.notice.err-notice { background: rgba(215,0,21,.10); color: var(--danger); align-items: center; }
.notice.err-notice .ai-link { color: var(--danger); text-decoration: underline; min-height: 36px; }
.moved-from { display: inline-block; margin-right: 4px; padding: 0 6px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-xs); font-weight: 600; }

/* ===== 부품 화면: 토스 느낌 (2026-10-20). 이 화면(.tz) 안에서만 적용 ===== */
:root { --tz-bg: #FFFFFF; --tz-text: #191F28; --tz-sub: #4E5968; --tz-mute: #8B95A1; --tz-card: #F2F4F6; --tz-line: #E5E8EB;
  --tz-blue: #3182F6; --tz-blue-soft: #E8F3FF; --tz-blue-text: #1B64DA; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --tz-bg: #17171C; --tz-text: #F9FAFB; --tz-sub: #B0B8C1; --tz-mute: #8B95A1; --tz-card: #26262D;
    --tz-line: #34343C; --tz-blue: #3182F6; --tz-blue-soft: rgba(49,130,246,.18); --tz-blue-text: #6AA8FF; }
}
.tz { background: var(--tz-bg); color: var(--tz-text); margin: 8px -16px -32px; padding: 12px 20px 60px; border-radius: 22px 22px 0 0; }
.tz-top { display: flex; align-items: center; justify-content: space-between; min-height: 30px; }
.tz-top .rclose { margin-left: auto; }
.tz-nm { margin-top: 6px; font-size: var(--fs-md); color: var(--tz-mute); }
.tz .tz-pn { font-family: var(--font); font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; font-variant-numeric: tabular-nums; color: var(--tz-text); }
.tz .stock { display: block; margin-top: 24px; }
.tz .stock > .tile { background: none; padding: 0; border-radius: 0; }
.tz-l { font-size: var(--fs-md); color: var(--tz-sub); }
.tz .tz-hero .tile-num { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; margin-top: 4px; color: var(--tz-text); }
.tz .tz-hero .tile-num small { font-size: 26px; font-weight: 700; color: inherit; margin-left: 2px; letter-spacing: -0.02em; }
.tz .tz-hero .tile-num.zero { color: var(--tz-mute); }
.tz-at { margin-top: 6px; font-size: var(--fs-md); color: var(--tz-sub); display: flex; align-items: center; gap: 0; flex-wrap: wrap; }
.tz .mono-loc { font-family: var(--font); font-variant-numeric: tabular-nums; }
.tz .loc-btn { margin: 0; padding: 0; background: none; border-radius: 4px; color: var(--tz-blue); font-size: var(--fs-md); font-weight: 600; }
.tz .loc-btn b { font-size: var(--fs-md); font-weight: 600; }
/* 현재고와 위치를 좌우로: 현재고가 주인공(48px), 위치는 한 단계 작게(22px). 위치를 누르면 그 위치 화면 */
.tz .tz-hero .tile { display: grid; grid-template-columns: auto 1fr; column-gap: 24px; align-items: end; }
.tz-w { border-left: 1px solid var(--tz-line); padding-left: 22px; padding-bottom: 6px; }
.tz .tz-hero .tz-at { margin-top: 6px; }
.tz .tz-hero .loc-btn b { font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.tz-at-s { display: none; }
.tz-card { background: var(--tz-card); border-radius: 16px; padding: 2px 16px; margin-top: 22px; }
.tz-row { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 12px; padding: 14px 0; }
.tz-row + .tz-row { border-top: 1px solid var(--tz-line); }
.tz-row .tile-label, .tz-row .la-head { font-size: var(--fs-md); color: var(--tz-sub); }
.tz-row .tile-num { grid-column: 2; grid-row: 1; font-size: var(--fs-md); font-weight: 600; margin: 0; letter-spacing: 0; color: var(--tz-text); }
.tz-row .tile-num small { font-size: var(--fs-md); font-weight: 600; color: inherit; margin-left: 1px; }
.tz-row .tile-num.zero { color: var(--tz-mute); }
.tz-row .tile-foot { grid-column: 1 / -1; padding-top: 2px; margin: 0; font-size: var(--fs-sm); color: var(--tz-mute); }
.tz .lastaudit { margin: 0; padding: 14px 0; font-size: var(--fs-sm); color: var(--tz-mute); line-height: 1.45; }
.tz .lastaudit > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
.tz .lastaudit > div:nth-child(3) { grid-column: 2; grid-row: 1; font-size: var(--fs-md); color: var(--tz-text); }
.tz .lastaudit > .la-memo { grid-column: 1 / -1; }
.tz .lastaudit .la-dim { grid-column: 1 / -1; color: var(--tz-mute); }
.tz-actions { display: flex; gap: 8px; margin-top: 20px; align-items: stretch; }
.tz-actions > #moveTile { flex: 1; display: flex; }
.tz-actions > #spotBox { flex: 1.5; display: flex; }
.tz-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 56px; border-radius: 14px; font-size: var(--fs-body); font-weight: 600; }
.tz-btn.sub { background: var(--tz-blue-soft); color: var(--tz-blue-text); }
.tz-btn.busy { font-size: var(--fs-sm); }
.tz .btn-spot { margin-top: 0; min-height: 56px; border-radius: 14px; background: var(--tz-blue); font-size: var(--fs-body); }
.tz .btn-spot small { font-size: 11px; font-weight: 500; }
.tz .btn-spot.off { background: var(--tz-card); color: var(--tz-mute); }
.tz .btn-spot.done { background: var(--tz-blue-soft); color: var(--tz-blue-text); box-shadow: none; }
.tz .banner { margin-top: 14px; border-radius: 12px; }
.tz .section-label { margin: 28px 2px 8px; font-size: var(--fs-lg); font-weight: 700; color: var(--tz-text); }
.tz .group { background: var(--tz-card); border-radius: 16px; }
.tz .row { min-height: 54px; }
.tz .row + .row::before { border-top-color: var(--tz-line); }
.tz .row-main { font-size: var(--fs-md); }
.tz .row-link { color: var(--tz-text); }
.tz .row-value { color: var(--tz-sub); font-size: var(--fs-md); }

/* ===== 앱 전체: 토스 느낌 (2026-10-20) — 흰 바탕 + 연한 회색 카드, 굵은 제목, 큰 버튼, 품번·위치도 본문 글꼴.
   위쪽의 기본값(아이폰 설정 화면 스타일)을 여기서 덮어씀. 어두운 모드도 같은 기준 ===== */
:root {
  --bg: #FFFFFF; --surface: #F2F4F6; --raised: #FFFFFF; --fill: #E9ECEF;
  --label: #191F28; --label2: #4E5968; --label3: #8B95A1; --sep: #E5E8EB;
  --accent: #3182F6; --accent-soft: #E8F3FF; --bar: rgba(255,255,255,.94);
  --shadow: 0 -4px 24px rgba(0,0,0,.08); --r: 16px;
  --tz-bg: var(--bg); --tz-text: var(--label); --tz-sub: var(--label2); --tz-mute: var(--label3); --tz-card: var(--surface); --tz-line: var(--sep);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17171C; --surface: #26262D; --raised: #3A3A44; --fill: #33333B;
    --label: #F9FAFB; --label2: #B0B8C1; --label3: #6B7684; --sep: #34343C;
    --accent: #4593FC; --accent-soft: rgba(49,130,246,.18); --bar: rgba(23,23,28,.94);
    --shadow: 0 -4px 24px rgba(0,0,0,.5);
    --tz-bg: var(--bg); --tz-text: var(--label); --tz-sub: var(--label2); --tz-mute: #8B95A1; --tz-card: var(--surface); --tz-line: var(--sep);
  }
}
:root[data-theme="dark"] {
  --bg: #17171C; --surface: #26262D; --raised: #3A3A44; --fill: #33333B;
  --label: #F9FAFB; --label2: #B0B8C1; --label3: #6B7684; --sep: #34343C;
  --accent: #4593FC; --accent-soft: rgba(49,130,246,.18); --bar: rgba(23,23,28,.94);
  --shadow: 0 -4px 24px rgba(0,0,0,.5);
  --tz-bg: var(--bg); --tz-text: var(--label); --tz-sub: var(--label2); --tz-mute: #8B95A1; --tz-card: var(--surface); --tz-line: var(--sep);
}
.seg button.on { background: var(--raised); }
.check.on i::after { background: #fff; }
.mono-loc, .pn, .large.mono, .rtitle.mono, .sheet-pn, .ai-pn { font-family: var(--font); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.large { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; }
.large.mono { font-size: var(--fs-2xl); font-weight: 700; }
.meta { color: var(--label3); }
.section-label { margin: 28px 2px 8px; font-size: var(--fs-lg); font-weight: 700; color: var(--label); }
.footnote { margin: 10px 4px 0; color: var(--label3); }
.row { min-height: 54px; }
.row + .row::before { border-top: 1px solid var(--sep); }
.tile, .ai-lock, .acard { border-radius: 16px; }
.acard { padding: 18px 18px 16px; }
.acard-title { font-weight: 700; }
.btn-primary { height: 56px; border-radius: 14px; font-size: var(--fs-body); font-weight: 600; }
.btn-ghost { height: 56px; border-radius: 14px; background: var(--surface); font-size: var(--fs-body); }
.btn-secondary { height: 38px; border-radius: 10px; font-weight: 600; }
.pill, .tag { border-radius: 8px; }
.pill.ok { background: rgba(31,122,54,.10); }
.banner, .notice, .locchip { border-radius: 12px; }
.sheet { border-radius: 24px 24px 0 0; padding-inline: 20px; }
.sheet-head h2 { font-weight: 700; }
.loc-head .mono-loc { font-weight: 700; }
.idle svg { color: var(--accent); opacity: .5; }
.tabbar { border-top: 1px solid var(--sep); }
.tz { margin-top: 0; border-radius: 0; }
.switch input:checked + i { background: var(--accent); }
.switch i { background: var(--switch-off); }
:root { --switch-off: #D1D6DB; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --switch-off: #3A3A44; } }
:root[data-theme="dark"] { --switch-off: #3A3A44; }

/* 수량 다름 체크됨 버튼: 연한 주황 바탕 + 진한 주황 글자 (파란 버튼 바탕을 덮어씀). 사유는 회색 카드의 '수량 다름 사유' 줄에 */
.tz .btn-spot.diff { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.tz .btn-spot.diff small { opacity: 1; }
.tz-memo-t { grid-column: 1 / -1; padding-top: 4px; font-size: var(--fs-md); color: var(--tz-text); line-height: 1.45; word-break: break-all; }
.tz-card.has-ck .la-memo { display: none; }

/* 재고 확인 창 (재고조사): 부품 화면과 같은 배치 — 조사 수량이 주인공(48px), 위치는 옆에 22px */
.ai-hero.tzs { padding: 2px 2px 4px; }
.tzs .ai-nm { margin: 4px 0 0; font-size: var(--fs-md); color: var(--label3); }
.tzs .ai-pn { margin-top: 2px; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -0.01em; }
.tzs-hero { display: grid; grid-template-columns: auto 1fr; column-gap: 24px; align-items: end; margin-top: 18px; }
.tzs-q .tz-l, .tzs-w .tz-l { font-size: var(--fs-md); color: var(--label2); }
.tzs .tzs-num { font-size: 48px; font-weight: 700; line-height: 1.05; letter-spacing: -0.02em; margin-top: 4px; }
.tzs .tzs-num small { margin-left: 2px; font-size: 26px; font-weight: 700; color: inherit; }
.tzs .ai-split { margin-top: 4px; font-size: var(--fs-sm); color: var(--label3); font-variant-numeric: tabular-nums; }
.tzs-w { border-left: 1px solid var(--sep); padding-left: 22px; padding-bottom: 22px; min-width: 0; }
.tzs .ai-loc { margin-top: 6px; font-size: 22px; font-weight: 600; letter-spacing: 0.02em; }
.tzs-tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.tzs-tags .tag.carry { margin-left: 0; }
.tzs .ai-last { margin-top: 16px; }
.ai-card { margin-top: 18px; }
.ai-dock { margin-inline: -20px; padding-inline: 20px; }

/* 로그인 (토스 느낌) */
.login.tzl { justify-content: flex-start; padding: 56px 4px 32px; }
.tzl-ic { width: 64px; height: 64px; border-radius: 16px; display: block; margin-bottom: 20px; }
.login.tzl h1 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 6px; }
.login.tzl p.meta { margin-bottom: 32px; color: var(--label2); }
.tzl-f { display: block; margin-bottom: 14px; }
.tzl-f span { display: block; font-size: var(--fs-md); color: var(--label2); margin: 0 2px 8px; }
.tzl-f input { display: block; width: 100%; height: 56px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--surface); color: var(--label); font: inherit; font-size: var(--fs-body); outline: none; box-shadow: inset 0 0 0 1.5px transparent; transition: box-shadow .15s; }
.tzl-f input:focus { box-shadow: inset 0 0 0 1.5px var(--accent); background: var(--bg); }
.login.tzl .btn-primary { margin-top: auto; }
