/* 원데스크 상담원 화면. 색·크기·간격·모서리는 전부 tokens.css 의 이름만 쓴다(0과 1px 선만 예외).
   규칙: 색은 데이터와 할 일에만, 틀은 조용히. 표면은 평평하게, 나누는 건 1px 선이나 바탕 한 단계. */
* { box-sizing: border-box; }
html, body, #app { height: 100%; margin: 0; }
[hidden] { display: none !important; }
body { background: var(--frame); color: var(--text); font-family: var(--font-ui); font-size: var(--fs-body); line-height: var(--lh-body); -webkit-font-smoothing: antialiased; font-feature-settings: "tnum" 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; line-height: var(--lh-snug); }
h1 { font-size: var(--fs-title); font-weight: var(--fw-bold); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
h3 { font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-semibold); }
p { margin: 0; }
.i { width: var(--icon-md); height: var(--icon-md); flex: none; }
.i-sm { width: var(--icon-sm); height: var(--icon-sm); }
.i-lg { width: var(--icon-lg); height: var(--icon-lg); }
.num, td.num, th.num, .when { font-variant-numeric: tabular-nums; }
td.when { white-space: nowrap; }
.muted { color: var(--muted); }
.tiny { font-size: var(--fs-xs); }
.row { display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- 버튼: 주(한 화면에 하나), 보조, 조용한, 위험 / 크기 sm·md·lg */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); height: var(--h-md); padding: 0 var(--sp-3); border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-size: var(--fs-body); font-weight: var(--fw-medium); white-space: nowrap; transition: background var(--t-hover), border-color var(--t-hover), transform var(--t-press); }
.btn:hover { background: var(--raised); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); font-weight: var(--fw-semibold); }
.btn.primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn.quiet, .btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.quiet:hover, .btn.ghost:hover { background: var(--raised); color: var(--text); }
.btn.danger { color: var(--negative); }
.btn.danger:hover { background: var(--pill-negative-bg); border-color: var(--pill-negative-ink); }
.btn.small, .btn.sm { height: var(--h-sm); padding: 0 var(--sp-2); font-size: var(--fs-sm); gap: var(--sp-1); }
.btn.lg { height: var(--h-lg); padding: 0 var(--sp-4); }
.btn.icon { width: var(--h-md); padding: 0; }
.btn.icon.small { width: var(--h-sm); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- 입력칸 */
input[type=text], input[type=password], input[type=email], input[type=search], input[type=number], select, textarea { width: 100%; min-height: var(--h-md); padding: 0 var(--sp-3); border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-size: var(--fs-body); transition: border-color var(--t-hover); }
textarea { padding: var(--sp-2) var(--sp-3); line-height: var(--lh-body); resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
input[type=checkbox] { width: var(--sp-4); height: var(--sp-4); accent-color: var(--accent); margin: 0; }
label.f { display: grid; gap: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); }
.search { position: relative; }
.search .i { position: absolute; left: var(--sp-3); top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { padding-left: calc(var(--sp-3) + var(--icon-md) + var(--sp-2)); }

/* ---------- 표시: 상태 pill, 태그, 안 읽은 수 badge */
.pill { display: inline-flex; align-items: center; gap: var(--sp-1); height: calc(var(--sp-5) + var(--sp-1) / 2); padding: 0 var(--sp-2); border-radius: var(--radius-chip); background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap; }
.pill.ai { background: var(--pill-ai-bg); color: var(--pill-ai-ink); }
.pill.human { background: var(--pill-accent-bg); color: var(--pill-accent-ink); }
.pill.unread, .pill.warn { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill.neg { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.badge { display: inline-grid; place-items: center; min-width: var(--sp-5); height: var(--sp-5); padding: 0 var(--sp-1); border-radius: var(--radius-full); background: var(--badge-bg); color: var(--badge-ink); font-size: var(--fs-xs); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: var(--sp-1); height: calc(var(--sp-5) + var(--sp-1) / 2); padding: 0 var(--sp-2); border-radius: var(--radius-chip); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: var(--fs-xs); white-space: nowrap; }
.tag::before { content: "#"; color: var(--faint); }
.tag button { display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--muted); width: var(--sp-4); height: var(--sp-4); border-radius: var(--radius-chip); }
.tag button:hover { background: var(--raised); color: var(--text); }
.tags { display: flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.tags input { width: calc(var(--sp-24) + var(--sp-2)); min-height: var(--h-sm); font-size: var(--fs-xs); padding: 0 var(--sp-2); }

/* ---------- 비어 있음, 알림, 오류 */
.empty { display: grid; justify-items: center; gap: var(--sp-2); color: var(--muted); padding: var(--sp-10) var(--sp-6); text-align: center; }
.empty .i { width: var(--icon-lg); height: var(--icon-lg); color: var(--faint); }
.empty b { color: var(--text); font-weight: var(--fw-semibold); }
.toast { position: fixed; left: 50%; bottom: var(--sp-6); transform: translateX(-50%); display: flex; align-items: center; gap: var(--sp-2); background: var(--text); color: var(--surface); padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-control); box-shadow: var(--shadow-float); z-index: var(--z-toast); font-weight: var(--fw-medium); animation: toast-in var(--t-ui) var(--ease-out); } /* taste-skill-ignore: 떠 있는 알림 */
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, var(--sp-2)); } }
.error { color: var(--negative); font-size: var(--fs-sm); min-height: var(--sp-5); }

/* ---------- 원데스크 표시(마크) */
.brand { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
.brand .logo { width: var(--h-md); height: var(--h-md); flex: none; color: var(--accent); }
.brand .logo .ink { fill: none; stroke: var(--accent-ink); stroke-width: 2.5; stroke-linecap: round; }
.brand .nm { font-size: var(--fs-md); font-weight: var(--fw-bold); letter-spacing: -0.01em; line-height: var(--lh-tight); }
.brand .scope { font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 로그인 */
.login { min-height: 100%; display: grid; place-items: center; padding: var(--sp-6); background: var(--ground); }
.login form { width: min(calc(var(--sp-24) * 4), 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--sp-8); display: grid; gap: var(--sp-4); }
.login h1 { font-size: var(--fs-title); }
.login .btn { height: var(--h-lg); }
.login .error:empty { display: none; }

/* ---------- 틀: 옅은 틀(사이드바) 안에 흰 종이 */
.shell { height: 100%; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); background: var(--frame); }
.topbar { display: none; }
.top-title { display: none; font-weight: var(--fw-bold); font-size: var(--fs-md); margin: 0; }
nav.rail { display: flex; flex-direction: column; gap: var(--sp-1); padding: var(--sp-4) var(--sp-3); min-height: 0; overflow: auto; }
nav.rail .brand { padding: var(--sp-1) var(--sp-2) var(--sp-5); }
.rail button.nav { display: flex; align-items: center; gap: var(--sp-3); width: 100%; height: var(--h-lg); padding: 0 var(--sp-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--muted); font-weight: var(--fw-medium); text-align: left; transition: background var(--t-hover), color var(--t-hover); }
.rail button.nav:hover { background: var(--active); color: var(--text); }
.rail button.nav[aria-current=page] { background: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: var(--fw-semibold); }
.rail button.nav .lbl { flex: 1; }
.rail button.nav .pill { background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; }
.rail .me { margin-top: auto; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-2) 0; border-top: 1px solid var(--border); font-size: var(--fs-sm); }
.avatar { display: grid; place-items: center; width: var(--h-md); height: var(--h-md); flex: none; border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-strong); font-weight: var(--fw-bold); font-size: var(--fs-sm); }
.avatar.sm { width: var(--h-sm); height: var(--h-sm); font-size: var(--fs-xs); }
.rail .me .who { flex: 1; min-width: 0; display: grid; line-height: var(--lh-snug); }
.rail .me .who b { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell > main { min-width: 0; min-height: 0; overflow: auto; margin: var(--sheet-inset) var(--sheet-inset) var(--sheet-inset) 0; background: var(--sheet); border: 1px solid var(--sheet-edge); border-radius: var(--radius-sheet); }
.page { padding: var(--sp-6) var(--sp-8) var(--sp-12); max-width: var(--page-max); width: 100%; margin: 0 auto; display: grid; gap: var(--gap); align-content: start; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: var(--sp-1); }

/* ---------- 카드·패널·표 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); padding: var(--card-pad); display: grid; gap: var(--sp-4); align-content: start; }
.card > .card-head { display: flex; align-items: center; gap: var(--sp-3); }
.card > .card-head h2 { flex: 1; }
.card.flush { padding: 0; gap: 0; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-semibold); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule); vertical-align: middle; overflow-wrap: anywhere; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td b { font-weight: var(--fw-semibold); }
tr.click { cursor: pointer; transition: background var(--t-hover); }
tr.click:hover td { background: var(--raised); }
tr.click:focus-visible { outline-offset: -2px; }
.bar { height: var(--sp-2); background: var(--raised); border-radius: var(--radius-full); overflow: hidden; min-width: var(--sp-16); }
.bar i { display: block; height: 100%; background: var(--data); border-radius: var(--radius-full); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--sp-32) + var(--sp-12)), 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.stat { display: grid; gap: var(--sp-1); padding: var(--sp-4) var(--card-pad); border-left: 1px solid var(--rule); }
.stat:first-child { border-left: 0; }
.stat span { font-size: var(--fs-sm); color: var(--muted); }
.stat b { font-size: var(--fs-kpi); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; line-height: var(--lh-tight); letter-spacing: -0.01em; }
.stat small { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- 받은편지함: 목록 | 대화 | 고객 */
.inbox { height: 100%; display: grid; grid-template-columns: var(--list-width) minmax(0, 1fr) var(--side-width); }
.col { min-height: 0; min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--border); }
.col:last-child { border-right: 0; }
.col-head { padding: var(--sp-5) var(--sp-4) 0; display: grid; gap: var(--sp-3); border-bottom: 1px solid var(--border); }
.col-head .filters { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-2); }
.col-head .filters select { width: auto; }
.tabs { display: flex; gap: var(--sp-4); margin-bottom: -1px; }
.tabs button { display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--h-lg); padding: 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: var(--fw-medium); font-variant-numeric: tabular-nums; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-pressed=true] { color: var(--text); font-weight: var(--fw-semibold); border-bottom-color: var(--accent); }
.conv-list { overflow: auto; flex: 1; padding: var(--sp-2); display: grid; gap: var(--sp-1); align-content: start; }
.conv { position: relative; display: grid; gap: var(--sp-1); width: 100%; text-align: left; border: 0; border-radius: var(--radius-control); background: transparent; padding: var(--sp-3); transition: background var(--t-hover); }
.conv:hover { background: var(--raised); }
.conv[aria-current=true] { background: var(--active); }
.conv[aria-current=true]::before { content: ""; position: absolute; left: 0; top: var(--sp-3); bottom: var(--sp-3); width: 2px; border-radius: var(--radius-full); background: var(--accent); }
.conv .top { display: flex; align-items: center; gap: var(--sp-2); }
.conv .nm { flex: 1; min-width: 0; font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv .at { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.conv .last { color: var(--muted); font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv.unread .last { color: var(--text); }
.conv .meta { display: flex; gap: var(--sp-1); flex-wrap: wrap; }

.thread-head { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; padding: var(--sp-4) var(--sp-5); border-bottom: 1px solid var(--border); }
.thread-head .title { display: flex; align-items: center; gap: var(--sp-2); margin-right: auto; min-width: 0; }
.thread-head h2 { font-size: var(--fs-md); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head select { width: auto; min-height: var(--h-sm); font-size: var(--fs-sm); }
.thread-head .acts { display: flex; gap: var(--sp-1); flex-wrap: wrap; }
.back, .side-toggle, .side-back { display: none; }

.msgs { flex: 1; overflow: auto; padding: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); background: var(--surface); }
.msg { max-width: min(76%, calc(var(--sp-32) * 4.5)); display: grid; gap: var(--sp-1); }
.msg .who { display: flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-xs); color: var(--muted); }
.msg .b { padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-bubble); white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; border: 1px solid transparent; }
.msg.customer .b { background: var(--bubble-customer-bg); color: var(--bubble-customer-ink); border-color: var(--bubble-customer-edge); border-top-left-radius: var(--radius-bubble-tail); }
.msg.agent, .msg.ai, .msg.note { align-self: flex-end; }
.msg.agent .who, .msg.ai .who, .msg.note .who { justify-content: flex-end; }
.msg.agent .b { background: var(--bubble-agent-bg); color: var(--bubble-agent-ink); border-top-right-radius: var(--radius-bubble-tail); }
.msg.ai .b { background: var(--bubble-ai-bg); color: var(--bubble-ai-ink); border-color: var(--bubble-ai-edge); border-top-right-radius: var(--radius-bubble-tail); }
.msg.note .b { background: var(--bubble-note-bg); color: var(--bubble-note-ink); border-color: var(--bubble-note-edge); border-style: solid; border-top-right-radius: var(--radius-bubble-tail); }
.msg.note .who { color: var(--bubble-note-ink); }
.msg.system { align-self: center; max-width: 90%; }
.msg.system .b { background: var(--raised); border: 0; border-radius: var(--radius-card); color: var(--bubble-system-ink); font-size: var(--fs-sm); text-align: center; padding: var(--sp-2) var(--sp-4); }
.msg .who .pill { height: auto; padding: 0 var(--sp-1); }

.composer { border-top: 1px solid var(--border); background: var(--surface); padding: var(--sp-3) var(--sp-4) var(--sp-4); display: grid; gap: var(--sp-2); }
.composer .modes { display: flex; gap: var(--sp-2); align-items: center; }
.seg { display: inline-flex; padding: calc(var(--sp-1) / 2); gap: calc(var(--sp-1) / 2); border-radius: var(--radius-control); background: var(--raised); }
.seg button { white-space: nowrap; flex-shrink: 0; display: inline-flex; align-items: center; gap: var(--sp-1); height: calc(var(--h-sm) - var(--sp-1)); padding: 0 var(--sp-3); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--muted); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.seg button[aria-pressed=true] { background: var(--surface); color: var(--text); font-weight: var(--fw-semibold); }
.composer .modes select { width: auto; margin-left: auto; min-height: var(--h-sm); font-size: var(--fs-sm); }
.composer .send { display: flex; gap: var(--sp-2); align-items: flex-end; }
.composer .send textarea { min-height: calc(var(--h-touch) * 1.6); resize: none; }
.composer .send .btn { height: var(--h-lg); }
/* 답장 칸의 사진·파일 */
.composer .send .btn.attach { width: var(--h-lg); padding: 0; flex: none; }
.pending-file { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-3); border-radius: var(--radius-control); background: var(--raised); font-size: var(--fs-sm); }
.pending-file > .i { color: var(--accent-strong); }
.pending-file .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.pending-file .btn { margin-left: auto; }
.msg .att-photo { display: block; justify-self: start; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-bubble); overflow: hidden; background: var(--raised); }
.msg .att-photo img { display: block; max-width: 100%; max-height: calc(var(--sp-32) * 2); object-fit: cover; }
.msg.agent .att-photo, .msg.ai .att-photo, .msg.note .att-photo, .msg.agent .att-file, .msg.note .att-file { justify-self: end; }
.msg .att-file { display: flex; align-items: center; gap: var(--sp-3); justify-self: start; max-width: 100%; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text); text-decoration: none; }
.msg .att-file:hover { background: var(--raised); }
.msg.note .att-file { background: var(--bubble-note-bg); border-color: var(--bubble-note-edge); color: var(--bubble-note-ink); }
.msg .att-file .ic { display: grid; place-items: center; width: var(--h-sm); height: var(--h-sm); flex: none; border-radius: var(--radius-control); background: var(--accent-soft); color: var(--accent-strong); }
.msg .att-file .fx { display: grid; min-width: 0; }
.msg .att-file b { font-size: var(--fs-sm); font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.msg .att-file small { font-size: var(--fs-xs); color: var(--muted); }
.composer.note textarea { background: var(--bubble-note-bg); border-color: var(--bubble-note-edge); color: var(--bubble-note-ink); }
.composer.note .send .btn.primary { background: var(--text); border-color: var(--text); color: var(--surface); }

.side { overflow: auto; padding: var(--sp-5) var(--sp-4); display: grid; gap: var(--sp-6); align-content: start; }
.side section { display: grid; gap: var(--sp-2); }
.side .who-card { display: flex; gap: var(--sp-3); align-items: center; }
.side .who-card b { font-size: var(--fs-md); font-weight: var(--fw-semibold); }
dl.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-2) var(--sp-3); margin: 0; font-size: var(--fs-sm); }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.visit { display: grid; gap: 0; font-size: var(--fs-sm); padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule); }
.visit:last-child { border-bottom: 0; }
.visit b { font-weight: var(--fw-medium); overflow-wrap: anywhere; }
.visit span { font-size: var(--fs-xs); }
.past { display: grid; gap: var(--sp-1); }
.past button { display: grid; gap: 0; text-align: left; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); font-size: var(--fs-sm); }
.past button:hover { background: var(--raised); }
.past button span { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- 서랍(고객 정보) */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: var(--z-scrim); animation: fade var(--t-ui) var(--ease-out); }
@keyframes fade { from { opacity: 0; } }
aside.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(var(--drawer-width), 100vw); background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-float); padding: var(--sp-6); overflow: auto; display: grid; gap: var(--sp-4); align-content: start; z-index: var(--z-drawer); animation: slide var(--t-ui) var(--ease-out); } /* taste-skill-ignore: 떠 있는 서랍 */
@keyframes slide { from { transform: translateX(var(--sp-6)); opacity: 0; } }
aside.drawer section { display: grid; gap: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--rule); }

pre.code { background: var(--code-bg); color: var(--code-ink); padding: var(--sp-4); border-radius: var(--radius-card); overflow: auto; font-family: var(--font-mono); font-size: var(--fs-sm); line-height: var(--lh-body); margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------- AI 상담원 */
.kb { display: grid; grid-template-columns: calc(var(--sp-32) * 2) minmax(0, 1fr); gap: var(--sp-5); }
.kb-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: calc(var(--sp-1) / 2); align-content: start; border-right: 1px solid var(--rule); padding-right: var(--sp-3); }
.kb-list button { display: flex; align-items: center; gap: var(--sp-2); width: 100%; text-align: left; border: 0; background: transparent; padding: var(--sp-2); border-radius: var(--radius-control); color: var(--text); }
.kb-list button span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kb-list button .i { color: var(--muted); }
.kb-list button:hover { background: var(--raised); }
.kb-list button[aria-current=true] { background: var(--active); font-weight: var(--fw-semibold); }
.kb-form { display: grid; gap: var(--sp-3); align-content: start; }
.answer { background: var(--bubble-ai-bg); color: var(--bubble-ai-ink); border: 1px solid var(--bubble-ai-edge); border-radius: var(--radius-bubble); padding: var(--sp-3) var(--sp-4); white-space: pre-wrap; }
.answer.handoff { background: var(--bubble-note-bg); color: var(--bubble-note-ink); border-color: var(--bubble-note-edge); }
.switch { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-semibold); }

/* ---------- 설치·설정: 왼쪽 설정, 오른쪽 미리보기 */
.setup { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--widget-width) - var(--sp-12)); gap: var(--gap); align-items: start; }
.setup .stack { display: grid; gap: var(--gap); }
.color-row { display: flex; align-items: center; gap: var(--sp-3); }
.color-row input[type=color] { width: var(--h-lg); height: var(--h-lg); padding: var(--sp-1); border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); cursor: pointer; }
.canned-row { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) 0; border-bottom: 1px solid var(--rule); }
.canned-add { display: grid; grid-template-columns: calc(var(--sp-32) + var(--sp-16)) minmax(0, 1fr) auto; gap: var(--sp-2); align-items: start; }
.preview { position: sticky; top: var(--sp-6); display: grid; gap: var(--sp-3); }
.preview .frame { background: var(--raised); border-radius: var(--radius-card); padding: var(--sp-4); display: grid; justify-items: end; gap: var(--sp-3); }
.pv-panel { width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-panel); overflow: hidden; box-shadow: var(--shadow-float); font-size: var(--fs-sm); } /* taste-skill-ignore: 떠 있는 채팅 창 미리보기 */
.pv-head { padding: var(--sp-3) var(--sp-4); border-bottom: 1px solid var(--rule); }
.pv-head b { display: block; font-size: var(--fs-body); }
.pv-head span { font-size: var(--fs-xs); color: var(--muted); }
.pv-body { padding: var(--sp-4); display: grid; gap: var(--sp-2); }
.pv-body .b { padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-bubble); max-width: 86%; }
.pv-body .b.sys { background: var(--raised); justify-self: start; border-top-left-radius: var(--radius-bubble-tail); }
.pv-body .b.me { background: var(--pv-c); color: var(--pv-ink); justify-self: end; border-top-right-radius: var(--radius-bubble-tail); }
.pv-launch { height: var(--launcher-size); padding: 0 var(--sp-5) 0 var(--sp-4); border-radius: var(--radius-launcher); background: var(--pv-c); color: var(--pv-ink); display: inline-flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-bold); box-shadow: var(--shadow-launcher); } /* taste-skill-ignore: 떠 있는 채팅 버튼 미리보기 */
.pv-launch .i { width: calc(var(--icon-lg) + var(--sp-1)); height: calc(var(--icon-lg) + var(--sp-1)); }

/* ---------- 좁은 화면 */
/* ---------- 고객: 조건으로 고르기 + 세그먼트 */
.filter-card { gap: var(--sp-3); }
.filter-card .lbl { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--muted); min-width: calc(var(--sp-16) + var(--sp-4)); }
.segs { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); }
.segs > button { display: inline-flex; align-items: center; gap: var(--sp-2); height: var(--h-sm); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); transition: background var(--t-hover); }
.segs > button:hover { background: var(--raised); }
.segs > button[aria-pressed=true] { background: var(--nav-active-bg); border-color: var(--nav-active-bg); color: var(--nav-active-ink); font-weight: var(--fw-semibold); }
.segs .n { font-size: var(--fs-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.segs > button[aria-pressed=true] .n { color: inherit; }
.seg-acts { display: inline-flex; gap: calc(var(--sp-1) / 2); }
.builder { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--rule); }
.builder select { width: auto; min-width: calc(var(--sp-32) + var(--sp-16)); }
.builder input[type=text], .builder input[type=number] { width: calc(var(--sp-32) + var(--sp-8)); }
.builder .search { min-width: calc(var(--sp-32) + var(--sp-12)); }
.conds { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cond { display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--h-sm); padding: 0 var(--sp-1) 0 var(--sp-3); border-radius: var(--radius-full); background: var(--pill-accent-bg); color: var(--pill-accent-ink); font-size: var(--fs-sm); font-weight: var(--fw-medium); white-space: nowrap; }
.cond button { display: grid; place-items: center; width: var(--sp-6); height: var(--sp-6); border: 0; border-radius: var(--radius-full); background: transparent; color: inherit; }
.cond button:hover { background: var(--surface); }
.cond-acts, .name-edit { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-left: auto; }
.name-edit input { width: calc(var(--sp-32) + var(--sp-16)); min-height: var(--h-sm); }
/* AI 문서: 첫 화면 추천 질문 */
.suggest-box { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-4); align-items: center; padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-control); background: var(--raised); }
.suggest-box p { grid-column: 1 / -1; margin: 0; }
.kb-list button .pill { margin-left: auto; flex: none; }

/* ---------- 받은편지함: 우선 대화, 봇 메시지 */
.conv .pill.flag { flex: none; }
.btn.prio-toggle[aria-pressed=true] { background: var(--pill-warning-bg); border-color: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.msg.bot { align-self: flex-end; }
.msg.bot .who { justify-content: flex-end; }
.msg.bot .b { background: var(--accent-soft); color: var(--text); border-top-right-radius: var(--radius-bubble-tail); }
.msg .offered { display: flex; flex-wrap: wrap; gap: var(--sp-1); justify-content: flex-end; }
.msg .opt { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--h-sm); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--muted); font-size: var(--fs-sm); }
.msg .opt.chosen { background: var(--text); border-color: var(--text); color: var(--surface); font-weight: var(--fw-semibold); }
.msg .offered-note { display: flex; align-items: center; gap: var(--sp-1); justify-content: flex-end; }

/* ---------- 자동화 */
.auto-tabs { border-bottom: 1px solid var(--border); margin-bottom: 0; }
.auto-body { display: grid; gap: var(--gap); }
input[type=time] { min-height: var(--h-md); padding: 0 var(--sp-2); border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; }
input[type=time]:disabled { color: var(--faint); background: var(--raised); }
.status-line { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--pill-warning-ink); background: var(--pill-warning-bg); padding: var(--sp-1) var(--sp-3); border-radius: var(--radius-chip); }
.status-line.ok { color: var(--pill-accent-ink); background: var(--pill-accent-bg); }
.days { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-card); }
.days.dim { opacity: 0.5; }
.day { display: grid; grid-template-columns: calc(var(--sp-24) + var(--sp-4)) auto 1fr; align-items: center; gap: var(--sp-4); padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--rule); }
.day:last-child { border-bottom: 0; }
.day .times { display: flex; align-items: center; gap: var(--sp-2); }
.day.off b { color: var(--muted); font-weight: var(--fw-medium); }
.rules { list-style: none; margin: 0; padding: 0; display: grid; border-top: 1px solid var(--rule); }
.rule { display: grid; grid-template-columns: var(--sp-6) auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-3) 0; border-bottom: 1px solid var(--rule); }
.rule .no { color: var(--faint); font-size: var(--fs-sm); padding-top: calc(var(--sp-1) / 2); text-align: right; }
.rule.off .rule-main { opacity: 0.6; }
.rule-main { display: grid; gap: var(--sp-1); min-width: 0; }
.rule-main .sentence { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.rule-main .when { font-weight: var(--fw-semibold); }
.rule-main .arrow { color: var(--accent-strong); font-weight: var(--fw-bold); }
.rule-acts { display: flex; gap: calc(var(--sp-1) / 2); align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.rule-block { border: 0; margin: 0; padding: var(--sp-3) 0 0; border-top: 1px solid var(--rule); display: grid; gap: var(--sp-2); justify-items: start; }
.rule-block legend { font-size: var(--fs-sm); font-weight: var(--fw-semibold); padding: 0 0 var(--sp-1); }
.rule-line { width: 100%; display: grid; grid-template-columns: calc(var(--sp-12) + var(--sp-2)) calc(var(--sp-32) + var(--sp-24)) minmax(0, 1fr) auto; gap: var(--sp-2); align-items: start; }
.rule-line .word { font-size: var(--fs-sm); color: var(--muted); font-weight: var(--fw-semibold); padding-top: var(--sp-2); text-align: right; }
.rule-line .val { min-width: 0; }
.agent-picks { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-4); padding-top: var(--sp-2); }
.agent-picks .switch { font-weight: var(--fw-medium); }
.dry-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--sp-32) + var(--sp-16)), 1fr)); gap: var(--sp-3); align-items: end; }
.dry-list { list-style: none; margin: var(--sp-2) 0 0; padding: 0; display: grid; gap: var(--sp-1); }
.dry-list li { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-control); color: var(--muted); }
.dry-list li .i { margin-top: calc(var(--sp-1) / 2); }
.dry-list li.hit { background: var(--pill-accent-bg); color: var(--text); }
.dry-list li.hit .i { color: var(--pill-accent-ink); }
.scen-list { display: grid; gap: calc(var(--sp-1) / 2); }
.scen-list button { display: flex; align-items: center; gap: var(--sp-2); width: 100%; text-align: left; border: 0; background: transparent; padding: var(--sp-2); border-radius: var(--radius-control); color: var(--text); }
.scen-list button:hover { background: var(--raised); }
.scen-list button[aria-current=true] { background: var(--active); font-weight: var(--fw-semibold); }
.scen-list .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scen-wrap { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--widget-width) - var(--sp-16)); gap: var(--gap); align-items: start; }
.outline { display: grid; gap: var(--sp-3); }
.step { display: grid; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.step-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.step-head .depth { font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--accent-strong); background: var(--accent-soft); padding: 0 var(--sp-2); border-radius: var(--radius-chip); }
.step-head .btn { margin-left: auto; }
.btn-list { display: grid; gap: var(--sp-2); }
.btn-row { display: grid; gap: var(--sp-1); padding-left: var(--sp-2); }
.btn-line { display: flex; align-items: center; gap: var(--sp-2); }
.btn-line > .i { color: var(--faint); }
.btn-line input.lbl { flex: 1 1 calc(var(--sp-32) + var(--sp-8)); min-width: 0; font-weight: var(--fw-medium); }
.btn-line select { width: auto; flex: none; }
.btn-line .taps { white-space: nowrap; }
.btn-row > textarea, .btn-row > input { margin-left: calc(var(--icon-sm) + var(--sp-2)); width: calc(100% - var(--icon-sm) - var(--sp-2)); }
.child { margin-left: calc(var(--icon-sm) + var(--sp-2)); padding-left: var(--sp-3); border-left: 2px solid var(--accent-soft); }
.child .step { background: var(--raised); border-color: var(--rule); }
.scen-pv .pv-body { max-height: calc(var(--sp-32) * 4); overflow: auto; }
.scen-pv .pv-body .b { white-space: pre-wrap; overflow-wrap: anywhere; }
.scen-pv .pv-body .b.sys { background: var(--accent-soft); }
.scen-pv .pv-body .b.me { background: var(--raised); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); } /* taste-skill-ignore: 손님이 고른 버튼 */
.pv-chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.pv-chips button { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--h-sm); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium); }
.pv-chips button:hover { border-color: var(--accent); background: var(--accent-soft); }
.pv-form { display: flex; align-items: center; gap: var(--sp-1); padding: var(--sp-2) var(--sp-3); border: 1px dashed var(--border); border-radius: var(--radius-control); }

/* ---------- 대화 폼 */
.form-list .i { color: var(--faint); }
.form-editor { display: grid; gap: var(--gap); }
.form-wrap { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--widget-width) - var(--sp-16)); gap: var(--gap); align-items: start; }
.form-settings { display: grid; gap: var(--sp-3); min-width: 0; }
.form-settings .rule-block { justify-items: stretch; }
.form-settings .rule-block > .btn { justify-self: start; }
.form-settings .rule-line { grid-template-columns: auto minmax(0, 1fr) auto; align-items: end; }
.q-list, .field-list { display: grid; gap: var(--sp-2); }
.q-row { display: grid; grid-template-columns: var(--sp-6) minmax(0, 1fr) auto; gap: var(--sp-2); align-items: start; }
.q-row .no { display: grid; place-items: center; width: var(--sp-6); height: var(--sp-6); margin-top: var(--sp-2); border-radius: var(--radius-full); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: var(--fw-bold); }
.q-row textarea { resize: vertical; }
.field-row { display: grid; gap: var(--sp-1); padding: var(--sp-2); border: 1px solid var(--rule); border-radius: var(--radius-control); background: var(--surface); }
.field-line { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.field-line input[type=text] { flex: 1 1 calc(var(--sp-32) + var(--sp-4)); min-width: 0; }
.field-line select { width: auto; flex: none; }
.switch.tiny { font-size: var(--fs-xs); font-weight: var(--fw-medium); white-space: nowrap; }
.inline-num { display: grid; gap: var(--sp-1); font-size: var(--fs-xs); color: var(--muted); }
.inline-num input { width: calc(var(--sp-16) + var(--sp-4)); }
.form-pv .pv-body { max-height: calc(var(--sp-32) * 4); overflow: auto; }
.form-pv .pv-body .b { white-space: pre-wrap; overflow-wrap: anywhere; }
.form-pv .pv-body .b.sys { background: var(--accent-soft); }
.form-pv .pv-body .b.me { background: var(--raised); color: var(--muted); box-shadow: inset 0 0 0 1px var(--border); } /* taste-skill-ignore: 손님 답 자리 */
.form-pv .pv-chips button[aria-pressed=true] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); font-weight: var(--fw-semibold); }
.pv-step { margin-top: var(--sp-1); }
.pv-summary { display: grid; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.pv-summary dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--sp-1) var(--sp-3); margin: 0; font-size: var(--fs-xs); }
.pv-summary dt { color: var(--muted); }
.pv-summary dd { margin: 0; overflow-wrap: anywhere; }
.pv-btn { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: var(--h-sm); padding: 0 var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: var(--fs-xs); font-weight: var(--fw-semibold); background: var(--surface); color: var(--text); }
.pv-btn.main { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); }
.form-results { display: grid; gap: var(--gap); }
.drop { display: grid; gap: var(--sp-2); }
.drop-list { display: grid; border-top: 1px solid var(--rule); }
.drop-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(var(--sp-24), 1fr) calc(var(--sp-32) + var(--sp-10)) calc(var(--sp-24) + var(--sp-2)); gap: var(--sp-3); align-items: center; padding: var(--sp-2) 0; border-bottom: 1px solid var(--rule); }
.drop-label { display: grid; min-width: 0; }
.drop-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drop-nums { display: flex; gap: var(--sp-3); font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; }
.drop-lost { font-size: var(--fs-sm); color: var(--muted); text-align: right; white-space: nowrap; }
.drop-lost.hot { color: var(--pill-negative-ink); font-weight: var(--fw-semibold); }
.known dd { display: grid; gap: 0; overflow-wrap: anywhere; }
.known-src { font-size: var(--fs-xs); }
.pref { display: inline-flex; align-items: center; min-height: calc(var(--sp-5) + var(--sp-1) / 2); padding: 0 var(--sp-2); border-radius: var(--radius-chip); background: var(--accent-soft); color: var(--accent-strong); font-size: var(--fs-xs); font-weight: var(--fw-medium); }

/* ---------- 상품 */
.thumb { display: inline-grid; place-items: center; flex: none; width: var(--sp-10); height: var(--sp-10); border-radius: var(--radius-control); background: var(--raised); overflow: hidden; color: var(--muted); font-weight: var(--fw-bold); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.big { width: calc(var(--sp-32) + var(--sp-8)); height: calc(var(--sp-32) + var(--sp-8)); border-radius: var(--radius-card); }
.prod-cell { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.prod-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--sp-32) * 2), 1fr)); gap: var(--gap); align-items: start; }
.prod-form .stack { display: grid; gap: var(--sp-3); min-width: 0; }
.pic-preview { display: grid; place-items: start; min-height: var(--sp-10); }
.attr-list { display: grid; gap: var(--sp-2); width: 100%; }
.attr-list .rule-line { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; }
.pcards { display: flex; gap: var(--sp-2); overflow-x: auto; padding: var(--sp-1) 0; max-width: 100%; }
.pcard { display: flex; align-items: center; gap: var(--sp-2); flex: none; padding: var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text); font-size: var(--fs-xs); max-width: calc(var(--sp-32) + var(--sp-24)); }
.pcard > div { display: grid; min-width: 0; }
.pcard b { font-weight: var(--fw-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-sum { padding: var(--sp-2) var(--sp-3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); color: var(--text); font-size: var(--fs-xs); }
.form-sum dt { color: var(--muted); }
.form-sum dd { margin: 0; overflow-wrap: anywhere; }
.pick { display: grid; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--raised); }
.pick-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.pick-head .btn { margin-left: auto; }
.pick-list { display: flex; gap: var(--sp-2); overflow-x: auto; padding-bottom: var(--sp-1); }
.pick-item { display: flex; align-items: center; gap: var(--sp-2); flex: none; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface); font-size: var(--fs-sm); cursor: pointer; max-width: calc(var(--sp-32) * 2); }
.pick-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--fw-medium); }
.pick-item.on { border-color: var(--accent); background: var(--accent-soft); }
.pick-item:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
/* ---------- 마케팅 */
.mk-tabs { border-bottom: 1px solid var(--border); overflow-x: auto; overflow-y: hidden; }
.mk-tabs .tabs { margin-bottom: 0; }
.mk-body { display: grid; gap: var(--gap); }
.mk-test { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-card); background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: var(--fs-sm); }
.mk-test b { font-weight: var(--fw-bold); }
.mk-note { margin-bottom: var(--sp-3); }
.mk-table tr.on td { background: var(--active); }
.mk-table td { font-size: var(--fs-sm); }
.mk-table td.num { white-space: nowrap; }
.linkish { border: 0; background: none; padding: 0; color: var(--text); font: inherit; font-weight: var(--fw-medium); text-align: left; text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { text-decoration-color: currentColor; }
.mk-kind { display: inline-flex; align-items: center; gap: var(--sp-1); white-space: nowrap; }
.mk-kindpill { margin-left: var(--sp-2); }
.mk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--sp-32) + var(--sp-16)), 1fr)); gap: var(--sp-3); width: 100%; }
.mk-pair { display: flex; flex-wrap: wrap; gap: var(--sp-4); }
.f-group { display: grid; gap: var(--sp-1); }
.mk-lbl { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); }
.form-settings .seg { flex-wrap: wrap; justify-self: start; }
.mk-settings { display: block; }
.mk-settings summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); }
.mk-settings[open] summary { margin-bottom: var(--sp-3); }
.mk-settings > .mk-grid + p, .mk-settings > .row { margin-top: var(--sp-3); }
.mk-test-row { display: flex; gap: var(--sp-2); width: 100%; flex-wrap: wrap; }
.mk-test-row input { flex: 1 1 calc(var(--sp-32) + var(--sp-8)); min-width: 0; }
.mk-kpis { margin-bottom: var(--sp-1); }
.mk-side { gap: var(--sp-3); }
.mk-aud { display: grid; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.mk-aud-top { display: flex; align-items: baseline; gap: var(--sp-2); flex-wrap: wrap; }
.mk-aud-top b { font-size: var(--fs-kpi); font-weight: var(--fw-bold); line-height: var(--lh-tight); }
.mk-ex { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); font-size: var(--fs-sm); }
.mk-ex li { display: flex; justify-content: space-between; gap: var(--sp-3); color: var(--muted); }
.mk-ex li.mk-ex-head { color: var(--text); font-weight: var(--fw-medium); border-bottom: 1px solid var(--rule); padding-bottom: var(--sp-1); }
.mk-est { display: grid; gap: calc(var(--sp-1) / 2); padding-top: var(--sp-3); border-top: 1px solid var(--rule); font-size: var(--fs-sm); }
.mk-est span { font-size: var(--fs-xs); color: var(--muted); }
.mk-est b { font-weight: var(--fw-medium); }
.mk-problems { display: grid; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-card); background: var(--pill-negative-bg); color: var(--pill-negative-ink); font-size: var(--fs-sm); }
.mk-problems p { display: flex; gap: var(--sp-2); align-items: flex-start; margin: 0; }
.mk-problems .i { flex: none; margin-top: 2px; }
.mk-side .status-line { display: flex; align-items: flex-start; }
.mk-mail-body { padding: var(--sp-4); white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); max-height: calc(var(--sp-32) * 3); overflow: auto; }
.mk-sms { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 100% !important; background: var(--raised); }
.mk-frame { width: 100%; height: calc(var(--sp-32) * 3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--raised); }
.mk-ob-detail, .mk-cs-detail { display: grid; }
.mk-ob-detail details summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-3); }
.mk-cons { display: inline-flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.mk-cons small { font-size: var(--fs-xs); }
.mk-h3 { font-size: var(--fs-body); font-weight: var(--fw-bold); margin: var(--sp-4) 0 var(--sp-2); }
.mk-log { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); font-size: var(--fs-sm); }
.mk-log li { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: baseline; padding: var(--sp-1) 0; border-bottom: 1px solid var(--rule); }
.mk-log .when { color: var(--muted); font-variant-numeric: tabular-nums; }
/* 온사이트 미리 보기: 작은 홈페이지 위에 손님이 볼 모양 */
.os-pv-wrap { display: grid; gap: var(--sp-2); }
.os-pv { position: relative; height: calc(var(--sp-32) * 3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; font-size: var(--fs-sm); }
.os-pv-lines { display: grid; gap: var(--sp-3); padding: var(--sp-12) var(--sp-4) var(--sp-4); }
.os-pv-lines i { display: block; height: var(--sp-3); border-radius: var(--radius-chip); background: var(--raised); }
.os-pv-lines i:nth-child(2) { width: 80%; }
.os-pv-lines i:nth-child(4) { width: 60%; }
.os-pv-scrim { position: absolute; inset: 0; background: var(--scrim); }
.os-pv-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 78%; display: grid; gap: var(--sp-2); padding: var(--sp-4); border-radius: var(--radius-card); background: var(--surface); box-shadow: var(--shadow-float); } /* taste-skill-ignore: 떠 있는 팝업 미리 보기 */
.os-pv-card img { width: 100%; max-height: calc(var(--sp-24)); object-fit: cover; border-radius: var(--radius-control); }
.os-pv-card b { font-size: var(--fs-body); font-weight: var(--fw-bold); overflow-wrap: anywhere; }
.os-pv-card p { margin: 0; color: var(--muted); white-space: pre-wrap; overflow-wrap: anywhere; }
.os-pv-btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--h-sm); padding: 0 var(--sp-3); border-radius: var(--radius-control); background: var(--accent); color: var(--accent-ink); font-weight: var(--fw-medium); font-size: var(--fs-xs); white-space: nowrap; }
.os-pv-close { justify-self: center; font-size: var(--fs-xs); color: var(--muted); }
.os-pv-banner { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); background: var(--accent-soft); color: var(--text); border-bottom: 1px solid var(--border); }
.os-pv-banner > span:first-child { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.os-pv-banner b { color: var(--accent-strong); font-weight: var(--fw-bold); }
.os-pv-nudge { position: absolute; right: var(--sp-3); bottom: calc(var(--sp-12) + var(--sp-3)); width: 70%; display: grid; gap: var(--sp-1); padding: var(--sp-3); border-radius: var(--radius-bubble); border-bottom-right-radius: var(--radius-bubble-tail); background: var(--surface); box-shadow: var(--shadow-float); white-space: pre-wrap; overflow-wrap: anywhere; } /* taste-skill-ignore: 말 걸기 미리 보기 */
.os-pv-link { color: var(--accent-strong); font-weight: var(--fw-medium); font-size: var(--fs-xs); }
.os-pv-launch { position: absolute; right: var(--sp-3); bottom: var(--sp-3); display: grid; place-items: center; width: var(--sp-10); height: var(--sp-10); border-radius: var(--radius-full); background: var(--accent); color: var(--accent-ink); }
@media (max-width: 1100px) {
  .scen-wrap, .form-wrap { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: calc(var(--list-width) - var(--sp-10)) minmax(0, 1fr); }
  .inbox:not([data-pane=side]) #c-side { display: none; }
  .inbox[data-pane=side] #c-thread { display: none; }
  .side-toggle, .side-back { display: inline-flex; }
  .setup { grid-template-columns: 1fr; }
  .preview { position: static; }
  .kb { grid-template-columns: 1fr; }
  .kb-list { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--rule); padding-bottom: var(--sp-3); }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: calc(var(--sp-12)) minmax(0, 1fr); }
  .topbar { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-2) 0 var(--sp-4); height: var(--sp-12); background: var(--frame); border-bottom: 1px solid var(--border); position: relative; z-index: var(--z-nav); }
  .topbar .brand { flex: 1; }
  .topbar .brand .logo { width: var(--h-sm); height: var(--h-sm); }
  nav.rail { display: none; position: fixed; top: var(--sp-12); left: 0; right: 0; bottom: 0; z-index: var(--z-nav); background: var(--frame); padding: var(--sp-3); }
  .shell.menu-open nav.rail { display: flex; }
  nav.rail > .brand { display: none; }
  .rail button.nav { height: var(--h-touch); }
  .shell > main { margin: 0; border: 0; border-radius: 0; }
}
@media (max-width: 760px) {
  /* 대화를 연 폰 화면: 목록 제목이 숨으므로 위 막대가 화면 이름을 맡는다 */
  .shell:has(.inbox:is([data-pane=thread], [data-pane=side])) .top-title { display: block; flex: 1; font-size: var(--fs-md); }
  .shell:has(.inbox:is([data-pane=thread], [data-pane=side])) .topbar .brand { flex: 0 0 auto; }
  .shell:has(.inbox:is([data-pane=thread], [data-pane=side])) .topbar .brand > :not(.logo) { display: none; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox #c-thread, .inbox #c-side, .inbox[data-pane=thread] #c-list, .inbox[data-pane=side] #c-list { display: none; }
  .inbox[data-pane=thread] #c-thread, .inbox[data-pane=side] #c-side { display: flex; }
  .col { border-right: 0; }
  .back { display: inline-flex; }
  .thread-head { padding: var(--sp-3); }
  .msg { max-width: 88%; }
  .page { padding: var(--sp-5) var(--sp-4) var(--sp-10); }
  .card { padding: var(--sp-4); }
  .table-wrap { overflow-x: auto; }
  .canned-add { grid-template-columns: 1fr; }
  .composer .modes { flex-wrap: wrap; }
  .composer .modes select { margin-left: 0; }
  .builder select, .builder input[type=text], .builder input[type=number], .builder .search { width: 100%; min-width: 0; flex: 1 1 100%; }
  .cond-acts, .name-edit { margin-left: 0; }
  .filter-card .lbl { min-width: 0; }
  .day { grid-template-columns: 1fr; gap: var(--sp-1); }
  .rule { grid-template-columns: auto minmax(0, 1fr); }
  .rule .no { display: none; }
  .rule-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .rule-line { grid-template-columns: minmax(0, 1fr) auto; }
  .rule-line .word { display: none; }
  .rule-line .val { grid-column: 1 / -1; grid-row: 2; }
  .btn-line { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 760px) {
  .drop-row { grid-template-columns: minmax(0, 1fr) auto; }
  .drop-row .drop-bar { grid-column: 1 / -1; }
  .drop-nums { flex-wrap: wrap; }
}

/* ---------- 2차 덩어리 5·6: 메뉴 묶음, 채널 표시, 참고한 문서, 규칙·지식 폴더, 통계, 채널 */
.nav-group { display: grid; gap: calc(var(--sp-1) / 2); }
.nav-group + .nav-group { margin-top: var(--sp-2); }
.nav-label { padding: var(--sp-1) var(--sp-3) calc(var(--sp-1) / 2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--faint); }
@media (min-width: 961px) { .rail button.nav { height: var(--h-md); } }
.pill.ch { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.pill.ch svg { color: var(--muted); }
.sources { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); margin-top: var(--sp-1); }
.sources .src { display: inline-flex; align-items: center; gap: var(--sp-1); height: calc(var(--sp-5) + var(--sp-1)); padding: 0 var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius-chip); background: var(--surface); color: var(--text); font-size: var(--fs-xs); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sources .src:hover { background: var(--raised); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.card-pad { padding: var(--card-pad) var(--card-pad) var(--sp-3); display: grid; gap: var(--sp-1); }
.note-card { background: var(--raised); border-color: transparent; }
.f-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.cond-edit { display: grid; gap: var(--sp-2); justify-items: start; }
.cond-row { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; width: 100%; }
.cond-row select, .cond-row input { width: auto; min-width: calc(var(--sp-32) + var(--sp-8)); }
.rule-list { display: grid; }
.rule-row { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; width: 100%; padding: var(--sp-3) var(--sp-2); border: 0; border-top: 1px solid var(--rule); background: transparent; color: var(--text); text-align: left; border-radius: var(--radius-control); }
.rule-row:first-child { border-top: 0; }
.rule-row:hover { background: var(--raised); }
.rule-row[aria-current=true] { background: var(--raised); }
.folder-list { display: grid; gap: var(--sp-3); }
.folder { border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--sp-3); display: grid; gap: var(--sp-2); }
.folder-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.folder-head .btn { margin-left: auto; }
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; }
.doc-list li { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--rule); font-size: var(--fs-sm); min-width: 0; }
.doc-list li:first-child { border-top: 0; }
.doc-list li .grow { min-width: 0; overflow-wrap: anywhere; }
.doc-list select { width: auto; min-height: var(--h-sm); font-size: var(--fs-xs); max-width: calc(var(--sp-32) + var(--sp-8)); }
.usage { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.usage li > * { margin-right: var(--sp-2); }
.usage li { display: list-item; }
.unanswered { display: grid; }
.un-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2) var(--sp-3); padding: var(--sp-3) 0; border-top: 1px solid var(--rule); }
.un-row:first-child { border-top: 0; }
.un-row .grow { min-width: calc(var(--sp-32) * 2); }
.test-ctx { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }
.test-out { display: grid; gap: var(--sp-3); }
.test-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-4); }
.test-grid section { display: grid; gap: var(--sp-2); align-content: start; }
.rule-check { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); font-size: var(--fs-sm); }
.rule-check li { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: baseline; }
/* 통계 */
.range-row { justify-content: space-between; }
.custom-range input[type=date] { width: auto; }
.stats-body { display: grid; gap: var(--gap); }
.big-num { font-size: var(--fs-title); font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.chart { margin: 0; display: grid; gap: var(--sp-3); min-width: 0; }
.chart-head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.chart-head > div { flex: 1; display: grid; gap: calc(var(--sp-1) / 2); }
.chart-svg { display: block; max-width: 100%; height: auto; overflow: visible; }
.chart-svg .bar-lo { fill: var(--control); }
.chart-svg .bar-hi { fill: var(--data); }
.chart-svg .track { fill: var(--raised); }
.chart-svg .heat { fill: var(--data); }
.chart-svg .axis { stroke: var(--border); }
.chart-svg .lbl { fill: var(--muted); font-size: 11px; }
.chart-svg .lbl-row { fill: var(--text); font-size: 13px; }
.chart-svg .lbl-strong { fill: var(--text); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.chart-table td, .chart-table th { padding: var(--sp-2) var(--sp-3); }
.chart-note { margin: 0; }
/* 채널 */
.channel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--sp-32) * 2), 1fr)); gap: var(--gap); }
.channel-grid a { color: var(--accent-strong); font-weight: var(--fw-medium); display: inline-flex; align-items: center; gap: var(--sp-1); }
.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.checklist li { display: flex; gap: var(--sp-2); align-items: baseline; }
.checklist li svg { color: var(--muted); flex: none; }
.outbox { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-3); max-height: calc(var(--sp-32) * 5); overflow: auto; }
.outbox li { border: 1px solid var(--border); border-radius: var(--radius-control); padding: var(--sp-3); display: grid; gap: var(--sp-2); }
.ob-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.ob-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-sm); }
.sim-result { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--radius-control); background: var(--raised); font-size: var(--fs-sm); }
@media (max-width: 760px) {
  .grid2, .test-grid, .test-ctx { grid-template-columns: 1fr; }
  .un-row .grow { min-width: 0; flex: 1 1 100%; }
  .cond-row select, .cond-row input { min-width: 0; flex: 1 1 100%; }
}
/* 업무용 AI: 물어보기·리포트·보드 */
.privacy-line { display: flex; align-items: center; gap: var(--sp-2); margin: 0; font-size: var(--fs-sm); color: var(--text); }
.privacy-line svg { color: var(--muted); flex: none; }
.ask-layout { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--sp-32) * 2 + var(--sp-12)); gap: var(--gap); align-items: start; }
.ask-main { display: grid; gap: var(--gap); min-width: 0; }
.ask-form { display: grid; gap: var(--sp-3); }
.ask-actions { justify-content: space-between; align-items: flex-start; }
.ask-actions .chips { flex: 1 1 calc(var(--sp-32) * 2); }
.ask-thread { display: grid; gap: var(--gap); }
.ask-answer { min-width: 0; }
.ask-q { display: flex; align-items: center; gap: var(--sp-2); overflow-wrap: anywhere; }
.ask-q svg { color: var(--muted); flex: none; }
.ask-prose { font-size: var(--fs-md); line-height: var(--lh-body); overflow-wrap: anywhere; margin: 0; }
.ask-notice { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: var(--fs-sm); }
.ask-block { display: grid; gap: var(--sp-2); padding-top: var(--sp-3); border-top: 1px solid var(--rule); min-width: 0; }
.ask-block > .row, .pin-row { justify-content: flex-end; }
.ask-result { display: grid; gap: var(--sp-3); min-width: 0; }
.ask-summary { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.ask-how summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); }
.ask-how ul { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); font-size: var(--fs-sm); }
.ask-side { position: sticky; top: var(--sp-4); }
.ask-history { list-style: none; margin: 0; padding: 0; display: grid; max-height: calc(var(--sp-32) * 4); overflow: auto; }
.ask-history .rule-row { font-size: var(--fs-sm); }
.ask-history .grow { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pin-wrap { display: inline-flex; align-items: center; gap: var(--sp-2); }
.pin-wrap select { width: auto; min-height: var(--h-sm); font-size: var(--fs-sm); }
.board-bar { display: grid; gap: var(--sp-3); }
.board-tools { gap: var(--sp-2); }
.board-body { display: grid; gap: var(--gap); }
.board-grid { display: grid; gap: var(--gap); }
.pin-card { min-width: 0; }
.pin-head { display: flex; justify-content: flex-end; gap: var(--sp-1); margin-bottom: calc(var(--sp-2) * -1); }
.back-link { justify-self: start; align-self: flex-start; margin-right: auto; }
.report-list .rule-row { gap: var(--sp-2); }
.report-sugg, .report-changes { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-3); }
.report-sugg li { display: grid; gap: var(--sp-1); }
@media (max-width: 960px) {
  .ask-layout { grid-template-columns: 1fr; }
  .ask-side { position: static; }
}
@media print {
  .rail, .topbar, .no-print, .toast, .chart-head .btn { display: none !important; }
  .shell, main, #main { display: block !important; height: auto !important; overflow: visible !important; padding: 0 !important; }
  body { background: var(--surface); }
  .card { break-inside: avoid; }
}
/* 말로 시키기 */
.cmd-thread { display: grid; gap: var(--sp-3); }
.cmd-hello { gap: var(--sp-1); }
.cmd-me { justify-self: end; max-width: 86%; padding: var(--sp-2) var(--sp-3); border-radius: var(--radius-bubble); border-top-right-radius: var(--radius-bubble-tail); background: var(--bubble-agent-bg); color: var(--bubble-agent-ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.cmd-bot { justify-self: stretch; display: grid; gap: var(--sp-2); min-width: 0; }
.cmd-bot > p { margin: 0; overflow-wrap: anywhere; }
.cmd-plan { gap: var(--sp-3); min-width: 0; }
.cmd-plan.money { border-color: var(--pill-warning-ink); }
.cmd-plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cmd-diff { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: var(--sp-2) var(--sp-4); margin: 0; font-size: var(--fs-sm); }
.cmd-diff dt { color: var(--muted); overflow-wrap: anywhere; }
.cmd-diff dd { margin: 0; overflow-wrap: anywhere; }
.cmd-before { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.cmd-arrow { color: var(--faint); }
.cmd-money { display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.cmd-money svg { flex: none; margin-top: 2px; }
.cmd-notes { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-1); font-size: var(--fs-sm); color: var(--muted); }
.cmd-actions { gap: var(--sp-2); }
.cmd-result { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--radius-control); background: var(--pill-accent-bg); color: var(--pill-accent-ink); font-size: var(--fs-sm); }
.cmd-result[hidden] { display: none; }
.cmd-result.bad { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.cmd-result .row { margin-left: auto; }
.cmd-log { list-style: none; margin: 0; padding: 0; display: grid; max-height: calc(var(--sp-32) * 5); overflow: auto; }
.cmd-log li { display: grid; gap: var(--sp-1); padding: var(--sp-3) 0; border-top: 1px solid var(--rule); min-width: 0; }
.cmd-log li:first-child { border-top: 0; padding-top: 0; }
.cmd-log-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cmd-log-when { margin-left: auto; }
.cmd-log-text { font-size: var(--fs-sm); overflow-wrap: anywhere; }
/* 광고(시험용) */
.ads-test { display: flex; align-items: center; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-4); border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: var(--fs-sm); justify-self: start; }
.ads-test svg { flex: none; }
.ads-account { min-width: 0; }
.ads-acc-body { display: grid; gap: var(--sp-2); }
.ads-acc-body p { margin: 0; overflow-wrap: anywhere; }
.ads-cap input { width: calc(var(--sp-32) - var(--sp-4)); }
.ads-check summary { cursor: pointer; font-size: var(--fs-sm); color: var(--muted); }
.ads-check .checklist { margin-top: var(--sp-2); font-size: var(--fs-sm); }
.ads-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(calc(var(--sp-32) + var(--sp-8)), 1fr)); gap: var(--sp-3); }
.ads-camps { list-style: none; margin: 0; padding: 0; display: grid; }
.ads-camp { display: grid; gap: var(--sp-3); padding: var(--sp-4) 0; border-top: 1px solid var(--rule); min-width: 0; }
.ads-camp:first-child { border-top: 0; padding-top: 0; }
.ads-camp-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.ads-camp-name { overflow-wrap: anywhere; }
.ads-camp-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--sp-3); font-variant-numeric: tabular-nums; font-weight: var(--fw-semibold); }
.ads-camp-nums span { display: grid; gap: 2px; }
.ads-camp-nums small { font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-medium); }
.ads-camp-tools { gap: var(--sp-2); }
.ads-camp-tools input { width: calc(var(--sp-32) - var(--sp-4)); }
.ads-confirm { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border-radius: var(--radius-control); background: var(--pill-warning-bg); color: var(--pill-warning-ink); font-size: var(--fs-sm); }
.ads-confirm[hidden] { display: none; }
.ads-url { margin: 0; font-family: var(--font-mono); font-size: var(--fs-xs); overflow-wrap: anywhere; padding: var(--sp-2) var(--sp-3); background: var(--raised); border-radius: var(--radius-control); }
@media (max-width: 760px) {
  .ads-camp-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmd-diff { grid-template-columns: 1fr; gap: 0 0; }
  .cmd-diff dd { margin-bottom: var(--sp-2); }
  .cmd-me { max-width: 92%; }
}

/* ---------- 직원(#staff) */
.staff-add { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); margin-bottom: var(--sp-2); }
.staff-table select { min-height: var(--h-sm); }
tr.off td { color: var(--muted); }
dl.role-kv { margin-block: var(--sp-3); }
dl.role-kv dt { font-weight: var(--fw-semibold); color: var(--text); }
.card.narrow { max-width: calc(var(--sp-32) * 4); display: grid; gap: var(--sp-3); }
.owner-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.owner-pick { margin-block: var(--sp-2); }

/* ---------- 내 고객 분석(#sales) · 직원별 보기(#sales-staff) */
.sv-tabs { border-bottom: 1px solid var(--rule); }
.sv-stages { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.sv-count { display: inline-flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1); border: 1px solid var(--border); border-radius: var(--radius-full); background: var(--surface); font-variant-numeric: tabular-nums; }
.sv-note { display: flex; align-items: flex-start; gap: var(--sp-1); }
.sv-note svg { flex: none; margin-top: calc(var(--sp-1) / 2); }
.sv-grid { display: grid; grid-template-columns: minmax(0, 1fr) calc(var(--sp-32) * 2 + var(--sp-12)); gap: var(--gap); align-items: start; }
.sv-side { display: grid; gap: var(--gap); }
.sv-sections { display: grid; gap: var(--sp-5); }
.sv-sec h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.sv-sec ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.sv-next { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-control); background: var(--accent-soft); }
.sv-point { display: grid; gap: var(--sp-1); padding-bottom: var(--sp-2); border-bottom: 1px solid var(--rule); }
.sv-sec li:last-child { border-bottom: 0; padding-bottom: 0; }
.sv-point-text { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-2); overflow-wrap: anywhere; }
.sv-cites { display: flex; flex-wrap: wrap; gap: var(--sp-1); }
.sv-cite { display: inline-flex; align-items: center; gap: var(--sp-1); height: var(--h-sm); padding: 0 var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius-chip); background: var(--surface); color: var(--accent-strong); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.sv-cite:hover, .sv-cite[aria-expanded=true] { background: var(--raised); }
.sv-quote { margin: 0; padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--accent); border-radius: 0 var(--radius-control) var(--radius-control) 0; background: var(--raised); display: grid; gap: var(--sp-1); justify-items: start; }
.sv-quote p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.sv-hist { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: var(--sp-2); }
.sv-hist li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); }
.sv-over { display: grid; gap: var(--gap); }
.sv-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); }
table.sv-bars th { width: calc(var(--sp-16) + var(--sp-2)); font-weight: var(--fw-medium); color: var(--text); background: none; }
table.sv-bars td, table.sv-bars th { border: 0; padding-block: var(--sp-1); }
.sv-bar { height: var(--sp-2); min-width: 2px; border-radius: var(--radius-full); background: var(--accent); }
.sv-obj { margin: 0; padding-left: var(--sp-5); display: grid; gap: var(--sp-2); }
.sv-obj li { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.sv-review { display: grid; gap: var(--sp-3); }
.sv-rev-row h3 { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-md); margin-bottom: var(--sp-1); }
@media (max-width: 960px) {
  .sv-grid, .sv-two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .staff-add { grid-template-columns: minmax(0, 1fr); }
  .sv-stages { gap: var(--sp-1); }
}

/* 내 고객 분석: 좁은 화면에서 이름이 한 글자씩 꺾이지 않게 */
.sv-table td:first-child, .sv-table th { white-space: nowrap; }
.sv-sum-head { flex-wrap: wrap; }
.sv-sum-head h2 { white-space: nowrap; }

/* 이탈 분석 (#dropoff) */
.dropoff > .card, .dropoff > .kpis, .dropoff > .grid2 { margin-top: var(--sp-4); }
.do-page { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.do-leaks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.do-leak { display: flex; width: 100%; justify-content: space-between; align-items: center; gap: var(--sp-3); flex-wrap: wrap; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); color: var(--text); text-align: left; cursor: pointer; transition: background var(--t-hover); }
.do-leak:hover { background: var(--raised); }
.do-leak-num { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-variant-numeric: tabular-nums; }
.do-table td { vertical-align: top; }
.do-table td:first-child .do-page { min-width: calc(var(--sp-32) + var(--sp-8)); }
.do-table .pill { white-space: nowrap; }
.do-next { min-width: calc(var(--sp-32) + var(--sp-8)); }
.do-chip { display: inline-block; margin: 0 var(--sp-1) var(--sp-1) 0; padding: 0 var(--sp-2); border: 1px solid var(--border); border-radius: var(--radius-full); font-size: var(--fs-xs); white-space: nowrap; }
.do-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.do-steps > li { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); }
.do-steps > li.worst { border-color: var(--negative); }
.do-step-head { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; }
.do-topics { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.do-samples, .do-sugs { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.do-samples > li, .do-sug { padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius-card); overflow-wrap: anywhere; }
.do-sug-row { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--sp-2); }
.do-old { text-decoration: line-through; color: var(--muted); margin: 0; }
.do-new { font-weight: var(--fw-semibold); margin: 0; }
.do-warn { color: var(--warning); }
.do-defs { margin-top: var(--sp-4); }
@media (max-width: 760px) {
  .do-leak-num { align-items: flex-start; }
}

/* 홈페이지 (#sites) */
.sites > .grid2, .sites > .site-edit, .sites > .site-warn { margin-top: var(--sp-4); }
.site-list { display: grid; gap: var(--gap); min-width: 0; }
.site-card, .sites form.card-pad { gap: var(--sp-3); }
.site-card p { margin: 0; overflow-wrap: anywhere; }
.site-card-head { justify-content: space-between; flex-wrap: wrap; }
.site-warn { display: grid; gap: var(--sp-1); }
.site-warn p { margin: 0; }
.site-tabs { display: none; }
.site-edit { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.site-left { display: grid; gap: var(--sp-2); min-width: 0; position: sticky; top: var(--sp-4); }
.site-left-head { flex-wrap: wrap; gap: var(--sp-2); }
.site-left-head .btn { margin-left: auto; }
.site-frame { width: 100%; height: calc(100vh - var(--sp-32) - var(--sp-16)); min-height: calc(var(--sp-32) * 3); border: 1px solid var(--border); border-radius: var(--radius-card); background: #fff; }
.site-right { display: grid; gap: var(--gap); min-width: 0; }
.site-right .card-pad { gap: var(--sp-3); }
.site-right h2, .site-right p { margin: 0; overflow-wrap: anywhere; }
.site-sel { min-height: calc(var(--sp-16) + var(--sp-8)); }
.site-field { display: grid; gap: var(--sp-2); min-width: 0; }
.site-field .row { flex-wrap: wrap; }
.site-field input[type=url] { flex: 1 1 12rem; min-width: 0; }
.site-field input[type=file], .site-edit input[type=file] { max-width: 100%; }
.site-chat-log { display: grid; gap: var(--sp-3); max-height: calc(var(--sp-32) * 3); overflow: auto; }
.site-chat-log:empty { display: none; }
.site-chat textarea { width: 100%; resize: vertical; }
.site-vers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-2); }
.site-ver { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2); padding: var(--sp-2) 0; border-top: 1px solid var(--rule); }
.site-ver:first-child { border-top: 0; }
.site-ver .pill { margin-left: var(--sp-2); }
.site-todraft { display: inline-flex; align-items: center; gap: var(--sp-1); }
@media (max-width: 960px) {
  .site-tabs { display: flex; margin: var(--sp-4) 0 0; }
  .site-edit { grid-template-columns: minmax(0, 1fr); }
  .site-left { position: static; }
  .site-edit[data-pane=preview] .site-right, .site-edit[data-pane=side] .site-left { display: none; }
  .site-frame { height: 70vh; }
}
