/* 로아 영업 — 화면 모양
   휴대폰(<768): 아래 탭 막대, 한 칸
   태블릿(768~1279): 왼쪽 좁은 메뉴, 목록+상세 두 칸
   PC(1280+): 왼쪽 넓은 메뉴, 두 칸 + 영업 진행은 단계별 열 */

/* 디자인 방향(드라이브 로아_디자인_방향.md):
   남색(구조)·강철 회색(바탕·글자) + 강조색 하나(파랑 = 누를 것·고른 것).
   상태색은 뜻이 하나뿐: 초록 = 영업 가능·완료, 노랑 = 확인 필요, 빨강 = 제외·휴폐업·지남.
   우선순위·안전동행·과세유형 같은 '정보'는 상태색을 쓰지 않는다(남색·회색). */
:root {
  /* 바탕·글자(강철 회색) */
  --bg: #f1f3f6;
  --surface: #ffffff;
  --surface-2: #f6f7f9;
  --surface-3: #e9ecf1;
  --border: #dbe0e7;
  --border-strong: #c2cad5;
  --text: #151e2e;
  --text-2: #475163;
  --text-3: #737d8f;
  /* 강조색 하나 — 주 버튼·선택·링크 */
  --primary: #1d5fd0;
  --primary-hover: #174fb0;
  --primary-ink: #ffffff;
  --primary-soft: #e6eefc;
  /* 남색 — 메뉴·우선순위·브랜드 */
  --navy: #1a2e52;
  --navy-soft: #e4e9f2;
  --navy-ink: #ffffff;
  --nav-bg: #15274a;
  --nav-text: #b5c1d8;
  --nav-active: #ffffff;
  --nav-active-bg: rgba(255, 255, 255, .13);
  /* 상태색(뜻 고정) */
  --ok: #157a46;      --ok-soft: #e1f3e8;
  --warn: #8f5600;    --warn-soft: #fff0d2;
  --danger: #be3226;  --danger-soft: #fde7e4;
  /* 보조(정보 상자·동의 표시) — 강철 남회색 하나로 묶음 */
  --info: #35507a;    --info-soft: #e8edf5;
  --teal: #35507a;    --teal-soft: #e8edf5;
  --gray: #5c6779;    --gray-soft: #eceef2;
  /* 글자 크기 */
  --fs-xs: 12.5px; --fs-sm: 14px; --fs-md: 16px; --fs-lg: 18px; --fs-xl: 22px;
  /* 간격(4의 배수) */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .07);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .18);
  --radius: 14px;
  --radius-sm: 10px;
  --tap: 48px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e131b; --surface: #161d28; --surface-2: #1b2330; --surface-3: #232c3b;
    --border: #2a3444; --border-strong: #3a4558;
    --text: #e7ebf2; --text-2: #a9b2c2; --text-3: #7d8799;
    --primary: #5b93f0; --primary-hover: #76a6f3; --primary-ink: #0b1220; --primary-soft: #1a2b48;
    --navy: #9fb4d9; --navy-soft: #233250; --navy-ink: #0e1626;
    --nav-bg: #0b1322; --nav-text: #98a6bf;
    --ok: #4cc488; --ok-soft: #12301f; --warn: #f0b04a; --warn-soft: #34270f;
    --danger: #f07a6c; --danger-soft: #3a1a17; --info: #a9bbd8; --info-soft: #1f2a3c;
    --teal: #a9bbd8; --teal-soft: #1f2a3c; --gray: #9aa4b5; --gray-soft: #232b38;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e131b; --surface: #161d28; --surface-2: #1b2330; --surface-3: #232c3b;
  --border: #2a3444; --border-strong: #3a4558;
  --text: #e7ebf2; --text-2: #a9b2c2; --text-3: #7d8799;
  --primary: #5b93f0; --primary-hover: #76a6f3; --primary-ink: #0b1220; --primary-soft: #1a2b48;
  --navy: #9fb4d9; --navy-soft: #233250; --navy-ink: #0e1626;
  --nav-bg: #0b1322; --nav-text: #98a6bf;
  --ok: #4cc488; --ok-soft: #12301f; --warn: #f0b04a; --warn-soft: #34270f;
  --danger: #f07a6c; --danger-soft: #3a1a17; --info: #a9bbd8; --info-soft: #1f2a3c;
  --teal: #a9bbd8; --teal-soft: #1f2a3c; --gray: #9aa4b5; --gray-soft: #232b38;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .55);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.3; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 18px; height: 18px; }
.muted { color: var(--text-3); }
.sub { color: var(--text-2); font-size: 14px; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: 2px; }

/* ---------------- 뼈대 */
#app { min-height: 100vh; min-height: 100dvh; }
.sidenav { display: none; }
main { min-width: 0; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 6px 12px 6px 16px; padding-top: calc(6px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 19px; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.topbar .back { margin-left: -8px; }
.top-actions { display: flex; gap: 6px; }
.view { padding: 16px; max-width: 1100px; margin: 0 auto; }
.view.full { max-width: none; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 60px; color: var(--text-3); font-size: 12px; font-weight: 600;
}
.tabbar a { position: relative; }
.tabbar a.on { color: var(--primary); }
.tabbar a.on::before { content: ""; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--primary); }

.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; }
.brand img { width: 34px; height: 34px; border-radius: 9px; }

/* ---------------- 공통 부품 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap; text-align: center;
}
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-lg { min-height: 52px; font-size: 17px; border-radius: 12px; }
.btn-block { width: 100%; }
.icon-btn { min-width: 44px; min-height: 44px; padding: 0; border-radius: 12px; }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: 14px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 16px; }
.section { margin-top: 20px; }
.section-h { display: flex; align-items: baseline; gap: 8px; margin: 0 4px 8px; }
.section-h h2 { font-size: 16px; font-weight: 700; }
.section-h .count { color: var(--text-3); font-size: 14px; font-weight: 600; }
.section-h .spacer { flex: 1; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: 999px;
  font-size: 12.5px; font-weight: 700; white-space: nowrap; background: var(--gray-soft); color: var(--gray);
}
.b-ok { background: var(--ok-soft); color: var(--ok); }
.b-warn { background: var(--warn-soft); color: var(--warn); }
.b-danger { background: var(--danger-soft); color: var(--danger); }
.b-info { background: var(--info-soft); color: var(--info); }
.b-primary { background: var(--primary-soft); color: var(--primary); }
.b-teal { background: var(--teal-soft); color: var(--teal); }
/* 우선순위: 남색 짙기로만 구분(상태색 아님) */
.b-pri1 { background: var(--navy); color: var(--navy-ink); }
.b-pri2 { background: var(--navy-soft); color: var(--navy); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--navy) 35%, transparent); }
.b-pri3 { background: var(--gray-soft); color: var(--gray); }
/* 영업 기회(안전동행 대상 등): 강조색 테두리 — '영업 가능' 초록과 겹치지 않게 */
.b-chance { background: transparent; color: var(--primary); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--primary) 55%, transparent); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }

.list { display: flex; flex-direction: column; }
.list.card { overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 14px;
  color: var(--text); border-bottom: 1px solid var(--border); background: var(--surface);
  cursor: pointer; text-align: left; width: 100%; border-left: 0; border-right: 0; border-top: 0;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--surface-2); }
.row.sel { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.row-main { flex: 1; min-width: 0; }
.row-title { font-weight: 700; font-size: 16px; line-height: 1.35; }
.row-sub { color: var(--text-2); font-size: 13.5px; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.row-actions { display: flex; gap: 6px; flex: none; }
.row.dim { opacity: .55; }

.empty { text-align: center; padding: 32px 16px; color: var(--text-2); }
.empty .ic { width: 40px; height: 40px; color: var(--text-3); margin-bottom: 8px; }
.empty h3 { font-size: 17px; margin-bottom: 6px; color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); font-weight: 600; font-size: 15px;
  cursor: pointer; white-space: nowrap;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.chip.soft.on { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }
.chip .x { opacity: .7; }

.seg { display: flex; background: var(--surface-3); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button {
  flex: 1; min-height: 42px; border: 0; border-radius: 9px; background: transparent; font-weight: 700;
  color: var(--text-2); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 14px; font-weight: 700; color: var(--text-2); }
.field .hint { font-size: 13px; color: var(--text-3); font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); font-size: 16px;
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--primary); outline: 3px solid var(--primary-soft); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

dl.info { display: grid; grid-template-columns: 112px 1fr; gap: 10px 12px; margin: 0; }
dl.info dt { color: var(--text-3); font-size: 14px; font-weight: 600; }
dl.info dd { margin: 0; font-size: 15px; min-width: 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpi { padding: 14px 16px; }
.kpi .k-label { font-size: 13.5px; color: var(--text-2); font-weight: 700; }
.kpi .k-value { font-size: 22px; font-weight: 800; margin-top: 4px; letter-spacing: -.3px; white-space: nowrap; }
.kpi .k-sub { font-size: 13px; color: var(--text-3); margin-top: 2px; }
.kpi.accent .k-value { color: var(--primary); }
.kpi.danger .k-value { color: var(--danger); }
.kpi.ok .k-value { color: var(--ok); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.chips .grow { flex: 1; min-width: 150px; }
.chips .grow select { min-height: 44px; }
input.check { width: 24px; height: 24px; accent-color: var(--primary); cursor: pointer; }
.searchbox { position: relative; flex: 1; min-width: 0; }
.searchbox .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
.searchbox input { padding-left: 42px; }

.pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 14px; }

/* ---------------- 오늘 */
.hello { margin: 4px 4px 14px; }
.hello .date { color: var(--text-2); font-weight: 700; font-size: 14px; }
.hello h2 { font-size: 22px; margin-top: 2px; letter-spacing: -.3px; }
.today-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tstat { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); min-height: 72px; }
.tstat b { font-size: 22px; line-height: 1.1; }
.tstat span { font-size: 12.5px; color: var(--text-2); font-weight: 700; }
.tstat.hot { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); }
.tstat.hot b { color: var(--primary); }
.tstat:hover { background: var(--surface-2); }
.when { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; flex: none;
  width: 54px; min-height: 48px; border-radius: 10px; background: var(--surface-3); font-weight: 800; line-height: 1.2; }
.when small { font-size: 11.5px; color: var(--text-2); font-weight: 700; }
.when.late { background: var(--danger-soft); color: var(--danger); }
.when.now { background: var(--primary-soft); color: var(--primary); }
.cta { display: flex; gap: 14px; align-items: center; padding: 20px; }
.cta .ic { width: 36px; height: 36px; color: var(--primary); }

/* ---------------- 두 칸 */
.split { display: block; }
.split .pane-detail:empty { display: none; }
.split.has-detail .pane-list { display: none; }
.detail-empty { display: none; }

/* ---------------- 업체 카드 */
.co-head h2 { font-size: 22px; letter-spacing: -.3px; }
.co-head .sub { margin-top: 4px; }
.actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 8px; margin-top: 14px; }
.act {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  min-height: 64px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; font-size: 14px; cursor: pointer;
}
.act:hover { background: var(--surface-2); }
.act.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.act.disabled { opacity: .45; pointer-events: none; }
/* 업체 카드: 추천 한 줄 → 연락(전화·지도, 크게) → 상태 표시 → 나머지는 접어 둠 */
.co-head h2 { margin-top: 2px; }
.co-contact { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; margin-top: 14px; }
.co-contact .act { flex-direction: row; gap: 10px; min-height: 60px; font-size: 18px; border-radius: 14px; }
.co-contact .act .ic { width: 24px; height: 24px; }
.co-contact .act small { font-size: 12.5px; font-weight: 600; opacity: .85; }
.co-more { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.co-more .act { min-height: 52px; flex-direction: row; gap: 5px; padding: 0 4px; font-size: 15px; white-space: nowrap;
  background: var(--surface-2); }
.co-more .act .ic { width: 20px; height: 20px; }
.co-status { margin-top: 14px; }
.co-status .badge { height: 28px; padding: 0 10px; font-size: 13px; }
.fold { margin-top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; }
.fold > summary { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 14px; cursor: pointer;
  list-style: none; font-weight: 700; font-size: 16px; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary .count { color: var(--text-3); font-size: 14px; font-weight: 600; }
.fold > summary .spacer { flex: 1; }
.fold > summary .chev { color: var(--text-3); transition: transform .15s; }
.fold[open] > summary .chev { transform: rotate(90deg); }
.fold > summary:hover { background: var(--surface-2); }
.fold-b { border-top: 1px solid var(--border); }
.fold-b > .card { border: 0; border-radius: 0; box-shadow: none; }
.fold-b > .card.empty { padding: 20px 16px; }
.timeline { display: flex; flex-direction: column; }
.tl { padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tl:last-child { border-bottom: 0; }
.tl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-top .when-t { font-weight: 700; font-size: 14px; }
.tl-memo { margin-top: 6px; white-space: pre-wrap; }
.tl-foot { margin-top: 4px; font-size: 13px; color: var(--text-3); display: flex; gap: 10px; align-items: center; }
.tl-foot .spacer { flex: 1; }
.notes { margin: 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.notes li { margin: 2px 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.btn-row .grow { flex: 1; }
.btn-strong { border-color: var(--primary); color: var(--primary); }
.match-box { padding-top: 14px; border-top: 1px dashed var(--border); }
.confirmed { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 8px 8px 12px; border-radius: 10px;
  background: var(--teal-soft); color: var(--teal); font-weight: 700; font-size: 14px; }
.confirmed .grow { flex: 1; min-width: 0; }
.confirmed small { font-weight: 600; opacity: .85; }
.hist { margin-top: 10px; font-size: 14px; color: var(--text-2); }
.hist summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.guess { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cand { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.cand:last-child { border-bottom: 0; }
.cand.cur { background: var(--primary-soft); }
.cand-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cand-foot { display: flex; align-items: center; margin-top: 8px; }
.cand-foot .grow { flex: 1; }
.consent-box { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--teal-soft);
  border: 1px solid color-mix(in srgb, var(--teal) 30%, var(--border)); }
.sheet .consent-box .label:first-child { margin-top: 0; }
.consent-box .field { margin-bottom: 4px; }
/* 안내 상자: 회색 바탕 + 왼쪽 남색 줄(경고가 아닌 '읽을거리') */
.notice { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); color: var(--text-2); font-size: 14px;
  line-height: 1.6; border: 1px solid var(--border); border-left: 4px solid var(--navy); }
.notice b { color: var(--text); }
/* 국세청 휴업·폐업 경고(진행 중 거래·미수 수수료) */
.risk-box { padding: 14px; border-radius: 14px; background: var(--danger-soft);
  border: 1.5px solid color-mix(in srgb, var(--danger) 45%, var(--border)); }
.risk-h { display: flex; align-items: center; gap: 8px; color: var(--danger); font-size: 16px; }
.risk-h .ic { width: 22px; height: 22px; flex: none; }
.risk-h .count { margin-left: auto; font-weight: 700; }
.risk-box > .sub { margin: 6px 0 10px; }
.risk-box .row .ic { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.badge.b-tax { background: var(--surface-3); color: var(--text-2); font-weight: 600; }
.row-title .badge { margin-left: 6px; vertical-align: 2px; font-size: 12px; height: 22px; padding: 0 7px; }
textarea.news-body { min-height: 300px; font-size: 15px; }
/* 메이커 납기 경고(납기일이 보통 납기보다 빠름) */
.warn-box { padding: 14px; border-radius: 14px; background: var(--warn-soft);
  border: 1.5px solid color-mix(in srgb, var(--warn) 45%, var(--border)); }
.warn-box .risk-h { color: var(--warn); }
.warn-box > .sub { margin: 6px 0 8px; }
.sheet .warn-box { margin: 4px 0 12px; }
.alt-list { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.alt-list .sub { margin-right: 4px; }
/* 지원사업 신청 준비 업체 */
.prep-head { margin-bottom: 4px; }
.prep-item + .prep-item { margin-top: 10px; }
.prep-item.ready { border-color: color-mix(in srgb, var(--ok) 45%, var(--border)); }
.prep-top { display: flex; gap: 10px; align-items: flex-start; }
.prep-count { flex: none; font-weight: 800; font-size: 15px; color: var(--text-2); }
.prep-count.ok { color: var(--ok); }
.prep-checks { margin-top: 10px; }
.prep-item > .btn-ghost { margin-top: 6px; }
.prep-top .row-title .badge { margin-left: 6px; }
/* 사업계획서 단계: 미착수 → 초안 → 검토 → 완료 (지금 단계 = 파랑 테두리, 지난 단계 = 옅은 파랑, 완료 = 초록) */
.plan-row { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin-top: 10px; }
.plan-k { font-size: var(--fs-sm, 14px); font-weight: 700; color: var(--text-2); }
.plan-steps { display: inline-flex; border: 1px solid var(--border-strong, var(--border)); border-radius: 12px; overflow: hidden; }
.plan-step { min-height: 44px; min-width: 56px; padding: 0 12px; border: 0; border-left: 1px solid var(--border); background: var(--surface);
  color: var(--text-2); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.plan-step:first-child { border-left: 0; }
.plan-step.done { background: var(--primary-soft); color: var(--primary); }
.plan-step.on { box-shadow: inset 0 0 0 2px var(--primary); color: var(--primary); font-weight: 800; }
.plan-step.ok { background: var(--ok-soft, var(--primary-soft)); color: var(--ok); box-shadow: inset 0 0 0 2px var(--ok); }
.plan-step:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: -3px; }
/* 어느 지원사업 점검표인지 */
.prog-box .prog-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prog-box > .sub { margin-top: 4px; }
.prog-pick { margin-top: 10px; }
.prog-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.prog-note { margin: 8px 0 0; }
.grid3 { display: grid; grid-template-columns: 1fr; gap: 0 12px; }
@media (min-width: 560px) { .grid3 { grid-template-columns: repeat(3, 1fr); } }
/* 엑셀 올리기 */
.upload-pick { position: relative; cursor: pointer; }
.file-in { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.row-title > .badge.b-warn { margin-left: 8px; }
/* 업체 찾기 목록: 이름은 줄바꿈되어도 배지는 이름 옆에 같이 붙음 */
.row-title.has-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.row-title.has-badges .row-name { flex: 0 1 auto; min-width: 6em; overflow-wrap: anywhere; }
.row-title.has-badges .row-badges { display: flex; flex-wrap: wrap; gap: 4px; flex: 0 1 auto; }
.row-title.has-badges .badge { margin-left: 0; vertical-align: baseline; }
.row-title.has-badges .row-badges { min-width: 0; max-width: 100%; }
.row-title.has-badges .row-badges .badge { white-space: normal; height: auto; min-height: 22px; line-height: 1.3; padding-top: 2px; padding-bottom: 2px; }

/* ---------------- 시트(아래에서 올라오는 창) */
.sheet-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(8, 14, 26, .45);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .15s ease-out;
}
.sheet {
  width: 100%; max-height: 92vh; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg);
  animation: up .2s ease-out; padding-bottom: env(safe-area-inset-bottom);
}
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 12px 8px 8px 18px; border-bottom: 1px solid var(--border); }
.sheet-h h3 { flex: 1; font-size: 18px; min-width: 0; }
.sheet-b { padding: 16px 18px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-f { display: flex; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.sheet-f .btn { flex: 1; }
.sheet .label { font-size: 14px; font-weight: 700; color: var(--text-2); margin: 14px 0 8px; }
.sheet .label:first-child { margin-top: 0; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.results .chip { justify-content: center; border-radius: 12px; min-height: 52px; font-size: 16px; }
.suggest { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.suggest button { text-align: left; }
.linked { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px;
  background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px; }
.linked .grow { flex: 1; }
@keyframes up { from { transform: translateY(24px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- 영업 진행 */
.stage-group { margin-bottom: 10px; overflow: hidden; }
.stage-h {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 0 14px;
  border: 0; background: var(--surface); cursor: pointer; text-align: left;
}
.stage-h .name { font-weight: 800; flex: 1; }
.stage-h .sum { color: var(--text-2); font-size: 14px; font-weight: 600; }
.stage-h .chev { transition: transform .15s; color: var(--text-3); }
.stage-group.open .stage-h .chev { transform: rotate(90deg); }
.stage-group .list { border-top: 1px solid var(--border); }
.stage-group:not(.open) .list { display: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--gray); }
.t-contact { --tone: var(--primary); --tone-soft: var(--primary-soft); }
.t-apply { --tone: var(--info); --tone-soft: var(--info-soft); }
.t-win { --tone: var(--ok); --tone-soft: var(--ok-soft); }
.t-retry { --tone: var(--warn); --tone-soft: var(--warn-soft); }
.t-ship { --tone: var(--teal); --tone-soft: var(--teal-soft); }
.t-fee { --tone: var(--navy); --tone-soft: var(--navy-soft); }
.t-end { --tone: var(--gray); --tone-soft: var(--gray-soft); }
.dot[class*="t-"] { background: var(--tone); }
.badge.stage { background: var(--tone-soft); color: var(--tone); }
.stage-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stage-chips .chip { min-height: 40px; font-size: 14px; padding: 0 12px; }
.stage-chips .chip.on { background: var(--tone); border-color: var(--tone); color: var(--surface); }
.board { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: flex-start; }
.col { flex: 0 0 264px; background: var(--surface-3); border-radius: var(--radius); padding: 10px; }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 4px 10px; font-weight: 800; }
.col-h .count { color: var(--text-3); font-weight: 700; }
.col-h .sum { margin-left: auto; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.dcard { display: block; padding: 12px; margin-bottom: 8px; border-radius: 12px; background: var(--surface);
  border: 1px solid var(--border); box-shadow: var(--shadow); cursor: pointer; color: var(--text); }
.dcard:hover { border-color: var(--primary); }
.dcard .t { font-weight: 800; }
.dcard .s { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.dcard select { margin-top: 8px; min-height: 40px; font-size: 14px; }
.col .empty-col { color: var(--text-3); font-size: 13px; text-align: center; padding: 12px 0; }

/* ---------------- 일정 */
.month-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.month-nav h2 { flex: 1; text-align: center; font-size: 19px; }
.day-h { display: flex; align-items: center; gap: 8px; margin: 16px 4px 6px; font-weight: 800; font-size: 15px; }
.day-h.past { color: var(--text-3); }
.day-h .badge { font-size: 12px; }

/* ---------------- 로그인 */
.login {
  min-height: 100vh; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: radial-gradient(1200px 500px at 50% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent), var(--bg);
}
.login .card { width: 100%; max-width: 400px; padding: 28px 24px; }
.login .logo { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 14px; }
.login h1 { text-align: center; font-size: 24px; }
.login p { text-align: center; color: var(--text-2); margin: 6px 0 20px; }
.err { color: var(--danger); font-weight: 600; font-size: 14px; min-height: 20px; margin: 4px 0 8px; }

/* ---------------- 알림 */
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  z-index: 200; background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px;
  font-weight: 700; box-shadow: var(--shadow-lg); max-width: calc(100vw - 32px); animation: up .2s ease-out;
}
.offline {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--warn); color: #1b1300;
  text-align: center; font-weight: 800; font-size: 14px; padding: 8px 12px;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.loading { padding: 40px; text-align: center; color: var(--text-3); }
.spin { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--border); border-top-color: var(--primary);
  border-radius: 50%; animation: rot .8s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------------- 태블릿 */
@media (min-width: 768px) {
  #app { display: grid; grid-template-columns: 88px minmax(0, 1fr); }
  .tabbar { display: none; }
  main { padding-bottom: 0; }
  .sidenav {
    display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; height: 100dvh;
    background: var(--nav-bg); padding: 14px 8px; overflow-y: auto;
  }
  .sidenav .brand { justify-content: center; margin-bottom: 14px; }
  .sidenav .brand span { display: none; }
  .sidenav a {
    display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 60px; padding: 8px 4px;
    border-radius: 12px; color: var(--nav-text); font-size: 12px; font-weight: 700; text-align: center;
  }
  .sidenav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
  .sidenav a.on { background: var(--nav-active-bg); color: var(--nav-active); }
  .sidenav .grow { flex: 1; }
  .sidenav .who { color: var(--nav-text); font-size: 12px; text-align: center; padding: 8px 0; }
  .view { padding: 20px 24px; }
  .toast { bottom: 24px; }
  .sheet-bg { align-items: center; padding: 24px; }
  .sheet { max-width: 600px; border-radius: 18px; max-height: 88vh; }

  .split.on { display: grid; grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
    height: calc(100vh - 57px); height: calc(100dvh - 57px); }
  .split.on > .pane-list, .split.on > .pane-detail { overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .split.on > .pane-list { display: block; border-right: 1px solid var(--border); background: var(--surface); }
  .split.on > .pane-list .list.card { border: 0; border-radius: 0; box-shadow: none; }
  .split.on > .pane-list .pad { padding: 12px; }
  .split.on > .pane-detail { display: block; padding: 20px 24px; }
  .split.on .detail-empty { display: flex; height: 100%; align-items: center; justify-content: center; }
  .split.on .only-phone { display: none; }
  .view.flush { padding: 0; max-width: none; }
  .split.on .co-more .act { font-size: 14px; }
  .split.on .co-more .act .ic { width: 18px; height: 18px; }
  .today-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
}

/* ---------------- PC */
@media (min-width: 1280px) {
  #app { grid-template-columns: 232px minmax(0, 1fr); }
  .sidenav { padding: 18px 14px; }
  .sidenav .brand { justify-content: flex-start; padding: 0 8px; margin-bottom: 18px; }
  .sidenav .brand span { display: inline; }
  .sidenav a { flex-direction: row; gap: 12px; min-height: 48px; padding: 0 14px; font-size: 15px; text-align: left; }
  .sidenav .who { text-align: left; padding: 8px 14px; font-size: 13px; }
  .split.on { grid-template-columns: 440px minmax(0, 1fr); }
  .split.on > .pane-detail { padding: 24px 32px; }
  .view { padding: 24px 32px; }
  .detail-wrap { max-width: 860px; }
  .co-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; align-items: start; }
}

@media (max-width: 767px) {
  .today-stats .tstat { padding: 10px; }
  .kpis { grid-template-columns: 1fr; gap: 8px; }
  .row.vrow { flex-wrap: wrap; row-gap: 4px; }
  .row.vrow .row-main { flex-basis: calc(100% - 60px); }
  .row.vrow .row-actions { width: 100%; justify-content: flex-end; }
  .kpi { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 12px; padding: 12px 14px; }
  .kpi .k-value { font-size: 20px; margin-top: 0; white-space: nowrap; grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .kpi .k-sub { grid-column: 1; }
  .only-wide { display: none !important; }
}
@media (max-width: 380px) {
  .grid2 { grid-template-columns: 1fr; }
  dl.info { grid-template-columns: 92px 1fr; }
}
@media print {
  .sidenav, .tabbar, .topbar .top-actions { display: none !important; }
}

/* 추천 한 줄·공장등록·찾아보기·수신 동의 QR */
.pitch { display: flex; gap: 10px; align-items: baseline; margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--primary-soft); color: var(--text); font-size: 16px; font-weight: 600; line-height: 1.5;
  border-left: 4px solid var(--primary); }
.pitch-k { flex: none; font-size: 12.5px; font-weight: 800; color: var(--primary); letter-spacing: .04em; }
.warn-t { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--warn); font-weight: 700; }
.look-links .btn { flex: 1 1 auto; }
.qr-box { display: grid; gap: 8px; }
.qr-wrap { width: min(260px, 70vw); margin: 4px auto 6px; padding: 10px; background: #fff; border-radius: 12px;
  border: 1px solid var(--border); }
.qr-svg { display: block; width: 100%; height: auto; }
.url-line { display: flex; gap: 8px; align-items: center; }
.url-line code { flex: 1; min-width: 0; padding: 8px 10px; border-radius: 8px; background: var(--surface-3); color: var(--text);
  font-size: 13px; word-break: break-all; }
.visit-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.visit-head .grow { flex: 1; min-width: 200px; }

/* 위 막대 단추 여러 개(일정: 공고 · 일정 추가) */
.top-actions .btn-row { margin-top: 0; flex-wrap: nowrap; }


/* ---- 지도(카카오): 방문 목록 지도·업체 카드 작은 지도·설정 */
.map-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.map-tools .btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.map-box { position: relative; width: 100%; height: 300px; margin-top: 12px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: var(--gray-soft); }
.map-msg { margin-top: 12px; padding: 14px; border-radius: var(--radius-sm); background: var(--gray-soft); color: var(--gray);
  font-size: var(--fs-sm); }
.map-box .loading { height: 100%; }
.map-pin { width: 30px; height: 30px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); margin-bottom: 6px;
  display: grid; place-items: center; background: var(--primary); color: #fff; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); font: 700 13px/1 system-ui, sans-serif; cursor: pointer; padding: 0; }
.map-pin > span { transform: rotate(45deg); }
.map-pin.done { background: #7d8799; }
.map-pop { background: #fff; color: #151e2e; border-radius: 12px; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); padding: 10px 12px;
  min-width: 170px; max-width: 240px; font-size: 14px; display: grid; gap: 8px; }
.map-pop b { font-size: 15px; line-height: 1.3; word-break: keep-all; }
.map-pop .pop-row { display: flex; gap: 6px; }
.map-pop a, .map-pop button { flex: 1; min-height: 38px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; font: 600 13.5px/1.2 system-ui, sans-serif; text-decoration: none; border: 1px solid #c2cad5;
  background: #fff; color: #151e2e; cursor: pointer; padding: 0 8px; }
.map-pop a.go { background: #fee500; border-color: #e6cf00; color: #191600; }
.vnum { flex: none; width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; margin-right: 6px;
  background: var(--primary); color: var(--primary-ink); font-size: 12.5px; font-weight: 700; vertical-align: 1px; }
.badge.b-nogeo { background: var(--gray-soft); color: var(--gray); }
.co-map { margin-top: 12px; height: 150px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border);
  background: var(--gray-soft); }
.co-map a, .co-map img { display: block; width: 100%; height: 100%; }
.geo-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.geo-stats div { background: var(--gray-soft); border-radius: var(--radius-sm); padding: 10px; text-align: center; }
.geo-stats b { display: block; font-size: var(--fs-lg); }
.geo-stats span { font-size: var(--fs-xs); color: var(--gray); }
@media (min-width: 768px) { .map-box { height: 420px; } .co-map { height: 170px; } }
@media (min-width: 1280px) { .map-box { height: 480px; } }.row-title .b-nogeo { margin-left: 6px; vertical-align: 1px; }
.geo-stats + .btn-row { align-items: center; }

/* ---------------------------------------------------------------- 영업 신호 4단계·현장 결과·오늘 안내 */
.badge.alive { font-weight: 700; }
.alive-box { padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border);
  box-shadow: inset 4px 0 0 var(--gray); }
.alive-box.b-ok { box-shadow: inset 4px 0 0 var(--ok); }
.alive-box.b-primary { box-shadow: inset 4px 0 0 var(--primary); }
.alive-box.b-danger { box-shadow: inset 4px 0 0 var(--danger); background: color-mix(in srgb, var(--danger-soft) 45%, var(--surface)); }
.alive-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.alive-h b { font-size: 15px; }
.alive-h .badge { height: 28px; padding: 0 10px; font-size: 13px; }
.alive-why { margin: 8px 0 0; padding-left: 18px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.alive-rel { display: flex; gap: 6px; align-items: flex-start; margin-top: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--warn-soft); color: var(--warn); font-size: 13.5px; font-weight: 600; }
.alive-rel .ic { flex: none; margin-top: 2px; }
.alive-last { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.alive-last .sub { flex: 1; min-width: 0; }
.alive-q { margin: 12px 0 6px; }
.field-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fbtn { min-height: 46px; padding: 0 4px; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font-size: 14.5px; font-weight: 700; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbtn:hover { background: var(--surface-2); }
.fbtn:disabled { opacity: .5; cursor: default; }
.fbtn.f-ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.fbtn.f-bad { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.fbtn.f-warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.fbtn.f-none { color: var(--text-2); }
.field-row.compact .fbtn { min-height: 42px; font-size: 13.5px; }
.bizno { margin-top: 12px; }
.bizno .label { margin-bottom: 6px; }
.bizno-row { display: flex; gap: 8px; }
.bizno-row .input { flex: 1; min-width: 0; }
.bizno-row .btn { flex: none; }
.field-chips { grid-template-columns: repeat(3, 1fr); }
.guide-note { margin: -2px 4px 8px; }
.section-h .count.ok { color: var(--ok); }
.alive-chips { margin-top: 10px; }
.alive-chips .chip { min-height: 38px; font-size: 14px; }
.alive-chips .chip:disabled { opacity: .45; cursor: default; }
.call-row { padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.call-row:last-child { border-bottom: 0; }
.call-top { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.call-top .row-main { color: var(--text); text-decoration: none; }
.call-top .row-title .badge { margin-left: 6px; vertical-align: 1px; }
.call-btn { flex: none; gap: 6px; min-height: 44px; padding: 0 12px; background: var(--primary-soft); color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 35%, transparent); font-weight: 700; }
.call-btn .num { font-variant-numeric: tabular-nums; }
.call-btn small { font-weight: 600; opacity: .8; }
.call-row.done { padding: 8px 14px; background: var(--surface-2); }
.call-done { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 14px; }
.call-done .ic { color: var(--ok); flex: none; }
.call-fin { padding: 14px; text-align: center; }
/* 단추 칸 너비로 맞춤(휴대폰·태블릿 오른쪽 칸처럼 좁은 곳): 두 줄 글자 허용 */
.alive-box, .call-row { container-type: inline-size; }
@container (max-width: 420px) {
  .call-top { flex-wrap: wrap; }
  .call-btn { width: 100%; justify-content: center; }
  .field-row { gap: 5px; }
  .fbtn { font-size: 13.5px; white-space: normal; word-break: keep-all; line-height: 1.15; padding: 2px 2px; }
  .field-row.compact .fbtn { font-size: 13px; }
}

/* 업체 카드 '공공 정보': 만료된 인증은 흐리게 */
.pub-row .badge { margin-left: 6px; }
.pub-row a.sub { display: inline-block; margin-top: 4px; }
.pub-old { opacity: .5; }
