/* ─────────── ARGOS design tokens (re-label2 계승) ─────────── */
:root {
  --text-primary: #1D2023;
  --text-secondary: #4D535A;
  --text-tertiary: #697079;
  --text-muted: #9AA4B1;
  --surface: #FFFFFF;
  --surface-alt: #F2F4F5;
  --border: #E6E8EB;
  --border-strong: #CACFD6;

  --brand: #FF5E00;
  --brand-strong: #BC3500;
  --brand-soft: #FF8842;
  --brand-bg: #FFF2DF;
  --brand-bg-2: #FBEED8;

  --success: #39B159;
  --success-bg: #E6F5EA;
  --danger: #EB5147;
  --danger-bg: #F8DAD8;
  --info: #1B3A6B;
  --info-bg: #EAF2FB;

  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --shadow-card: 0 1px 2px rgba(29, 32, 35, .04);
  --shadow-pop: 0 8px 24px rgba(29, 32, 35, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Arial", "Apple SD Gothic Neo", "맑은 고딕", sans-serif;
  background: var(--surface);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.45;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: none; }
input { font: inherit; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; background: var(--surface-alt); padding: 1px 5px; border-radius: 4px; font-size: .92em; }

.hidden { display: none !important; }
.muted { color: var(--text-tertiary); }
.small { font-size: 12px; }
.center { text-align: center; }

/* ─────────── login ─────────── */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--surface-alt); padding: 32px 16px; }
.login-wrap { display: flex; flex-direction: column; align-items: center; gap: 28px; width: 100%; }
.login-title { font-size: 32px; font-weight: 700; letter-spacing: -.01em; }
.login-title::after { content: ""; display: block; width: 32px; height: 3px; background: var(--brand); margin: 10px auto 0; border-radius: 2px; }
.login-cards { display: flex; gap: 24px; flex-wrap: wrap; justify-content: center; }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 36px 32px; width: 340px; text-align: center; box-shadow: var(--shadow-pop); }
.login-roles { display: flex; gap: 24px; justify-content: center; }
.login-role { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.login-role input[type="radio"] { width: 18px; height: 18px; accent-color: var(--brand); cursor: pointer; margin: 0; }
.login-role:has(input:checked) { color: var(--brand-strong); }
@media (max-width: 760px) { .login-card { width: 100%; max-width: 360px; } }
.login-fields { display: flex; flex-direction: column; gap: 12px; margin-top: 28px; text-align: left; }
.login-field { display: flex; flex-direction: column; gap: 6px; }
.login-field input { padding: 11px 13px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border-strong); outline: none; transition: border-color .15s, box-shadow .15s; }
.login-field input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255, 94, 0, .15); }
.login-submit { width: 100%; margin-top: 18px; padding: 12px; }
.login-error { color: var(--danger); margin-top: 12px; min-height: 18px; font-size: 13px; }

/* ─────────── buttons ─────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text-primary); font-weight: 700; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--surface-alt); border-color: var(--text-tertiary); }
.btn.small { padding: 6px 12px; font-size: 13px; font-weight: 400; }
/* 모든 라인 아이콘 통일 기준: 18px / stroke 2 */
.icon { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); color: #fff; }
.btn-primary:disabled { background: var(--surface-alt) !important; border-color: var(--border) !important; color: var(--text-muted) !important; cursor: not-allowed; }
.btn-danger { background: var(--surface); border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn.active { background: var(--brand-bg); border-color: var(--brand); color: var(--brand-strong); }
.btn:disabled { background: var(--surface-alt); border-color: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn:disabled:hover { background: var(--surface-alt); border-color: var(--border); }

/* ─────────── layout ─────────── */
.app { display: grid; grid-template-columns: 240px 1fr; height: 100vh; overflow: hidden; background: var(--surface); transition: grid-template-columns .18s ease; }

.sidebar { background: var(--surface-alt); border-right: 1px solid var(--border); display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.sidebar-header { display: flex; align-items: center; gap: 8px; padding: 16px 14px; border-bottom: 1px solid var(--border); }
.collapse-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; margin-left: auto; border-radius: var(--r-sm); color: var(--text-tertiary); border: 1px solid transparent; }
.collapse-btn:hover { background: var(--surface); color: var(--text-primary); border-color: var(--border); }
.logo-btn { font-size: 17px; font-weight: 700; letter-spacing: -.01em; position: relative; padding-left: 12px; white-space: nowrap; overflow: hidden; }
.logo-btn::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; background: var(--brand); border-radius: 2px; }
.logo-btn:hover { color: var(--brand-strong); }
.logout-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; flex-shrink: 0; color: var(--text-tertiary); border-radius: var(--r-sm); border: 1px solid transparent; }
.logout-btn:hover { color: var(--danger); background: var(--surface); border-color: var(--border); }


.folders-title { padding: 10px 14px 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); }
.sidebar-folders { flex: 1; overflow-y: auto; padding: 4px 8px 8px; }
.folder-item { display: grid; grid-template-columns: 8px 1fr auto; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; margin-bottom: 3px; color: var(--text-secondary); border: 1px solid transparent; transition: background .12s, color .12s, border-color .12s; }
.folder-item:hover { background: var(--surface); border-color: var(--border); color: var(--text-primary); }
.folder-item.active { background: var(--brand-bg); color: var(--brand-strong); font-weight: 700; }
.folder-item .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.folder-item .folder-count { font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--text-muted); flex-shrink: 0; }
.folder-item.active .folder-count { color: var(--brand-strong); }
.folder-item .badge-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--border-strong); }
.folder-item .badge-dot.done { background: var(--success); }
.folder-item .badge-dot.partial { background: var(--fc, var(--brand-soft)); }

.sidebar-footer { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.settings-btn { display: flex; align-items: center; gap: 8px; text-align: left; padding: 9px 12px; border-radius: var(--r-md); color: var(--text-secondary); font-size: 13px; font-weight: 600; }
.settings-btn:hover { background: var(--surface); color: var(--text-primary); }
.me-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.me-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.me-info .me-name { font-size: 13.5px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-info .me-role { font-size: 11px; color: var(--text-muted); }

/* nav 아이콘/라벨 */
.nav-btn { display: flex; align-items: center; gap: 8px; }
.nav-ico { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; flex-shrink: 0; }
.nav-ico svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.main { height: 100vh; overflow: hidden; position: relative; background: var(--surface); }
.pane { height: 100%; width: 100%; }

/* ─────────── overview (전체 현황) ─────────── */
.overview-pane { display: flex; flex-direction: column; overflow: hidden; }
.overview-header { padding: 20px 32px 14px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.overview-title-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.overview-header h2 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.overview-summary { display: inline-flex; align-items: stretch; flex-wrap: wrap; color: var(--text-secondary); font-size: 13px; margin-left: auto; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--r-md); padding: 3px; box-shadow: var(--shadow-card); }
.overview-summary .ov-stat { display: inline-flex; align-items: center; gap: 6px; padding: 5px 16px; white-space: nowrap; }
.overview-summary .ov-stat + .ov-stat { border-left: 1px solid var(--border); }
.overview-summary .ov-stat-prog { padding-left: 14px; padding-right: 14px; }
.overview-summary .ov-prog { display: inline-block; width: 160px; min-width: 120px; height: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.overview-summary .ov-prog > span { display: block; height: 100%; background: var(--brand); transition: width .3s; }
.overview-summary b { color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* toolbar: view / sort / filter — 영역별로 구분 */
.overview-toolbar { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.ov-group { display: flex; flex-direction: column; gap: 7px; padding: 2px 18px; }
.ov-group + .ov-group, .overview-toolbar > .ov-count { border-left: 1px solid var(--border); }
.ov-group:first-child { padding-left: 0; }
.ov-group-filter { flex: 1 1 auto; }
.ov-group-label { font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-muted); }
.ov-group-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ov-date { display: inline-flex; align-items: center; gap: 6px; }
.ov-date-sep { color: var(--text-muted); }
.ov-date input[type=date] { font: inherit; font-size: 12px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 6px 8px; outline: none; transition: border-color .15s, box-shadow .15s; }
.ov-date input[type=date]:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,94,0,.15); }
.ov-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; }
.ov-seg-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-secondary); border-right: 1px solid var(--border-strong); }
.ov-seg-btn:last-child { border-right: none; }
.ov-seg-btn .icon { width: 15px; height: 15px; }
.ov-seg-btn:hover { background: var(--surface-alt); }
.ov-seg-btn.active { background: var(--brand-bg); color: var(--brand-strong); }
.ov-search { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 0 10px; transition: border-color .15s, box-shadow .15s; }
.ov-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,94,0,.15); }
.ov-search .icon { width: 15px; height: 15px; color: var(--text-muted); }
.ov-search input { border: none; outline: none; background: none; padding: 7px 2px; width: 180px; font-size: 12.5px; }
.ov-select { font: inherit; font-size: 12.5px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 7px 28px 7px 10px; cursor: pointer; outline: none; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; transition: border-color .15s, box-shadow .15s; }
.ov-select:hover { border-color: var(--text-tertiary); }
.ov-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,94,0,.15); }
.ov-order-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 1px solid var(--border-strong); border-radius: var(--r-md); color: var(--brand-strong); font-size: 12px; font-weight: 700; }
.ov-order-btn:hover { background: var(--surface-alt); border-color: var(--text-tertiary); }
.ov-reset-btn { padding: 7px 14px; border: 1px solid var(--border-strong); border-radius: var(--r-md); font-size: 12.5px; font-weight: 600; color: var(--text-secondary); }
.ov-reset-btn:hover { background: var(--surface-alt); border-color: var(--text-tertiary); color: var(--text-primary); }

.ov-count { display: flex; align-items: flex-end; padding: 2px 0 4px 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.overview-grid { flex: 1; overflow-y: auto; padding: 22px 32px 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; align-content: start; }

/* table view (목록 보기) */
.overview-table-wrap { flex: 1; overflow: auto; margin: 16px 32px 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.ov-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 12px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; display: flex; flex-direction: column; gap: 10px; }
.ov-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); border-color: var(--border-strong); }
.ov-thumbs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ov-thumb { aspect-ratio: 4/3; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden; position: relative; }
.ov-thumb img { width: 100%; height: 100%; object-fit: contain; }
.ov-thumb span { position: absolute; left: 4px; top: 3px; font-size: 9px; font-weight: 700; letter-spacing: .04em; color: var(--text-muted); background: rgba(255,255,255,.8); padding: 0 4px; border-radius: 3px; }
.ov-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ov-name { font-weight: 700; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-badges { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* badges */
.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 10.5px; background: var(--surface-alt); color: var(--text-secondary); border: 1px solid var(--border); white-space: nowrap; }
.badge.ok { background: var(--success-bg); color: var(--success); border-color: transparent; }
.badge.warn { background: var(--brand-bg); color: var(--brand-strong); border-color: transparent; }
.badge.count { background: var(--info-bg); color: var(--info); border-color: transparent; font-variant-numeric: tabular-nums; }
.ov-by { font-size: 11px; color: var(--text-muted); }

/* ─────────── home (폴더별 작업 현황) ─────────── */
.home-pane { display: flex; flex-direction: column; overflow: hidden; }
.home-header { padding: 24px 32px 16px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.home-header h2 { font-size: 24px; font-weight: 700; letter-spacing: -.015em; }
.home-summary { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; color: var(--text-secondary); font-size: 13px; }
.home-summary .ov-prog { flex: 1; min-width: 160px; max-width: 360px; height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.home-summary .ov-prog > div { height: 100%; background: var(--brand); transition: width .3s; }
.home-summary b { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.home-grid { flex: 1; overflow-y: auto; padding: 22px 32px 40px; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; align-content: start; }
.home-card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-card); padding: 16px; cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s; display: flex; flex-direction: column; gap: 12px; }
.home-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-pop); border-color: var(--border-strong); }
.home-card { border-left-width: 3px; border-left-color: var(--border); }
.home-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.home-card-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-card-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 폴더 고정 색상 스와치 (대시보드·설정 공용) */
.folder-color-dot { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,.08) inset; }
.home-card-prog { height: 8px; background: var(--surface-alt); border-radius: 999px; overflow: hidden; }
.home-card-prog > div { height: 100%; background: var(--brand); transition: width .3s; }
.home-card.done .home-card-prog > div { background: var(--success); }
.home-card-foot { display: flex; align-items: center; justify-content: space-between; }
.home-card-pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-secondary); }

/* ─────────── map pane ─────────── */
.map-pane { display: grid; grid-template-columns: 1fr 1fr 320px; height: 100%; position: relative; }
.map-overlay-wrap { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.map-overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.image-pane { position: relative; background: var(--surface-alt); overflow: hidden; border-right: 1px solid var(--border); }
.pane-label { position: absolute; left: 12px; top: 10px; z-index: 6; font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--text-secondary); background: rgba(255,255,255,.85); padding: 2px 8px; border-radius: var(--r-sm); }
.image-stage { position: absolute; inset: 36px 12px 12px; display: flex; align-items: center; justify-content: center; overflow: hidden; touch-action: none; }
.img-wrap { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; transform-origin: center center; transition: transform .08s ease-out; will-change: transform; }
.image-view { max-width: 100%; max-height: 100%; object-fit: contain; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); box-shadow: var(--shadow-card); user-select: none; -webkit-user-drag: none; display: block; }
.image-stage.transforming .img-wrap { transition: none; }
.image-stage.tool-zoom { cursor: zoom-in; }
.image-stage.tool-zoom.alt { cursor: zoom-out; }
.image-stage.tool-pan { cursor: grab; }
.image-stage.tool-pan.dragging { cursor: grabbing; }
.image-stage.tool-annotate { cursor: crosshair; }

/* 점 레이어: stage 좌표계(변환 안 됨), 마커는 JS가 px 위치 계산 */
.points-layer { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.points-layer.annotate { pointer-events: auto; }
.point-marker { position: absolute; width: 16px; height: 16px; transform: translate(-50%, -50%); border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1.5px var(--brand), 0 1px 3px rgba(0,0,0,.4); background: var(--brand); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; pointer-events: auto; cursor: grab; }
.point-marker.pending { background: #2563eb; box-shadow: 0 0 0 1.5px #1d4ed8, 0 1px 3px rgba(0,0,0,.4); }
.point-marker.highlight { background: var(--brand-strong); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--brand); }
.point-marker.dragging { cursor: grabbing; }

.image-tools { position: absolute; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 6px; padding: 6px; background: rgba(255,255,255,.92); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-pop); backdrop-filter: blur(4px); z-index: 6; }
.image-zoom-badge { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 11px; color: var(--text-secondary); padding: 0 6px 0 2px; min-width: 44px; text-align: center; border-right: 1px solid var(--border); }
.image-tool-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: var(--r-sm); color: var(--text-secondary); border: 1px solid transparent; }
.image-tool-btn:hover { background: var(--surface-alt); color: var(--text-primary); }
.image-tool-btn.active { background: var(--brand-bg); border-color: var(--brand); color: var(--brand-strong); }
.image-tool-btn .icon { width: 16px; height: 16px; }

/* 매핑 패널 */
.map-panel { border-left: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.map-panel-head { display: flex; align-items: center; gap: 8px; padding: 12px; border-bottom: 1px solid var(--border); }
.map-pos { margin: 0 auto; display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--brand-strong); font-size: 13px; padding: 5px 12px; border-radius: 999px; background: var(--brand-bg); border: 1px solid var(--brand-soft); box-shadow: var(--shadow-card); transition: background .12s, color .12s, border-color .12s, transform .08s; }
.map-pos::before { content: "▦"; font-size: 12px; line-height: 1; opacity: .85; }
.map-pos:hover { background: var(--brand); color: #fff; border-color: var(--brand); transform: translateY(-1px); }
.map-pos:active { transform: translateY(0); }
.map-meta { padding: 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.filename { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; font-weight: 700; word-break: break-all; }
.map-hint { padding: 8px 12px; font-size: 12px; color: var(--text-tertiary); background: var(--surface-alt); border-bottom: 1px solid var(--border); }
.map-points { flex: 1; overflow-y: auto; padding: 8px; }
.mp-row { display: grid; grid-template-columns: 22px 1fr 24px; align-items: center; gap: 6px; padding: 6px 8px; border-radius: var(--r-md); border: 1px solid var(--border); margin-bottom: 5px; cursor: pointer; transition: background .12s, border-color .12s; }
.mp-row:hover { background: var(--brand-bg-2); }
.mp-row.active { background: var(--brand-bg); border-color: var(--brand); }
.mp-row.pending { border-style: dashed; border-color: #2563eb; background: #eff6ff; cursor: default; }
.mp-num { width: 22px; height: 22px; border-radius: 50%; background: var(--brand); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.mp-row.pending .mp-num { background: #2563eb; }
.mp-coords { font-size: 11px; line-height: 1.4; font-variant-numeric: tabular-nums; color: var(--text-secondary); overflow: hidden; }
.mp-coords b { color: var(--text-primary); font-weight: 700; }
.mp-x { width: 24px; height: 24px; border-radius: var(--r-sm); color: var(--text-muted); display: flex; align-items: center; justify-content: center; font-size: 14px; }
.mp-x:hover { background: var(--danger-bg); color: var(--danger); }
.map-actions { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.map-actions .submit-btn { padding: 12px; font-size: 15px; }
.map-action-row { display: flex; gap: 8px; }
.map-action-row .btn-icon { flex: 1; padding: 9px; }
#preview-btn.active { background: var(--brand-bg); border-color: var(--brand); color: var(--brand-strong); }

/* ─────────── 틸트 미리보기 모달 ─────────── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(20, 22, 25, .55); backdrop-filter: blur(2px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; }
.modal { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); display: flex; flex-direction: column; max-width: 92vw; max-height: 92vh; overflow: hidden; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-title { font-weight: 700; font-size: 15px; }
.modal-close { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--r-md); color: var(--text-tertiary); }
.modal-close:hover { background: var(--surface-alt); color: var(--text-primary); }
.modal-body { padding: 18px; overflow: auto; display: flex; justify-content: center; }
.tilt-stage { position: relative; overflow: hidden; border-radius: var(--r-md); background: #000; box-shadow: var(--shadow-card); }
.tilt-img { position: absolute; left: 0; top: 0; user-select: none; }
.tilt-fundus { z-index: 1; }
.tilt-optos { z-index: 2; transform-origin: 0 0; will-change: transform; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 18px; border-top: 1px solid var(--border); }
.tilt-ctrl { display: flex; align-items: center; gap: 10px; }
.tilt-ctrl input[type=range] { width: 180px; accent-color: var(--brand); }
.tilt-opacity-val { min-width: 38px; font-variant-numeric: tabular-nums; }
.tilt-presets { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-md); overflow: hidden; margin-left: 4px; }
.tilt-preset { padding: 6px 11px; font-size: 12px; font-weight: 600; color: var(--text-secondary); border-right: 1px solid var(--border-strong); font-variant-numeric: tabular-nums; transition: background .12s, color .12s; }
.tilt-preset:last-child { border-right: none; }
.tilt-preset:hover { background: var(--brand-bg); color: var(--brand-strong); }

/* ─────────── data table (전체 현황 목록 보기) ─────────── */
.list-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.list-table thead { position: sticky; top: 0; background: var(--surface-alt); z-index: 1; }
.list-table th { text-align: left; padding: 9px 12px; font-weight: 700; border-bottom: 1px solid var(--border); user-select: none; color: var(--text-secondary); font-size: 11px; letter-spacing: .02em; text-transform: uppercase; }
.list-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.list-table tbody tr { cursor: pointer; transition: background .1s; }
.list-table tbody tr:hover { background: var(--brand-bg-2); }
.list-table tbody tr:last-child td { border-bottom: none; }

/* ─────────── settings ─────────── */
.settings-pane { display: flex; flex-direction: column; padding: 24px 28px; height: 100%; overflow: hidden; gap: 14px; position: relative; }
.settings-header { display: flex; justify-content: space-between; align-items: center; }
.settings-header h3 { font-size: 22px; font-weight: 700; }
.settings-head-actions { display: inline-flex; gap: 8px; align-items: center; }
#zip-upload-btn.drop-ready { outline: 2px dashed var(--brand-soft); outline-offset: 3px; }
#zip-upload-btn.drop-hover, .settings-pane.drop-hover { background: var(--brand-bg); box-shadow: inset 0 0 0 2px var(--brand); }
#zip-upload-btn.drop-hover { background: var(--brand-strong); box-shadow: 0 0 0 3px rgba(255,94,0,.25); }

/* ─────────── ZIP 구조 예시 ─────────── */
.upload-example { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 18px; }
.upload-example-title { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; color: var(--text-primary); margin-bottom: 12px; }
.upload-example-title .icon { width: 16px; height: 16px; color: var(--brand); }
.upload-example-body { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; }
.zip-tree { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.65; color: var(--text-tertiary); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 16px; white-space: pre; }
.zt-zip { color: var(--text-primary); font-weight: 700; }
.zt-dir { color: var(--brand-strong); font-weight: 700; }
.zt-file { color: var(--text-secondary); }
.zip-pair { display: flex; flex-direction: column; gap: 8px; }
.zip-pair-row { display: flex; align-items: center; gap: 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; color: var(--text-tertiary); }
.zip-pair-row .zp-arrow { width: 16px; height: 16px; color: var(--text-muted); }
.zip-pair-row .zp-result { font-family: inherit; font-size: 12px; color: var(--text-secondary); background: var(--brand-bg); border-radius: 999px; padding: 2px 10px; margin-left: 4px; }
.zip-pair-row .zp-result strong { color: var(--brand-strong); }
.upload-example-note { margin-top: 12px; line-height: 1.6; }
.upload-example-note code { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; font-size: 11px; }

.upload-status { background: var(--info-bg); border: 1px solid transparent; border-radius: var(--r-md); padding: 12px 16px; font-size: 13px; color: var(--info); }
.upload-status.error { background: var(--danger-bg); color: var(--danger); }
.upload-status .progress-bar { height: 6px; background: rgba(255,255,255,.6); border-radius: 999px; overflow: hidden; margin-top: 8px; }
.upload-status .progress-bar > div { height: 100%; background: var(--brand); transition: width .3s; }
.err-code { display: inline-block; font-family: ui-monospace, Menlo, monospace; font-size: 11px; font-weight: 700; background: var(--danger); color: #fff; padding: 1px 7px; border-radius: 4px; margin-bottom: 6px; }
.err-msg { font-weight: 700; }
.err-detail { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; white-space: pre-wrap; word-break: break-all; }

.settings-list { flex: 1; overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-card); }
.settings-folder-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); border-left: 3px solid var(--border); cursor: pointer; transition: background .12s; }
.settings-folder-row:last-child { border-bottom: none; }
.settings-folder-row:hover { background: var(--surface-alt); }
.settings-folder-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.settings-folder-info .meta { color: var(--text-tertiary); font-size: 12px; margin-left: 12px; }
.settings-folder-actions { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; margin-left: 12px; }
.dl-btn { padding: 6px 12px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dl-btn .icon { width: 15px; height: 15px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-sm); color: var(--text-tertiary); border: 1px solid transparent; transition: background .12s, color .12s, border-color .12s; }
.icon-btn:hover { background: var(--surface-alt); color: var(--text-primary); border-color: var(--border); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); background: var(--danger-bg); }
.icon-btn:disabled { cursor: not-allowed; }
.icon-btn.loading { opacity: .5; }
.icon-btn.loading .icon { animation: icon-spin .8s linear infinite; }
@keyframes icon-spin { to { transform: rotate(360deg); } }

/* ─────────── folder select (overview filter) ─────────── */
.folder-select { font: inherit; font-size: 12.5px; color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-md); padding: 6px 28px 6px 10px; cursor: pointer; max-width: 240px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697079' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
.folder-select:hover { border-color: var(--text-tertiary); }
.folder-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(255,94,0,.15); }

/* ─────────── sidebar collapsed ─────────── */
.app.collapsed { grid-template-columns: 60px 1fr; }
.app.collapsed .sidebar-header { padding: 16px 0; justify-content: center; }
.app.collapsed .collapse-btn { margin-left: 0; }
.app.collapsed .logo-btn,
.app.collapsed .nav-label,
.app.collapsed .folders-title,
.app.collapsed .folder-item .name,
.app.collapsed .folder-item .folder-count,
.app.collapsed .me-info,
.app.collapsed .settings-btn .nav-label { display: none; }
.app.collapsed .nav-btn,
.app.collapsed .settings-btn { justify-content: center; gap: 0; padding-left: 0; padding-right: 0; }
.app.collapsed .nav-btn .nav-ico,
.app.collapsed .settings-btn .nav-ico { width: auto; }
.app.collapsed .sidebar-folders { padding: 4px 6px 8px; }
.app.collapsed .folder-item { grid-template-columns: 1fr; justify-items: center; padding: 8px 4px; }
.app.collapsed .me-bar { justify-content: center; padding: 8px; }

/* ─────────── toast ─────────── */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(8px); background: #2b2f36; color: #fff; padding: 11px 20px; border-radius: var(--r-md); font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-pop); z-index: 9999; opacity: 0; transition: opacity .18s, transform .18s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: var(--danger); }

/* ─────────── scrollbars ─────────── */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--surface); }
*::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
