/* 운영 콘솔 (2026-10-13 개편, 2026-10-14 경영 브리핑·메뉴 재편)
   테마: 종이 위 잉크. 미색 바탕 위 흰 작업면, 먹색 글자, 강조는 진한 남색 하나(지금 처리할 것과 주 버튼에만).
   서체: Pretendard 하나 — 한글 표·숫자가 많은 업무 화면에서 자간이 고르고 tabular 숫자를 지원해서.
   크기 12/14/16/20/28 · 굵기 400/500/700 · 반경 4/8(점·뱃지 원형 9999) · 선 1px · 그림자 2단계 · 간격 4의 배수 */
:root {
  --bg: #f6f3ee; --surface: #ffffff; --sunken: #f1ede6; --ink: #1b1a18; --muted: #6e6962; --faint: #9a948b; --line: #e4dfd6;
  --accent: #1d3fbf; --accent-ink: #ffffff; --accent-soft: #e8ecfb; --ok: #2f6b3f; --ok-soft: #e5f0e7; --warn: #9a5b0c; --warn-soft: #f8ecda; --bad: #a3312a; --bad-soft: #f8e3e1;
  --fs-xs: 12px; --fs-s: 14px; --fs-m: 16px; --fs-l: 20px; --fs-xl: 28px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r1: 4px; --r2: 8px; --round: 9999px;
  --sh1: 0 1px 2px rgba(27,26,24,.06); --sh2: 0 12px 40px rgba(27,26,24,.18);
  --side: 232px; --ctl: 32px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #151412; --surface: #1d1c1a; --sunken: #23211e; --ink: #ebe9e4; --muted: #a39e96; --faint: #7b766f; --line: #2f2d29;
    --accent: #93a6ff; --accent-ink: #11131c; --accent-soft: #23294a; --ok: #8cc79a; --ok-soft: #1f2e23; --warn: #e0a85a; --warn-soft: #33281a; --bad: #ec8b84; --bad-soft: #3a2220;
    --sh1: none; --sh2: 0 12px 40px rgba(0,0,0,.5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #151412; --surface: #1d1c1a; --sunken: #23211e; --ink: #ebe9e4; --muted: #a39e96; --faint: #7b766f; --line: #2f2d29;
  --accent: #93a6ff; --accent-ink: #11131c; --accent-soft: #23294a; --ok: #8cc79a; --ok-soft: #1f2e23; --warn: #e0a85a; --warn-soft: #33281a; --bad: #ec8b84; --bad-soft: #3a2220;
  --sh1: none; --sh2: 0 12px 40px rgba(0,0,0,.5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 400 var(--fs-s)/1.55 "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── 뼈대 */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: var(--s4); padding: var(--s5) var(--s3) var(--s4); border-right: 1px solid var(--line); background: var(--bg); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s2); }
.brand .mark { display: grid; place-items: center; width: var(--ctl); height: var(--ctl); border-radius: var(--r2); background: var(--ink); color: var(--bg); font-weight: 700; flex: none; }
.brand b { display: block; font-size: var(--fs-s); font-weight: 700; letter-spacing: .02em; line-height: 1.3; white-space: nowrap; }
.brand span:not(.mark) { color: var(--muted); font-size: var(--fs-xs); }
.search-btn { display: flex; align-items: center; justify-content: space-between; height: var(--ctl); padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface); color: var(--muted); font-size: var(--fs-xs); cursor: pointer; }
kbd { font: inherit; font-size: var(--fs-xs); color: var(--faint); }
.nav { display: flex; flex-direction: column; gap: 0; }
.nav .group { margin: var(--s3) var(--s2) var(--s1); color: var(--faint); font-size: var(--fs-xs); }
.nav .group:first-child { margin-top: 0; }
.nav a { position: relative; display: flex; align-items: center; gap: var(--s2); height: var(--ctl); padding: 0 var(--s2); border-radius: var(--r1); color: var(--muted); text-decoration: none; }
.nav a .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--sunken); color: var(--ink); }
.nav a.on { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--sh1); }
.nav a.on::before { content: ""; position: absolute; left: calc(-1 * var(--s3)); top: var(--s2); bottom: var(--s2); width: 2px; border-radius: var(--r1); background: var(--accent); }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on .ico { color: var(--accent); }
.badge { min-width: 20px; height: 20px; padding: 0 var(--s1); border-radius: var(--round); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); font-weight: 500; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.badge.quiet { background: var(--sunken); color: var(--muted); }
.side-foot { margin-top: auto; display: grid; gap: var(--s3); padding: var(--s3) 0 0; border-top: 1px solid var(--line); font-size: var(--fs-xs); color: var(--muted); }
.health-line { display: flex; align-items: center; gap: var(--s2); padding: var(--s2); border-radius: var(--r1); text-decoration: none; color: var(--ink); }
.health-line:hover { background: var(--sunken); }
.health-line small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.who { display: flex; justify-content: space-between; gap: var(--s2); padding: 0 var(--s2); }
.who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot button { flex: none; padding: 0; border: 0; background: none; color: var(--faint); font-size: var(--fs-xs); cursor: pointer; text-decoration: underline; }
.dot { width: 8px; height: 8px; border-radius: var(--round); background: var(--faint); flex: none; }
.dot.on { background: var(--ok); } .dot.off, .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s3); height: 56px; padding: 0 var(--s6); border-bottom: 1px solid var(--line); background: var(--bg); }
.crumb { color: var(--muted); font-size: var(--fs-s); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb b { color: var(--ink); font-weight: 500; }
.crumb i { margin: 0 var(--s2); color: var(--faint); font-style: normal; }
.mockflag { padding: 0 var(--s2); border-radius: var(--r1); background: var(--warn-soft); color: var(--warn); font-size: var(--fs-xs); font-weight: 500; line-height: 24px; }
.grow { flex: 1; }
.sync { color: var(--faint); font-size: var(--fs-xs); white-space: nowrap; }
.menu-btn { display: none; }
.content { width: 100%; max-width: 1200px; padding: var(--s6); outline: none; }

/* ── 머리말: 결론 문장이 화면의 주 요소 */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; margin-bottom: var(--s5); }
.head h1 { margin: 0; font-size: var(--fs-xl); font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.head p { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--fs-s); }
.head .acts { display: flex; gap: var(--s2); flex-wrap: wrap; }
h2 { display: flex; align-items: baseline; gap: var(--s2); margin: var(--s7) 0 var(--s3); font-size: var(--fs-m); font-weight: 700; }
h2 small { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
h3 { margin: 0 0 var(--s2); font-size: var(--fs-s); font-weight: 700; }

/* ── 단추·입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); height: var(--ctl); padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface); color: var(--ink); font-size: var(--fs-s); font-weight: 500; white-space: nowrap; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; color: var(--muted); }
.btn.tiny { height: auto; padding: var(--s1) var(--s2); font-size: var(--fs-xs); }   /* 표 줄 안에 들어가는 버튼 */
.btn.ghost:hover { background: var(--sunken); color: var(--ink); }
.btn:disabled { opacity: .5; cursor: progress; }
.input, select.input, textarea.input { width: 100%; min-height: var(--ctl); padding: var(--s1) var(--s3); border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface); font-size: var(--fs-s); }
textarea.input { min-height: 120px; padding: var(--s2) var(--s3); line-height: 1.6; resize: vertical; }
.input:focus { border-color: var(--accent); outline: none; }
label.fld { display: grid; gap: var(--s1); font-size: var(--fs-xs); color: var(--muted); }
label.fld > span { font-weight: 500; }
.row-gap { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }

/* ── 상태 표시 */
.pill { display: inline-flex; align-items: center; gap: var(--s1); height: 20px; padding: 0 var(--s2); border-radius: var(--r1); background: var(--sunken); color: var(--muted); font-size: var(--fs-xs); font-weight: 500; white-space: nowrap; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

/* ── 처리할 일(오늘): 화면에서 유일하게 강조 테두리를 쓰는 덩어리 */
.inbox { border: 1px solid var(--accent); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh1); overflow: hidden; }
.inbox.clear { border-color: var(--line); }
.task { display: grid; grid-template-columns: 112px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.task:first-child { border-top: 0; }
.task .kind { color: var(--accent); font-size: var(--fs-xs); font-weight: 500; }
.task .what { min-width: 0; }
.task .what b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task .what small { color: var(--muted); font-size: var(--fs-xs); }
.task .acts { display: flex; gap: var(--s2); }
.allclear { padding: var(--s5); color: var(--muted); }

/* 주문 흐름: 단계별 건수를 막대 길이로 */
.pipe { display: grid; gap: var(--s2); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.pipe a { display: grid; grid-template-columns: 120px minmax(0, 1fr) 48px; gap: var(--s3); align-items: center; text-decoration: none; padding: var(--s1) 0; }
.pipe .bar { height: 12px; border-radius: var(--r1); background: var(--sunken); overflow: hidden; }
.pipe .bar i { display: block; height: 100%; background: var(--ink); border-radius: var(--r1); }
.pipe a.lead .bar i { background: var(--accent); }
.pipe a:hover span:first-child { text-decoration: underline; }

/* ── 탭 */
.tabs { display: flex; gap: var(--s1); flex-wrap: wrap; margin-bottom: var(--s3); border-bottom: 1px solid var(--line); }
.tabs a { display: inline-flex; align-items: center; gap: var(--s2); height: 36px; padding: 0 var(--s3); margin-bottom: -1px; border-bottom: 1px solid transparent; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { border-bottom-color: var(--ink); box-shadow: inset 0 -1px 0 var(--ink); color: var(--ink); font-weight: 500; }
.tabs .n { color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

.toolbar { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; margin-bottom: var(--s3); }
.toolbar .input { width: 280px; }

/* ── 표 */
.card { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh1); }
.tablewrap { border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); overflow-x: auto; box-shadow: var(--sh1); }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 var(--s3); border-bottom: 1px solid var(--line); background: var(--sunken); color: var(--muted); font-size: var(--fs-xs); font-weight: 500; text-align: left; white-space: nowrap; }
td { height: 48px; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--sunken); }
tr.sel td { background: var(--accent-soft); }
td.chk, th.chk { width: 40px; padding-right: 0; }
td.mono { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub, td .sub { display: block; color: var(--muted); font-size: var(--fs-xs); }
/* 글씨만 경고색으로. .pill.bad·.toast.bad 는 선택자가 더 좁아 그대로 이긴다 */
.bad { color: var(--bad); }
.trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: var(--s7) var(--s5); text-align: center; color: var(--muted); }
.empty b { display: block; margin-bottom: var(--s1); color: var(--ink); font-weight: 500; font-size: var(--fs-m); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: var(--s2) var(--s3); color: var(--muted); font-size: var(--fs-xs); }

/* 선택했을 때 아래에 뜨는 일괄 처리 막대 */
.bulkbar { position: sticky; bottom: var(--s4); z-index: 4; display: flex; align-items: center; gap: var(--s3); width: fit-content; margin: var(--s3) auto 0; padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: var(--r2); background: var(--ink); color: var(--bg); box-shadow: var(--sh2); }
.bulkbar .btn { border-color: transparent; }

/* ── 받은편지함 두 칸(상담·문의) */
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); min-height: 560px; border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh1); overflow: hidden; }
.list { border-right: 1px solid var(--line); overflow-y: auto; max-height: calc(100vh - 220px); }
.list a { display: block; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); text-decoration: none; }
.list a:hover { background: var(--sunken); }
.list a.on { background: var(--accent-soft); }
.list .t { display: flex; justify-content: space-between; gap: var(--s2); }
.list .t b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list .t time { color: var(--faint); font-size: var(--fs-xs); white-space: nowrap; }
.list p { margin: var(--s1) 0 0; color: var(--muted); font-size: var(--fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pane { display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 220px); }
.pane-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.pane-body { flex: 1; overflow-y: auto; padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); }
.pane-foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--line); display: grid; gap: var(--s2); }
.pane-empty { margin: auto; color: var(--muted); text-align: center; padding: var(--s7); }

.msg { max-width: 78%; padding: var(--s2) var(--s3); border-radius: var(--r2); background: var(--sunken); white-space: pre-wrap; word-break: keep-all; }
.msg.user { align-self: flex-start; }
.msg.assistant { align-self: flex-end; background: var(--surface); border: 1px solid var(--line); }
.msg.owner { align-self: flex-end; background: var(--accent-soft); }
.msg header svg.genie { display: inline-block; vertical-align: -3px; margin-right: var(--s1); }
.msg header { margin-bottom: var(--s1); color: var(--muted); font-size: var(--fs-xs); }
.quote { padding: var(--s3) var(--s4); border-left: 1px solid var(--line); background: var(--sunken); border-radius: 0 var(--r1) var(--r1) 0; white-space: pre-wrap; }

/* ── 오른쪽 서랍(주문 상세) */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(27,26,24,.28); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(560px, 100vw); display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--sh2); }
.drawer .dh { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s5) var(--s4); border-bottom: 1px solid var(--line); }
.drawer .dh h2 { margin: 0; font-size: var(--fs-l); }
.drawer .db { flex: 1; overflow-y: auto; padding: var(--s5); display: grid; gap: var(--s5); align-content: start; }
.drawer section h3 { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.next { padding: var(--s4); border: 1px solid var(--accent); border-radius: var(--r2); background: var(--accent-soft); display: grid; gap: var(--s3); }
.next p { margin: 0; }
dl.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s2) var(--s3); margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.items { display: grid; gap: var(--s2); }
.items div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); }
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.timeline li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--s3); color: var(--muted); }
.timeline time { color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }

/* ── 모달·검색·알림 */
.modal-wrap, .palette-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: start center; padding: 12vh var(--s4) var(--s4); background: rgba(27,26,24,.32); }
.modal { width: min(520px, 100%); max-height: 76vh; overflow-y: auto; padding: var(--s5); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh2); display: grid; gap: var(--s4); }
.modal h2 { margin: 0; font-size: var(--fs-l); }
.modal .foot { display: flex; justify-content: flex-end; gap: var(--s2); }
.palette { width: min(600px, 100%); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh2); overflow: hidden; }
.palette input { width: 100%; height: 56px; padding: 0 var(--s5); border: 0; border-bottom: 1px solid var(--line); background: none; font-size: var(--fs-m); outline: none; }
.kres { max-height: 50vh; overflow-y: auto; padding: var(--s2); }
.kres p { margin: var(--s2) var(--s3) var(--s1); color: var(--faint); font-size: var(--fs-xs); }
.kres a { display: flex; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s3); border-radius: var(--r1); text-decoration: none; }
.kres a.on, .kres a:hover { background: var(--sunken); }
.kres a span { color: var(--muted); font-size: var(--fs-xs); }
.toasts { position: fixed; right: var(--s5); bottom: var(--s5); z-index: 40; display: grid; gap: var(--s2); }
.toast { max-width: 380px; padding: var(--s3) var(--s4); border-radius: var(--r2); background: var(--ink); color: var(--bg); box-shadow: var(--sh2); }
.toast.bad { background: var(--bad); color: #fff; }

/* 후기 카드 */
.rv { display: grid; grid-template-columns: 168px minmax(0, 1fr) auto; gap: var(--s4); padding: var(--s4); border-top: 1px solid var(--line); }
.rv:first-child { border-top: 0; }
.photos { display: grid; grid-template-columns: repeat(2, 80px); gap: var(--s2); align-content: start; }
.photos a { display: block; }
.photos img, .photos span { width: 80px; height: 80px; border-radius: var(--r1); object-fit: cover; background: var(--sunken); }
.photos span { display: grid; place-items: center; color: var(--faint); font-size: var(--fs-xs); }
.rv .acts { display: grid; gap: var(--s2); align-content: start; }
.reasons { margin: var(--s2) 0 0; padding: 0; list-style: none; display: flex; gap: var(--s1); flex-wrap: wrap; }

/* 설정 */
.settings { display: grid; gap: var(--s3); max-width: 720px; }
.switch { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); cursor: pointer; }
.switch input { margin-top: var(--s1); accent-color: var(--accent); }
.switch small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.conn { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.conn:first-child { border-top: 0; }
.conn small { display: block; color: var(--muted); font-size: var(--fs-xs); }
code { padding: 0 var(--s1); border-radius: var(--r1); background: var(--sunken); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--fs-xs); }
pre.log { margin: 0; padding: var(--s3); border-radius: var(--r1); background: var(--sunken); font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: var(--fs-xs); white-space: pre-wrap; word-break: break-all; max-height: 240px; overflow: auto; }

/* 로그인 */
.login { max-width: 400px; margin: 18vh auto; padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh1); display: grid; gap: var(--s3); }
.login h1 { margin: 0; font-size: var(--fs-l); }
.login p { margin: 0; color: var(--muted); }

/* 불러오는 중 */
.skel { height: 14px; border-radius: var(--r1); background: linear-gradient(90deg, var(--sunken), var(--line), var(--sunken)); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }

/* ── 좁은 화면 */
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 25; left: 0; width: 264px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--sh2); }
  .side.open { transform: none; }
  .menu-btn { display: inline-flex; height: var(--ctl); padding: 0 var(--s3); border: 1px solid var(--line); border-radius: var(--r1); background: var(--surface); cursor: pointer; }
  .topbar { padding: 0 var(--s4); }
  .sync { display: none; }
  .content { padding: var(--s5) var(--s4); }
  .head h1 { font-size: var(--fs-l); }
  .task { grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .split.has-sel .list { display: none; }
  .split:not(.has-sel) .pane { display: none; }
  .list, .pane { max-height: none; }
  .rv { grid-template-columns: minmax(0, 1fr); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .toolbar .input { width: 100%; }
  .pipe a { grid-template-columns: 96px minmax(0, 1fr) 40px; }
  .hide-m { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.hide-d { display: none; }
@media (max-width: 900px) { .hide-d { display: inline-flex; } }

/* 마케팅 키워드 */
.kw-bar { display: flex; align-items: center; gap: var(--s2); min-width: 160px; }
.kw-bar i { display: block; height: 8px; border-radius: var(--r1); background: var(--ink); }
.kw-bar.lead i { background: var(--accent); }
.chart { width: 100%; height: 220px; }
.chart-l { height: 280px; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 24px; }
.spark i { display: block; width: 6px; background: var(--faint); border-radius: 1px; }
.spark i:last-child { background: var(--ink); }
.up { color: var(--ok); } .down { color: var(--bad); }
.kw-todo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.kw-todo .card { padding: var(--s4); }
.kw-todo h3 { margin: 0 0 var(--s2); }
.kw-todo ul { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); }
@media (max-width: 900px) { .kw-todo { grid-template-columns: minmax(0, 1fr); } }

/* 인스타그램 프로필 미리 보기(4:5 그리드) */
.ig-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); max-width: 720px; }
.ig-tile { position: relative; aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 0; background: var(--sunken); overflow: hidden; cursor: pointer; }
.ig-tile img, .ig-tile video { display: block; width: 100%; height: 100%; object-fit: cover; }
.ig-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ig-n { position: absolute; top: var(--s2); left: var(--s2); min-width: 24px; height: 24px; padding: 0 var(--s1); border-radius: var(--r1); background: var(--ink); color: var(--surface); font-size: var(--fs-xs); font-weight: 500; line-height: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.ig-k { position: absolute; top: var(--s2); right: var(--s2); padding: 0 var(--s2); border-radius: var(--r1); background: var(--surface); color: var(--ink); font-size: var(--fs-xs); line-height: 20px; }
.ig-st { position: absolute; left: var(--s2); bottom: var(--s2); }

/* ── 경영 브리핑(2026-10-14): 결론(h1) 다음 덩어리는 핵심 지표 네 칸. 값 크기는 h1보다 한 단계 작게 */
.pad { padding: var(--s4); }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.kpi { display: grid; gap: var(--s1); align-content: start; padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh1); }
.kpi .kl { color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }
.kpi .kv { font-size: var(--fs-l); font-weight: 700; line-height: 1.3; }
.kpi .kn { color: var(--faint); font-size: var(--fs-xs); }
.kspark { display: block; margin-top: var(--s2); }
.kspark rect { fill: var(--line); }
.kspark rect.last { fill: var(--ink); }
.delta { color: var(--muted); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.delta small { margin-left: var(--s1); color: var(--faint); font-size: var(--fs-xs); }
.delta.up { color: var(--ok); } .delta.down { color: var(--bad); }
.brief-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s4); }
.sigs { list-style: none; margin: 0; padding: 0; }
.sigs li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
.sigs li:first-child { border-top: 0; }
.sigs .tx b { display: block; font-weight: 500; }
.sigs .tx small { color: var(--muted); font-size: var(--fs-xs); }
.queue { display: grid; }
.qrow { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; gap: var(--s3); align-items: center; min-height: 48px; padding: var(--s2) var(--s4); border-top: 1px solid var(--line); text-decoration: none; }
.qrow:first-child { border-top: 0; }
.qrow:hover { background: var(--sunken); }
.qrow small { color: var(--muted); font-size: var(--fs-xs); text-align: right; }
.qrow b { font-size: var(--fs-m); font-weight: 700; text-align: right; }
.qrow b.zero { color: var(--faint); font-weight: 400; }
.trust { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); text-decoration: none; }
.trust:hover { border-color: var(--faint); }
.trust small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.trust .go { margin-left: auto; color: var(--muted); font-size: var(--fs-xs); white-space: nowrap; }

.moves { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.move { display: flex; flex-direction: column; padding: var(--s4); }
.move ol { margin: 0 0 var(--s3); padding-left: var(--s5); display: grid; gap: var(--s2); }
.move li small { display: block; color: var(--muted); font-size: var(--fs-xs); }
.move li a { text-decoration: none; }
.move .more { margin-top: auto; color: var(--muted); font-size: var(--fs-xs); text-decoration: none; }
.move .more:hover { color: var(--ink); }
@media (max-width: 1100px) { .moves { grid-template-columns: minmax(0, 1fr); } }

/* 주간 보고: 화면에서는 카드, 인쇄하면 메뉴 없이 문서만 */
.doc { display: grid; gap: var(--s6); max-width: 880px; padding: var(--s6); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); box-shadow: var(--sh1); }
.doc h3 { display: flex; align-items: baseline; gap: var(--s2); margin: 0 0 var(--s3); font-size: var(--fs-m); }
.doc h3 small { color: var(--muted); font-size: var(--fs-xs); font-weight: 400; }
.doc .tablewrap { box-shadow: none; }
.doc-l { margin: 0; padding-left: var(--s5); display: grid; gap: var(--s2); }
.doc-l.lead { font-size: var(--fs-m); }

@media (max-width: 1100px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .brief-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) { .doc { padding: var(--s4); } .sigs li { grid-template-columns: minmax(0, 1fr) auto; } .sigs .lv { grid-column: 1 / -1; } }
@media print {
  .side, .topbar, .head .acts, .toasts { display: none !important; }
  .shell { display: block; } body { background: #fff; }
  .content { max-width: none; padding: 0; }
  .doc { border: 0; box-shadow: none; padding: 0; max-width: none; }
  .doc section { break-inside: avoid; }
}

/* 지니 지식 베이스: 안내 글은 접어 두고 펼쳐 본다 */
.kbdoc { border-top: 1px solid var(--line); }
.kbdoc:first-child { border-top: 0; }
.kbdoc summary { display: flex; align-items: baseline; gap: var(--s3); padding: var(--s3) var(--s4); cursor: pointer; }
.kbdoc .kbbody { padding: 0 var(--s4) var(--s4); color: var(--muted); white-space: pre-wrap; word-break: keep-all; }

/* 주문 단계 흐름(2026-10-26) */
.flow { display: flex; align-items: stretch; gap: var(--s2); margin-bottom: var(--s4); overflow-x: auto; }
.flow-step { flex: 1 1 0; min-width: 112px; display: grid; gap: var(--s1); padding: var(--s3) var(--s4); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); text-decoration: none; color: var(--ink); }
.flow-step .fl { font-size: var(--fs-xs); color: var(--muted); }
.flow-step b { font-size: var(--fs-l); font-weight: 700; }
.flow-step small { font-size: var(--fs-xs); color: var(--muted); }
.flow-step.zero b { color: var(--muted); font-weight: 400; }
.flow-step.late { border-color: var(--warn); background: var(--warn-soft); }
.flow-step.late small { color: var(--warn); }
.flow-arrow { align-self: center; color: var(--faint); }
/* 레베스트 신제품 카드(2026-10-26) */
.lv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--s3); }
.lv-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--s3); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.lv-card img, .lv-noimg { width: 96px; height: 96px; object-fit: contain; border-radius: var(--r1); background: var(--sunken); }
.lv-body { display: grid; align-content: start; gap: var(--s1); min-width: 0; }
.lv-body b { font-weight: 500; }

/* 퍼널(2026-10-29): 유입 → 구매 단계 막대. 마지막(구매)만 강조색, 가장 많이 빠지는 단계 이름은 경고색 */
.fnl, .card.pad, .card.move { padding: var(--s4) var(--s5); }   /* 글·표·차트를 바로 담는 카드는 테두리에 붙지 않게(11-03 사장님). 목록형(sigs·qrow·conn·rv·kbdoc)은 줄마다 여백이 있어 그대로 */
@media (max-width: 640px) { .fnl, .card.pad, .card.move { padding: var(--s4); } }
.fnl-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.seg { display: inline-flex; gap: var(--s1); }
.seg .btn.on { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.fnl-lead { margin: var(--s3) 0 var(--s4); font-size: var(--fs-m); font-weight: 500; }
.fnl-row { display: grid; grid-template-columns: 136px 1fr 200px; gap: var(--s3); align-items: center; padding: var(--s2) 0; }
.fnl-l small { display: block; color: var(--bad); font-size: var(--fs-xs); }
.fnl-row.worst .fnl-l { color: var(--bad); font-weight: 500; }
.fnl-bar { height: 24px; background: var(--sunken); border-radius: var(--r1); overflow: hidden; }
.fnl-bar i { display: block; height: 100%; background: var(--ink); border-radius: var(--r1); }
.fnl-row.last .fnl-bar i { background: var(--accent); }
.fnl-v small { display: block; color: var(--muted); font-size: var(--fs-xs); }
@media (max-width: 640px) { .fnl-row { grid-template-columns: 1fr; gap: var(--s1); } }

/* 쓰레드 생활 사진 풀 — 4:5 사진을 늘어놓고 쓸지 말지만 고른다 */
.thimgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s3); }
.thimg { display: grid; gap: var(--s1); padding: var(--s2); border: 1px solid var(--line); border-radius: var(--r2); background: var(--surface); }
.thimg img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--r1); background: var(--sunken); }
/* 안 쓰는 사진은 지운 게 아니라 쉬는 것이다. 흐리게 두고 자리는 남긴다 */
.thimg.off { opacity: .45; }
