/* =========================================================
   영업왕 디자인 시스템
   레이아웃: 데스크톱 = 좌측 사이드바 + 콘텐츠 / 모바일 = 상단 앱바 + 하단 탭바 (앱 래핑 대비)
   메인 라벤더-블루 + 보조 민트·옐로·스카이·핑크(원장님/상태 구분용)
   ========================================================= */
:root {
  --bg: #F5F4FB;
  --surface: #FFFFFF;
  --surface-2: #F1EFFA;
  --line: #E5E2F3;
  --fg: #25223A;
  --fg-2: #5D5978;
  --fg-3: #9592AD;

  --primary: #7363EE;
  --primary-2: #5A86EE;
  --primary-soft: #ECE9FE;
  --primary-ink: #FFFFFF;
  --grad: linear-gradient(120deg, #8A72F3 0%, #6C7DF0 55%, #5A92EC 100%);

  --mint: #2FAE9B;   --mint-soft: #DFF4EF;
  --yellow: #D9A22A; --yellow-soft: #FBF1D8;
  --sky: #3E9DD8;    --sky-soft: #DFEFFA;
  --pink: #DD6B94;   --pink-soft: #FBE6EE;
  --orange: #E3803F; --orange-soft: #FCEBDD;
  --danger: #DC4F65; --danger-soft: #FCE6EA;

  --shadow: 0 1px 2px rgba(48, 38, 110, .06), 0 6px 20px rgba(48, 38, 110, .06);
  --shadow-lg: 0 20px 60px rgba(30, 22, 80, .22);
  --radius: 14px;
  --radius-sm: 9px;

  --font: 'IBM Plex Sans KR', 'Pretendard', 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --font-num: 'IBM Plex Sans KR', system-ui, sans-serif;

  --sidebar-w: 236px;
  --appbar-h: 56px;
  --tabbar-h: 62px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13121C; --surface: #1C1A29; --surface-2: #24223A; --line: #302D47;
    --fg: #ECEAF7; --fg-2: #AEAACB; --fg-3: #77738F;
    --primary: #9585F8; --primary-2: #7DA2F5; --primary-soft: #2B2652; --primary-ink: #FFFFFF;
    --mint: #4CC9B4; --mint-soft: #16332E; --yellow: #E8BC55; --yellow-soft: #332A14;
    --sky: #67B8EA; --sky-soft: #142C3B; --pink: #EE8DB0; --pink-soft: #3A1D29;
    --orange: #F0A06A; --orange-soft: #3A2516; --danger: #F07085; --danger-soft: #3B1A21;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13121C; --surface: #1C1A29; --surface-2: #24223A; --line: #302D47;
  --fg: #ECEAF7; --fg-2: #AEAACB; --fg-3: #77738F;
  --primary: #9585F8; --primary-2: #7DA2F5; --primary-soft: #2B2652; --primary-ink: #FFFFFF;
  --mint: #4CC9B4; --mint-soft: #16332E; --yellow: #E8BC55; --yellow-soft: #332A14;
  --sky: #67B8EA; --sky-soft: #142C3B; --pink: #EE8DB0; --pink-soft: #3A1D29;
  --orange: #F0A06A; --orange-soft: #3A2516; --danger: #F07085; --danger-soft: #3B1A21;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 20px rgba(0,0,0,.25);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font); font-size: 14px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-num); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 6px; }

/* ---------- 아이콘 ---------- */
.ic { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic-sm { width: 15px; height: 15px; }

/* ---------- 앱 셸 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 20px 14px; gap: 18px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; background: var(--grad); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px; letter-spacing: -.5px;
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -.6px; }
.region-switch {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 11px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 13.5px;
}
.region-switch .ic { width: 16px; height: 16px; }
.region-switch .chev { margin-left: auto; opacity: .7; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group-title { font-size: 11.5px; letter-spacing: .06em; color: var(--fg-3); font-weight: 600; padding: 6px 10px; }
.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  color: var(--fg-2); font-weight: 500; transition: background .15s, color .15s;
}
.nav-link:hover { background: var(--surface-2); color: var(--fg); }
.nav-link.active { background: var(--grad); color: #fff; box-shadow: 0 4px 14px rgba(115, 99, 238, .35); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 12px;
  padding: 14px 28px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.topbar .back { display: none; }
.page-title { font-size: 21px; font-weight: 700; letter-spacing: -.5px; }
.crumb { font-size: 12.5px; color: var(--fg-3); }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.content { padding: 6px 28px 40px; display: flex; flex-direction: column; gap: 18px; }

.appbar, .tabbar { display: none; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font-weight: 600; font-size: 13.5px;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(115, 99, 238, .3); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.05); }
.btn-soft { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.btn-soft:hover { background: var(--primary-soft); filter: brightness(.97); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--danger-soft); filter: brightness(.97); }
.btn-danger-solid { background: var(--danger); color: #fff; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 8px; }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; }
.btn[disabled] { opacity: .45; pointer-events: none; }

/* ---------- 카드/패널 ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px; flex-wrap: wrap; }
.panel-title { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.panel-body { padding: 0 18px 18px; }

/* ---------- 툴바(검색/정렬) ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.toolbar .spacer { flex: 1; }
.search {
  position: relative; display: flex; align-items: center; flex: 1 1 260px; max-width: 360px;
}
.search .ic { position: absolute; left: 11px; color: var(--fg-3); pointer-events: none; }
.search input {
  width: 100%; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2);
  padding: 0 34px 0 36px; outline: none; transition: border-color .15s, background .15s;
}
.search input:focus { border-color: var(--primary); background: var(--surface); }
.search .clear {
  position: absolute; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: var(--line); color: var(--fg-2); display: grid; place-items: center; cursor: pointer;
}
.search .clear .ic { position: static; width: 13px; height: 13px; color: inherit; }
.count-label { font-size: 12.5px; color: var(--fg-3); }

/* 세그먼트 */
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 6px 13px; border-radius: 8px; font-weight: 600; font-size: 13px;
  color: var(--fg-2); cursor: pointer;
}
.seg button.on { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(40, 30, 90, .12); }

/* 칩 */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--fg-2); white-space: nowrap;
}
.chip-primary { background: var(--primary-soft); color: var(--primary); }
.chip-mint { background: var(--mint-soft); color: var(--mint); }
.chip-yellow { background: var(--yellow-soft); color: var(--yellow); }
.chip-sky { background: var(--sky-soft); color: var(--sky); }
.chip-pink { background: var(--pink-soft); color: var(--pink); }
.chip-orange { background: var(--orange-soft); color: var(--orange); }
.chip-danger { background: var(--danger-soft); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--fg-2); cursor: pointer;
}
.filter-chip.on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }

/* ---------- 테이블 ---------- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--fg-3); padding: 11px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface);
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--fg); }
table.data th .sort-ic { display: inline-block; margin-left: 4px; opacity: .35; font-size: 10px; }
table.data th.asc .sort-ic, table.data th.desc .sort-ic { opacity: 1; color: var(--primary); }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr { transition: background .12s; }
table.data tbody tr.clickable { cursor: pointer; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .cell-strong { font-weight: 600; }
table.data .cell-muted { color: var(--fg-3); font-size: 12.5px; white-space: nowrap; }
table.data .ellipsis { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); }
table.data .actions { display: flex; gap: 6px; justify-content: flex-end; white-space: nowrap; }
table.data .w-check { width: 44px; }
.empty-row td { text-align: center; color: var(--fg-3); padding: 40px 14px !important; }

/* 체크박스 */
.cb { appearance: none; -webkit-appearance: none; width: 19px; height: 19px; border-radius: 6px; border: 1.8px solid var(--fg-3); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; flex: none; margin: 0; transition: background .12s, border-color .12s; }
.cb:checked { background: var(--primary); border-color: var(--primary); }
.cb:checked::after { content: ''; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.cb.round { border-radius: 50%; }
.cb.mint:checked { background: var(--mint); border-color: var(--mint); }

/* 일괄 작업 바 */
.bulkbar { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 13px; }
.bulkbar .btn { margin-left: auto; }

/* ---------- 폼 ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.req { color: var(--danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  padding: 0 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--fg-3) 50%), linear-gradient(135deg, var(--fg-3) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.input.locked { background: var(--surface-2); color: var(--fg-2); }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--fg-3); }
.error-text { font-size: 12px; color: var(--danger); display: flex; align-items: center; gap: 5px; }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.repeat-list { display: flex; flex-direction: column; gap: 8px; }
.repeat-row { display: flex; gap: 8px; align-items: center; }
.repeat-row > .input, .repeat-row > .ac { flex: 1; min-width: 0; }
.add-row-btn { align-self: flex-start; }
.km-row { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: center; padding: 10px; border: 1px dashed var(--line); border-radius: 11px; background: var(--surface-2); }
.file-pick { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--fg-2); cursor: pointer; white-space: nowrap; }
.file-pick.has { color: var(--mint); border-color: var(--mint); }
.file-pick input { display: none; }

/* 스위치 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 600; font-size: 13.5px; }
.switch input { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.switch input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: left .15s; }
.switch input:checked { background: var(--primary); }
.switch input:checked::after { left: 21px; }

/* 자동완성 */
.ac { position: relative; }
.ac-list {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 30; max-height: 220px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 11px; box-shadow: var(--shadow-lg); padding: 4px;
}
.ac-item { padding: 9px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ac-item:hover, .ac-item.on { background: var(--primary-soft); }
.ac-item mark { background: transparent; color: var(--primary); font-weight: 700; }
.ac-item .sub { font-size: 12px; color: var(--fg-3); }
.ac-empty { padding: 10px; font-size: 12.5px; color: var(--fg-3); }
.ac-manual { padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 12.5px; color: var(--primary); font-weight: 600; border-top: 1px solid var(--line); margin-top: 2px; }

/* ---------- 모달 ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(22, 18, 48, .45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px); background: var(--surface); border-radius: 18px;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; animation: pop .18s ease-out;
}
.modal.wide { max-width: 720px; }
.modal.narrow { max-width: 400px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 18px 20px 12px; }
.modal-title { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.modal-head .close { margin-left: auto; }
.modal-body { padding: 6px 20px 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }
.confirm-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; margin-bottom: 12px; }
.confirm-icon.danger { background: var(--danger-soft); color: var(--danger); }
.confirm-icon.info { background: var(--primary-soft); color: var(--primary); }
.confirm-icon .ic { width: 24px; height: 24px; }
.confirm-text { color: var(--fg-2); }
.confirm-text strong { color: var(--fg); }
.warn-box { margin-top: 12px; padding: 12px 14px; border-radius: 11px; background: var(--danger-soft); color: var(--danger); font-size: 13px; display: flex; gap: 8px; align-items: flex-start; }
.check-line { margin-top: 14px; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); font-weight: 600; cursor: pointer; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* 상세 정의 리스트 */
.dl { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; margin: 0; }
.dl dt { color: var(--fg-3); font-size: 12.5px; font-weight: 600; padding-top: 1px; }
.dl dd { margin: 0; min-width: 0; word-break: break-word; }

/* 토스트 */
.toast-wrap { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-weight: 600; font-size: 13px; box-shadow: var(--shadow-lg); animation: pop .2s ease-out; display: flex; gap: 8px; align-items: center; }

/* ---------- 캘린더 ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 16px 18px; }
.cal-nav { display: flex; align-items: center; gap: 4px; }
.cal-title { font-size: 18px; font-weight: 700; letter-spacing: -.4px; display: flex; align-items: center; gap: 6px; }
.cal-title select { border: 0; background: transparent; font-weight: 700; font-size: 18px; cursor: pointer; padding: 2px 2px; border-radius: 6px; appearance: none; -webkit-appearance: none; }
.cal-title select:hover { background: var(--surface-2); }
.cal-head .spacer { flex: 1; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.cal-dow { font-size: 12px; font-weight: 600; color: var(--fg-3); text-align: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.cal-dow.sun { color: var(--danger); } .cal-dow.sat { color: var(--primary-2); }
.cal-cell {
  min-height: 108px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px 6px 8px;
  display: flex; flex-direction: column; gap: 4px; cursor: pointer; transition: background .12s; min-width: 0;
}
.cal-cell:nth-child(7n) { border-right: 0; }
.cal-cell:hover { background: var(--surface-2); }
.cal-cell.other { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.cal-cell.other .cal-date { color: var(--fg-3); opacity: .6; }
.cal-date-row { display: flex; align-items: center; gap: 4px; }
.cal-date { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-cell.sun .cal-date { color: var(--danger); }
.cal-cell.sat .cal-date { color: var(--primary-2); }
.cal-cell.today .cal-date { background: var(--grad); color: #fff; }
.cal-date-row .copy-day { margin-left: auto; opacity: 0; }
.cal-cell:hover .copy-day { opacity: 1; }
.cal-markers { display: flex; flex-wrap: wrap; gap: 3px; }
.cal-marker { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 6px; max-width: 100%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-ev { font-size: 11.5px; line-height: 1.35; padding: 4px 6px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; cursor: pointer; }
.cal-ev:hover { filter: brightness(.96); }
.cal-ev.past { background: var(--surface-2); color: var(--fg-3); }
.cal-more { font-size: 11px; color: var(--fg-3); font-weight: 600; padding-left: 4px; }

/* 방문일정 항목 */
.visit-item {
  display: flex; align-items: flex-start; gap: 6px; padding: 5px 6px; border-radius: 8px; background: var(--surface);
  border: 1px solid var(--line); font-size: 11.5px; line-height: 1.35; cursor: pointer; min-width: 0;
}
.visit-item:hover { border-color: var(--primary); }
.visit-item .cb { width: 15px; height: 15px; border-radius: 5px; margin-top: 1px; }
.visit-item .cb:checked::after { width: 4px; height: 7px; }
.visit-item .vi-body { min-width: 0; flex: 1; }
.visit-item .vi-client { font-weight: 700; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit-item .vi-detail { color: var(--primary); font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit-item .vi-content { color: var(--fg-3); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visit-item.done { background: var(--surface-2); }
.visit-item.done .vi-client, .visit-item.done .vi-detail, .visit-item.done .vi-content { text-decoration: line-through; color: var(--fg-3); }
.logged-label { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; font-size: 10.5px; font-weight: 700; color: var(--mint); background: var(--mint-soft); padding: 1px 6px; border-radius: 5px; text-decoration: none !important; }

/* 주간 뷰 */
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.week-col { border-right: 1px solid var(--line); min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.week-col:last-child { border-right: 0; }
.week-col-head { padding: 10px 8px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
.week-col-head .wd { font-size: 12px; color: var(--fg-3); font-weight: 600; }
.week-col-head .wdate { font-weight: 700; font-size: 16px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.week-col.today .wdate { background: var(--grad); color: #fff; }
.week-col.sun .wd, .week-col.sun .wdate { color: var(--danger); }
.week-col.today.sun .wdate { color: #fff; }
.week-col.sat .wd { color: var(--primary-2); }
.week-col-head .copy-day { margin-left: auto; }
.week-col-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; flex: 1; cursor: pointer; }
.week-col-body:hover { background: var(--surface-2); }
.week-col .visit-item { font-size: 12px; }

/* 모바일 일자 리스트 (주간) */
.day-list { display: none; }

/* ---------- 거래처 상세 ---------- */
.client-card { padding: 22px; display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: start; position: relative; overflow: hidden; }
.client-card::before { content: ''; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--grad); }
.client-avatar { width: 56px; height: 56px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; }
.client-avatar .ic { width: 28px; height: 28px; }
.client-name { font-size: 22px; font-weight: 700; letter-spacing: -.5px; }
.client-meta { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 10px; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-item .k { font-size: 11.5px; color: var(--fg-3); font-weight: 600; }
.meta-item .v { font-weight: 600; }
.doctor-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.client-memo { grid-column: 2 / 4; padding: 12px 14px; border-radius: 11px; background: var(--surface-2); color: var(--fg-2); font-size: 13px; display: flex; gap: 8px; }
.client-card .card-actions { display: flex; gap: 6px; }

.month-logs { display: flex; flex-direction: column; }
.log-row { display: grid; grid-template-columns: 74px 1fr auto; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); align-items: center; cursor: pointer; }
.log-row:hover { background: var(--surface-2); }
.log-row .d { font-size: 12.5px; color: var(--fg-3); font-weight: 600; }
.log-row .t { min-width: 0; }
.log-row .t .p { font-weight: 600; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.log-row .t .c { color: var(--fg-2); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 체크리스트 ---------- */
.period-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.period-label { font-weight: 700; font-size: 15px; min-width: 150px; text-align: center; font-variant-numeric: tabular-nums; }
.todo-group-title { padding: 12px 18px 6px; font-size: 12px; font-weight: 700; color: var(--fg-3); display: flex; align-items: center; gap: 8px; }
.todo { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.todo:hover { background: var(--surface-2); }
.todo-main { flex: 1; min-width: 0; }
.todo-task { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo-sub { font-size: 12.5px; color: var(--fg-3); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.todo.done .todo-task { text-decoration: line-through; color: var(--fg-3); }
.todo.done { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.todo .due { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.todo .due.overdue { color: var(--danger); }
.todo-actions { display: flex; gap: 4px; }

/* ---------- 지역 선택 (홈) ---------- */
.home {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 60%),
    radial-gradient(700px 500px at 110% 110%, color-mix(in srgb, var(--mint) 20%, transparent), transparent 60%),
    var(--bg);
}
.home-card { width: 100%; max-width: 420px; padding: 32px 28px 26px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.home-logo { width: 64px; height: 64px; border-radius: 20px; background: var(--grad); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 28px rgba(115, 99, 238, .4); }
.home-logo .ic { width: 32px; height: 32px; stroke-width: 2; }
.home-title { font-size: 30px; font-weight: 700; letter-spacing: -1px; margin-top: 18px; }
.home-sub { color: var(--fg-2); margin-top: 4px; }
.home-form { margin-top: 26px; display: flex; flex-direction: column; gap: 12px; }
.home-form .select { height: 50px; font-size: 15px; font-weight: 600; border-radius: 13px; }
.home-form .btn-primary { height: 50px; border-radius: 13px; font-size: 15px; }
.home-links { display: flex; justify-content: space-between; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.region-list { display: flex; flex-direction: column; }
.region-item { display: flex; align-items: center; gap: 10px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.region-item:last-child { border-bottom: 0; }
.region-item .name { font-weight: 600; flex: 1; min-width: 0; }
.region-item .input { height: 34px; }

/* ---------- 제품 ---------- */
.km-list { display: flex; flex-direction: column; gap: 8px; }
.km-item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.km-item .idx { width: 24px; height: 24px; border-radius: 7px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.km-item .txt { flex: 1; min-width: 0; font-weight: 600; }
.brochure-view { display: flex; justify-content: center; background: var(--surface-2); border-radius: 12px; padding: 12px; }
.brochure-view img { max-height: 70vh; border-radius: 8px; box-shadow: var(--shadow); }

/* ---------- 설정 ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 18px; align-items: start; }
.notice { padding: 14px 16px; border-radius: 12px; background: var(--yellow-soft); color: var(--fg); font-size: 13px; display: flex; gap: 10px; }
.notice .ic { color: var(--yellow); margin-top: 1px; }
.notice ol { margin: 6px 0 0; padding-left: 18px; color: var(--fg-2); }
.status-line { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.preview-msg { background: #B2C7D9; border-radius: 14px; padding: 16px; }
.preview-bubble { background: #fff; color: #222; border-radius: 4px 14px 14px 14px; overflow: hidden; font-size: 12.5px; max-width: 260px; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.preview-bubble .hd { background: #FEE500; padding: 10px 12px; font-weight: 700; }
.preview-bubble .bd { padding: 12px; line-height: 1.6; white-space: pre-line; }

/* ---------- 심포지움 ---------- */
.sym-ev { background: linear-gradient(120deg, color-mix(in srgb, #8A72F3 18%, var(--surface)), color-mix(in srgb, #5A92EC 18%, var(--surface))); color: var(--primary); border-left: 3px solid var(--primary); border-radius: 4px 7px 7px 4px; }
.attendee { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.attendee:last-child { border-bottom: 0; }
.attendee .who { flex: 1; min-width: 0; }
.attendee .who .n { font-weight: 600; }
.attendee .who .s { font-size: 12px; color: var(--fg-3); }
.att-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }
.upcoming { display: flex; flex-direction: column; }
.upcoming-item { display: flex; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); cursor: pointer; align-items: center; }
.upcoming-item:hover { background: var(--surface-2); }
.date-badge { width: 52px; flex: none; text-align: center; border-radius: 12px; background: var(--primary-soft); color: var(--primary); padding: 6px 0; }
.date-badge .m { font-size: 11px; font-weight: 600; }
.date-badge .dd { font-size: 20px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.upcoming-item .info { flex: 1; min-width: 0; }
.upcoming-item .info .n { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upcoming-item .info .s { font-size: 12.5px; color: var(--fg-3); }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }

/* 보고용 복사 미리보기 */
.report-pre { white-space: pre-wrap; background: var(--surface-2); border-radius: 12px; padding: 14px 16px; font-size: 13px; line-height: 1.7; max-height: 50vh; overflow-y: auto; margin: 0; font-family: var(--font); }

/* =========================================================
   반응형
   ========================================================= */
@media (max-width: 1100px) {
  .layout-2, .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .sidebar, .topbar { display: none; }
  .appbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
    height: var(--appbar-h); padding: 0 12px; background: var(--surface); border-bottom: 1px solid var(--line);
  }
  .appbar .title { font-size: 17px; font-weight: 700; letter-spacing: -.4px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .appbar .region-pill { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 12.5px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--fg-3); padding: 4px 0; background: none; border: 0; cursor: pointer; }
  .tab .ic { width: 22px; height: 22px; }
  .tab.active { color: var(--primary); }
  .content { padding: 14px 12px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); gap: 14px; }
  .hide-m { display: none !important; }
  .page-actions-m { display: flex; gap: 8px; flex-wrap: wrap; }
  .fab {
    position: fixed; right: 16px; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); z-index: 35;
    width: 54px; height: 54px; border-radius: 18px; background: var(--grad); color: #fff; border: 0; display: grid; place-items: center;
    box-shadow: 0 10px 26px rgba(115, 99, 238, .45); cursor: pointer;
  }
  .fab .ic { width: 24px; height: 24px; stroke-width: 2.2; }
  .toolbar, .period-bar, .cal-head { padding: 12px; }
  .search { max-width: none; flex-basis: 100%; }
  table.data td, table.data th { padding: 12px 10px; }
  .panel { border-radius: 14px; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal, .modal.wide, .modal.narrow { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .row-2 { grid-template-columns: 1fr; }
  .client-card { grid-template-columns: 1fr; padding: 18px; gap: 12px; }
  .client-card .client-avatar { display: none; }
  .client-card .card-actions { position: absolute; top: 14px; right: 14px; }
  .client-memo { grid-column: auto; }
  .client-name { font-size: 19px; padding-right: 80px; }
  .cal-cell { min-height: 64px; padding: 4px 2px 6px; align-items: center; }
  .cal-cell .cal-markers { justify-content: center; }
  .cal-marker .mk-text { display: none; }
  .cal-marker { padding: 0; background: transparent !important; }
  .cal-ev, .cal-cell .visit-item { display: none; }
  .cal-cell .m-count { display: inline-grid; }
  .cal-date-row .copy-day { display: none; }
  .week-grid { display: none; }
  .day-list { display: flex; flex-direction: column; }
  .day-list .dl-day { border-top: 1px solid var(--line); padding: 12px; }
  .day-list .dl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
  .day-list .dl-head .dd { font-weight: 700; }
  .day-list .dl-head .copy-day { margin-left: auto; }
  .day-list .visit-item { font-size: 13px; padding: 10px; }
  .day-list .dl-empty { font-size: 12.5px; color: var(--fg-3); padding: 4px 2px; }
  .sel-day { border-top: 1px solid var(--line); }
  .att-row { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 80px 1fr; }
  .toast-wrap { bottom: calc(var(--tabbar-h) + 20px); }
}
@media (min-width: 861px) {
  .fab, .page-actions-m, .m-only { display: none !important; }
}
.m-count { display: none; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 700; place-items: center; }

/* 더보기 시트 */
.sheet-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.sheet-menu a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 6px; border-radius: 14px; background: var(--surface-2); font-weight: 600; font-size: 12.5px; text-align: center; }
.sheet-menu a .ic { width: 24px; height: 24px; color: var(--primary); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- 조정 --- */
table.data td { white-space: nowrap; }
table.data td .filter-chips { flex-wrap: nowrap; }
.logged-label { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.cal-date-row .copy-day { width: 24px; height: 24px; }
.todo-actions { min-width: 68px; justify-content: flex-end; }
.sym-ev { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }

/* =========================================================
   v2: 회사·지역, 로그인, 페이지 나누기, 목록 보기, 카카오
   ========================================================= */
.region-switch { align-items: center; }
.rs-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.rs-text .rs-co { font-size: 11.5px; font-weight: 600; opacity: .75; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-row { display: flex; align-items: center; gap: 10px; padding: 10px 6px 2px; margin-top: 6px; border-top: 1px solid var(--line); }
.user-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; flex: none; }
.user-name { flex: 1; min-width: 0; display: flex; flex-direction: column; font-weight: 600; font-size: 13px; line-height: 1.3; }
.user-name small { font-weight: 500; color: var(--fg-3); font-size: 11.5px; }

/* 페이지 나누기 */
.pager { display: flex; align-items: center; gap: 4px; padding: 12px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.pager .info { font-size: 12.5px; color: var(--fg-3); margin-right: auto; font-variant-numeric: tabular-nums; }
.pager button { min-width: 32px; height: 32px; padding: 0 6px; border-radius: 8px; border: 0; background: transparent; font-weight: 600; font-size: 13px; color: var(--fg-2); cursor: pointer; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.pager button:hover:not(:disabled) { background: var(--surface-2); }
.pager button.on { background: var(--grad); color: #fff; }
.pager button:disabled { opacity: .3; cursor: default; }
.pager .gap { color: var(--fg-3); padding: 0 2px; }
.modal .pager { padding: 12px 0 0; }

/* 여러 줄 내용 */
.pre { white-space: pre-line; word-break: break-word; }
.cal-cell .visit-item .vi-content { white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.week-col .visit-item .vi-content, .day-list .visit-item .vi-content { white-space: pre-line; overflow: visible; text-overflow: clip; }
.week-col .visit-item .vi-client, .week-col .visit-item .vi-detail, .day-list .visit-item .vi-client, .day-list .visit-item .vi-detail { white-space: normal; }

/* 방문 일정 목록 보기 */
.vlist-day { border-top: 1px solid var(--line); }
.vlist-day:first-child { border-top: 0; }
.vlist-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px 6px; position: sticky; top: 0; }
.vlist-head .dd { font-weight: 700; font-size: 14px; }
.vlist-head .dd.today { color: var(--primary); }
.vlist-head .tools { margin-left: auto; display: flex; gap: 4px; }
.vrow { display: flex; align-items: flex-start; gap: 12px; padding: 12px 18px; cursor: pointer; transition: background .12s; }
.vrow:hover { background: var(--surface-2); }
.vrow .cb { margin-top: 2px; }
.vrow-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.vrow-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vrow-top strong { font-size: 14px; }
.vrow-detail { display: flex; gap: 6px; flex-wrap: wrap; }
.vrow-content { color: var(--fg-2); font-size: 13px; white-space: pre-line; word-break: break-word; line-height: 1.6; }
.vrow.done .vrow-top strong, .vrow.done .vrow-content, .vrow.done .vrow-detail .chip { text-decoration: line-through; color: var(--fg-3); }
.vrow.done { background: color-mix(in srgb, var(--surface-2) 50%, transparent); }
.vrow .logged-label { margin-top: 0; text-decoration: none; }
.vlist-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* 로그인 / 회원가입 */
.auth-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); text-align: center; color: var(--fg-2); font-size: 13px; }
.auth-foot a { color: var(--primary); font-weight: 700; }
.inline-check { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--fg-2); cursor: pointer; }
.home-field { display: flex; flex-direction: column; gap: 6px; }
.home-field .lab { display: flex; align-items: center; justify-content: space-between; }
.home-field .lab a, .home-field .lab button { font-size: 12px; font-weight: 600; color: var(--primary); background: none; border: 0; cursor: pointer; padding: 2px 4px; }
.home-user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-2); }
.home-user strong { color: var(--fg); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* 카카오 */
.btn-kakao { background: #FEE500; color: #191600; border-color: transparent; }
.btn-kakao:hover { background: #FEE500; filter: brightness(.96); }
.kakao-status { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.kakao-status .ks-ic { width: 40px; height: 40px; border-radius: 12px; background: #FEE500; color: #191600; display: grid; place-items: center; flex: none; }
.kakao-status .ks-text { flex: 1; min-width: 160px; }
.kakao-status .ks-text strong { display: block; }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { flex: 1; min-width: 0; }
.preview-bubble .btn-row { border-top: 1px solid #eee; padding: 10px 12px; text-align: center; font-weight: 600; color: #333; }
.section-sub { font-size: 12.5px; color: var(--fg-3); margin: -8px 18px 14px; }
.admin-chip { margin-left: 4px; }
.km-img { display: flex; align-items: center; gap: 2px; }
.btn.disabled { opacity: .45; }

.error-text.warn { color: var(--orange); }

/* 여러 날 심포지움: 칸을 넘어 이어지는 막대 */
.sym-ev.cont-l { margin-left: -7px; border-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; padding-left: 13px; }
.sym-ev.cont-r { margin-right: -7px; border-top-right-radius: 0; border-bottom-right-radius: 0; }

/* 브로셔 뷰어 */
.modal.viewer { max-width: min(1200px, 100%); height: calc(100vh - 40px); }
.viewer-head { flex-wrap: wrap; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.viewer-head .modal-title { flex: 1 1 160px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; }
.viewer-tools { display: flex; align-items: center; gap: 2px; background: var(--surface-2); border-radius: 10px; padding: 2px; }
.viewer-tools [data-z="out"], .viewer-tools [data-z="in"] { font-size: 18px; font-weight: 700; }
.viewer-pct { min-width: 48px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--fg-2); }
.viewer-actions { display: flex; align-items: center; gap: 6px; }
.viewer-actions .close { margin-left: 0; }
.viewer-stage { flex: 1; min-height: 0; overflow: auto; display: flex; background: var(--surface-2); touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; }
.viewer-stage.dragging { cursor: grabbing; }
.viewer-stage > img { margin: auto; flex: none; max-width: none; display: block; box-shadow: var(--shadow); background: #fff; -webkit-user-drag: none; }
.viewer-stage > iframe { flex: 1; width: 100%; border: 0; background: #fff; }
.viewer-stage.pdf { touch-action: auto; cursor: default; }
.viewer-foot { padding: 8px 14px; border-top: 1px solid var(--line); text-align: center; font-size: 12px; }
.pdf-card { margin: auto; text-align: center; padding: 28px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pdf-card .ic { width: 48px; height: 48px; color: var(--danger); }
.file-badge { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 10.5px; font-weight: 700; background: var(--danger-soft); color: var(--danger); }
.km-item .km-actions { display: flex; gap: 6px; align-items: center; }
@media (max-width: 860px) {
  .modal.viewer { height: 92vh; }
  .viewer-head .modal-title { flex-basis: 100%; }
}
