:root {
  --bg: #F4F5F8; --surface: #FFFFFF; --surface-2: #EDEFF3; --surface-3: #F7F8FA;
  --ink: #191C22; --ink-2: #565F6C; --ink-3: #8892A0; --line: #E2E5EB; --line-2: #EDEFF3;
  --accent: #3538CD; --accent-2: #4B4FE0; --accent-weak: #ECEDFB; --accent-ink: #FFFFFF; --naver: #03C75A;
  --st-ai: #6741D9; --st-ai-bg: #EFEAFB; --st-wait: #E8590C; --st-wait-bg: #FCEBDF;
  --st-human: #1971C2; --st-human-bg: #E6F0FB; --st-resolved: #2F9E44; --st-resolved-bg: #E5F4E9;
  --shadow-sm: 0 1px 2px rgba(20,25,40,.05);
  --shadow: 0 1px 2px rgba(20,25,40,.05), 0 6px 18px rgba(20,25,40,.06);
  --shadow-pop: 0 8px 30px rgba(20,25,40,.14);
  --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-pill: 999px;
  --rail-w: 60px; --list-w: 360px; --ctx-w: 316px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
          "Malgun Gothic", "Segoe UI", "Noto Sans KR", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0D0F13; --surface: #15181E; --surface-2: #1D212A; --surface-3: #171A21;
    --ink: #E9ECF2; --ink-2: #A0A9B6; --ink-3: #69727F; --line: #282D37; --line-2: #21252E;
    --accent: #7B7DF2; --accent-2: #8E90F6; --accent-weak: #24274A; --accent-ink: #0D0F13; --naver: #05D267;
    --st-ai: #9B7DFA; --st-ai-bg: #241C3C; --st-wait: #FF922B; --st-wait-bg: #3A2413;
    --st-human: #56AEF7; --st-human-bg: #122736; --st-resolved: #55CF6B; --st-resolved-bg: #102C1A;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.4);
    --shadow-pop: 0 10px 34px rgba(0,0,0,.55);
  }
}
:root[data-theme="light"] {
  --bg: #F4F5F8; --surface: #FFFFFF; --surface-2: #EDEFF3; --surface-3: #F7F8FA;
  --ink: #191C22; --ink-2: #565F6C; --ink-3: #8892A0; --line: #E2E5EB; --line-2: #EDEFF3;
  --accent: #3538CD; --accent-2: #4B4FE0; --accent-weak: #ECEDFB; --accent-ink: #FFFFFF; --naver: #03C75A;
  --st-ai: #6741D9; --st-ai-bg: #EFEAFB; --st-wait: #E8590C; --st-wait-bg: #FCEBDF;
  --st-human: #1971C2; --st-human-bg: #E6F0FB; --st-resolved: #2F9E44; --st-resolved-bg: #E5F4E9;
  --shadow-sm: 0 1px 2px rgba(20,25,40,.05);
  --shadow: 0 1px 2px rgba(20,25,40,.05), 0 6px 18px rgba(20,25,40,.06);
  --shadow-pop: 0 8px 30px rgba(20,25,40,.14);
}
:root[data-theme="dark"] {
  --bg: #0D0F13; --surface: #15181E; --surface-2: #1D212A; --surface-3: #171A21;
  --ink: #E9ECF2; --ink-2: #A0A9B6; --ink-3: #69727F; --line: #282D37; --line-2: #21252E;
  --accent: #7B7DF2; --accent-2: #8E90F6; --accent-weak: #24274A; --accent-ink: #0D0F13; --naver: #05D267;
  --st-ai: #9B7DFA; --st-ai-bg: #241C3C; --st-wait: #FF922B; --st-wait-bg: #3A2413;
  --st-human: #56AEF7; --st-human-bg: #122736; --st-resolved: #55CF6B; --st-resolved-bg: #102C1A;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 22px rgba(0,0,0,.4);
  --shadow-pop: 0 10px 34px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; overflow: hidden;
}
::selection { background: var(--accent-weak); }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
svg { display: block; }
.tnum { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

.app { height: 100vh; display: flex; }

/* login */
.login-overlay {
  position: fixed; inset: 0; z-index: 100; background: var(--bg);
  display: grid; place-items: center;
}
.login-card {
  width: 340px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 30px 28px;
}
.login-card .logo { margin: 0 auto 14px; }
.login-card h1 { margin: 0 0 4px; font-size: 19px; font-weight: 800; text-align: center; }
.login-card .sub { text-align: center; color: var(--ink-3); font-size: 12.5px; margin-bottom: 22px; }
.login-card label { display: block; font-size: 11.5px; font-weight: 700; color: var(--ink-2); margin: 12px 0 5px; }
.login-card input {
  width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink); font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-card .err { color: var(--st-wait); font-size: 12px; margin-top: 10px; min-height: 18px; }
.login-card button {
  width: 100%; height: 42px; margin-top: 8px; border: 0; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700;
}
.login-card button:hover { background: var(--accent-2); }

/* rail */
.rail {
  width: var(--rail-w); flex: none; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 6px;
}
.logo {
  width: 34px; height: 34px; border-radius: 10px; margin-bottom: 10px;
  background: linear-gradient(150deg, var(--accent-2), var(--accent));
  display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-sm);
}
.rail-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 0; background: transparent;
  color: var(--ink-3); display: grid; place-items: center; position: relative; transition: .15s;
}
.rail-btn:hover { background: var(--surface-2); color: var(--ink-2); }
.rail-btn.active { background: var(--accent-weak); color: var(--accent); }
.rail-btn.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 3px; background: var(--accent);
}
.rail-spacer { flex: 1; }
.rail-ava { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; background: #E8590C; cursor: default; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* topbar */
.topbar { height: 60px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 16px; padding: 0 18px; }
.brand { display: flex; align-items: baseline; gap: 9px; }
.brand b { font-size: 15px; font-weight: 800; }
.brand .tag { font-size: 11px; color: var(--ink-3); font-weight: 600; padding-left: 9px; border-left: 1px solid var(--line); }
.kpis { display: flex; align-items: center; gap: 22px; }
.kpi { display: flex; flex-direction: column; line-height: 1.15; }
.kpi .v { font-size: 15px; font-weight: 800; }
.kpi .l { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.kpi .v.attn { color: var(--st-wait); }
.ai-badge { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: var(--r-pill); }
.ai-badge.on { color: var(--st-ai); background: var(--st-ai-bg); }
.ai-badge.off { color: var(--ink-3); background: var(--surface-2); }
.live { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--st-resolved); padding: 5px 10px; border-radius: var(--r-pill); background: var(--st-resolved-bg); }
.live .pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--st-resolved); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st-resolved) 55%, transparent); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live.off { color: var(--ink-3); background: var(--surface-2); }
.live.off .pulse { background: var(--ink-3); animation: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: grid; place-items: center; transition: .15s; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

#viewRoot { flex: 1; min-height: 0; }
.workspace {
  height: 100%; display: grid;
  grid-template-columns: var(--list-w) minmax(0, 1fr) var(--ctx-w);
  grid-template-rows: minmax(0, 1fr); /* 자식이 컨테이너보다 커지지 않게 고정 */
}
.workspace > * { min-height: 0; } /* 그리드 자식 min-height:auto 기본값이 내부 스크롤을 막는 것 방지 */

/* list column */
.list-col { border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.list-head { padding: 14px 14px 10px; border-bottom: 1px solid var(--line-2); }
.list-title { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; }
.list-title h1 { margin: 0; font-size: 16px; font-weight: 800; }
.list-title .count { font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); padding: 2px 8px; border-radius: var(--r-pill); }
.search { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 11px; background: var(--surface-2); border-radius: var(--r-sm); color: var(--ink-3); margin-bottom: 12px; }
.search input { border: 0; background: transparent; outline: none; color: var(--ink); font-size: 13px; width: 100%; }
.tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: var(--r-sm); }
.tab { flex: 1; border: 0; background: transparent; color: var(--ink-2); font-weight: 700; font-size: 12px; padding: 6px 4px; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 5px; transition: .15s; }
.tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.tab .b { font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; padding: 0 4px; border-radius: var(--r-pill); display: inline-grid; place-items: center; color: #fff; }
.tab .b.wait { background: var(--st-wait); }
.tab .b.plain { background: var(--ink-3); }
.filter-rows { border-bottom: 1px solid var(--line-2); }
.pills { display: flex; gap: 6px; padding: 9px 14px 4px; overflow-x: auto; scrollbar-width: none; }
.pills:last-child { padding-bottom: 10px; }
.pills::-webkit-scrollbar { display: none; }
.pills .plabel { flex: none; font-size: 10.5px; font-weight: 800; color: var(--ink-3); align-self: center; width: 30px; }
.spill { flex: none; display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 12px; font-weight: 700; transition: .15s; }
.spill:hover { border-color: var(--ink-3); }
.spill.active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.spill .d { width: 8px; height: 8px; border-radius: 50%; }
.conv-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px; }
.conv-list::-webkit-scrollbar { width: 8px; }
.conv-list::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.conv { display: grid; grid-template-columns: 40px 1fr; gap: 11px; padding: 12px 11px 12px 12px; border-radius: var(--r); cursor: pointer; position: relative; margin-bottom: 2px; border: 1px solid transparent; transition: background .12s; }
.conv::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--stc, var(--ink-3)); opacity: 0; }
.conv:hover { background: var(--surface-3); }
.conv.sel { background: var(--accent-weak); border-color: color-mix(in srgb, var(--accent) 22%, transparent); }
.conv.sel::before { opacity: 1; }
.conv.unreadrow .cname { font-weight: 800; }
.ava { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 15px; position: relative; flex: none; }
.ava .ch { position: absolute; right: -3px; bottom: -3px; width: 17px; height: 17px; border-radius: 6px; background: var(--naver); display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 900; border: 2px solid var(--surface); }
.conv-body { min-width: 0; }
.conv-row1 { display: flex; align-items: center; gap: 6px; }
.cname { font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.store-badge { font-size: 10.5px; font-weight: 700; color: var(--ink-2); background: var(--surface-2); padding: 1px 7px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.store-badge .d { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.conv-time { margin-left: auto; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.conv-summary { font-size: 12px; color: var(--ink-2); font-weight: 600; margin: 3px 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-preview { font-size: 12.5px; color: var(--ink-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv-preview .by { color: var(--ink-2); font-weight: 700; }
.conv-meta { display: flex; align-items: center; gap: 6px; margin-top: 7px; }
.pill { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ai { color: var(--st-ai); background: var(--st-ai-bg); }
.pill.wait { color: var(--st-wait); background: var(--st-wait-bg); }
.pill.human { color: var(--st-human); background: var(--st-human-bg); }
.pill.resolved { color: var(--st-resolved); background: var(--st-resolved-bg); }
.mini { font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.unread { margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.empty-note { padding: 40px 20px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* chat */
.chat-col { display: flex; flex-direction: column; min-width: 0; background: var(--surface-3); }
.chat-head { min-height: 60px; flex: none; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 18px; }
.chat-head .ava { width: 36px; height: 36px; border-radius: 10px; font-size: 14px; }
.chat-head-info { min-width: 0; }
.chat-head-info .r1 { display: flex; align-items: center; gap: 8px; }
.chat-head-info b { font-size: 14.5px; font-weight: 800; }
.chat-head-info .r2 { font-size: 12px; color: var(--ink-3); font-weight: 600; margin-top: 1px; }
.chat-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.btn { height: 34px; padding: 0 13px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; transition: .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.solid { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.solid:hover { background: var(--accent-2); }
.btn.warn { color: var(--st-wait); border-color: color-mix(in srgb, var(--st-wait) 30%, var(--line)); }
.btn.ok { color: var(--st-resolved); border-color: color-mix(in srgb, var(--st-resolved) 30%, var(--line)); }
.thread { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 34px 12px; }
.thread::-webkit-scrollbar { width: 9px; }
.thread::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.day-sep { display: flex; align-items: center; gap: 12px; margin: 6px 0 18px; color: var(--ink-3); }
.day-sep::before, .day-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.day-sep span { font-size: 11px; font-weight: 700; }
.msg { display: flex; gap: 10px; margin-bottom: 16px; max-width: 74%; }
.msg .mava { width: 28px; height: 28px; border-radius: 9px; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 11px; margin-top: 2px; }
.bubble { padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.55; box-shadow: var(--shadow-sm); white-space: pre-wrap; word-break: break-word; }
.who { font-size: 11px; font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.who .aitag { font-size: 9.5px; font-weight: 900; color: var(--st-ai); background: var(--surface); border: 1px solid color-mix(in srgb, var(--st-ai) 30%, transparent); padding: 0 5px; border-radius: 5px; }
.mtime { font-size: 10.5px; color: var(--ink-3); margin-top: 5px; }
.msg.in .bubble { background: var(--surface); border-bottom-left-radius: 5px; }
.msg.ai .bubble { background: var(--st-ai-bg); border-bottom-left-radius: 5px; }
.msg.ai .who { color: var(--st-ai); }
.msg.ai .mava { background: linear-gradient(150deg, #8E7BF5, var(--st-ai)); }
.msg.out { margin-left: auto; flex-direction: row-reverse; }
.msg.out .bubble { background: var(--accent); color: #fff; border-bottom-right-radius: 5px; box-shadow: var(--shadow); }
.msg.out .who { color: rgba(255,255,255,.85); justify-content: flex-end; }
.msg.out .mtime { text-align: right; }
.msg.out .mava { background: var(--ink); }
.qr { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.qr .chip { font-size: 11.5px; font-weight: 700; color: var(--st-ai); background: var(--surface); border: 1px solid color-mix(in srgb, var(--st-ai) 26%, transparent); padding: 5px 11px; border-radius: var(--r-pill); }
.sysline { display: flex; justify-content: center; margin: 4px 0 18px; }
.sysline span { font-size: 11.5px; color: var(--ink-2); font-weight: 600; background: var(--surface-2); padding: 5px 12px; border-radius: var(--r-pill); }

/* composer */
.composer { flex: none; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 18px 14px; }
.composer-box { display: flex; align-items: flex-end; gap: 10px; background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 8px 8px 14px; }
.composer-box:focus-within { border-color: var(--accent); }
.composer-box textarea { flex: 1; border: 0; background: transparent; outline: none; resize: none; color: var(--ink); font-size: 14px; line-height: 1.5; max-height: 120px; padding: 6px 0; }
.cbtns { display: flex; align-items: center; gap: 6px; }
.send { width: 38px; height: 38px; border-radius: 10px; border: 0; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: .15s; }
.send:hover { background: var(--accent-2); }
.send:disabled { opacity: .4; }
.ai-suggest { height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--st-ai) 32%, var(--line)); background: var(--st-ai-bg); color: var(--st-ai); font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.ai-suggest:disabled { opacity: .5; }

/* context */
.ctx-col { border-left: 1px solid var(--line); background: var(--surface); overflow-y: auto; }
.ctx-hero { padding: 22px 18px 18px; text-align: center; border-bottom: 1px solid var(--line-2); }
.ctx-hero .ava { width: 56px; height: 56px; border-radius: 16px; font-size: 20px; margin: 0 auto 11px; }
.ctx-hero b { font-size: 16px; font-weight: 800; }
.ctx-hero .sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.ctx-sec { padding: 16px 18px; border-bottom: 1px solid var(--line-2); }
.ctx-sec h3 { margin: 0 0 12px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.kv { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; font-size: 13px; }
.kv:last-child { margin-bottom: 0; }
.kv .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--surface-2); color: var(--ink-2); display: grid; place-items: center; flex: none; }
.kv .kk { color: var(--ink-3); font-size: 11.5px; font-weight: 600; }
.kv .vv { font-weight: 700; word-break: break-all; }
.kv .krow { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.ctx-note { font-size: 11.5px; color: var(--ink-3); background: var(--surface-3); border: 1px dashed var(--line); border-radius: var(--r-sm); padding: 9px 11px; line-height: 1.5; }

/* pages */
.page { height: 100%; overflow-y: auto; background: var(--bg); }
.page::-webkit-scrollbar { width: 10px; }
.page::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }
.page-inner { max-width: 1120px; margin: 0 auto; padding: 26px 30px 70px; }
.page-head { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; }
.page-head .sub { color: var(--ink-3); font-size: 13px; font-weight: 600; padding-bottom: 2px; }
.page-head .ha { margin-left: auto; display: flex; gap: 8px; }
.grid-kpi { display: grid; grid-template-columns: repeat(auto-fit, minmax(178px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 15px 16px; box-shadow: var(--shadow-sm); }
.stat .l { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.stat .v { font-size: 25px; font-weight: 800; margin-top: 6px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.phead { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.phead h2 { margin: 0; font-size: 15px; font-weight: 800; }
.phead .pd { font-size: 12.5px; color: var(--ink-3); margin-top: 3px; font-weight: 600; }
.phead .pa { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.bars { display: flex; align-items: flex-end; gap: 12px; height: 174px; }
.bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 7px; }
.bar .col { width: 62%; max-width: 36px; border-radius: 6px 6px 0 0; background: color-mix(in srgb, var(--accent) 26%, var(--surface-2)); }
.bar.hot .col { background: var(--accent); }
.bar .bv { font-size: 11px; font-weight: 800; color: var(--ink-2); }
.bar .bl { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.stack { display: flex; height: 16px; border-radius: 8px; overflow: hidden; gap: 2px; margin-bottom: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; }
.legend .li { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.legend .li .sw2 { width: 11px; height: 11px; border-radius: 3px; }
.legend .li b { color: var(--ink); font-weight: 800; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
.tbl th { text-align: right; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; padding: 0 12px 12px; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line-2); font-weight: 700; text-align: right; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .st { display: inline-flex; align-items: center; gap: 7px; }
.tbl .st .d { width: 8px; height: 8px; border-radius: 50%; }

/* store management */
.biz-group { margin-bottom: 26px; }
.biz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.biz-head .bic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800; }
.biz-head b { font-size: 16px; font-weight: 800; }
.biz-head .bi { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.store-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; box-shadow: var(--shadow-sm); }
.sc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 13px; }
.sc-name { font-size: 15px; font-weight: 800; }
.sc-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 1px; }
.conn { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 3px 9px; border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 5px; }
.conn.on { color: var(--naver); background: color-mix(in srgb, var(--naver) 14%, var(--surface)); }
.conn.off { color: var(--ink-3); background: var(--surface-2); }
.conn .d { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.field { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.field .fl { font-weight: 700; flex: none; width: 96px; font-size: 12.5px; color: var(--ink-2); }
.field .fr { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.input2 { height: 34px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink); font-size: 12.5px; width: 100%; min-width: 0; outline: none; }
.input2:focus { border-color: var(--accent); }
.input2.mono { font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tinybtn { height: 30px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.tinybtn:hover { background: var(--surface-2); color: var(--ink); }
.sw { width: 40px; height: 23px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line); position: relative; flex: none; transition: .2s; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .2s; }
.sw[data-on="true"] { background: var(--accent); border-color: var(--accent); }
.sw[data-on="true"]::after { left: 19px; }

/* faq */
.faq-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.faq-item:last-child { border-bottom: 0; }
.faq-item .fq { flex: 1; min-width: 0; }
.faq-item .fq b { font-size: 13.5px; font-weight: 700; }
.faq-item .fq p { margin: 4px 0 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.45; }
.faq-form { display: grid; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.faq-form textarea { min-height: 56px; padding: 9px 11px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink); font-size: 13px; resize: vertical; outline: none; }
.faq-form textarea:focus, .sim-form textarea:focus, .sim-form input:focus, .sim-form select:focus { border-color: var(--accent); }

/* simulator */
.sim-form { display: grid; gap: 12px; max-width: 560px; }
.sim-form label { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.sim-form select, .sim-form input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--ink); font-size: 13.5px; outline: none; width: 100%;
}
.sim-form textarea { min-height: 72px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-3); color: var(--ink); font-size: 13.5px; resize: vertical; outline: none; }
.sim-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.sim-quick button { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); padding: 6px 12px; border-radius: var(--r-pill); }
.sim-quick button:hover { border-color: var(--accent); color: var(--accent); }

/* toast */
.toast-wrap { position: fixed; top: 70px; right: 22px; display: flex; flex-direction: column; gap: 10px; z-index: 80; }
.toast { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-pop); padding: 12px 14px; display: flex; align-items: center; gap: 11px; min-width: 260px; max-width: 340px; animation: slidein .3s cubic-bezier(.2,.8,.2,1); }
.toast .ti { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; font-weight: 900; font-size: 13px; }
.toast b { font-size: 13px; font-weight: 700; display: block; }
.toast small { font-size: 12px; color: var(--ink-3); }
@keyframes slidein { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 1220px) {
  :root { --ctx-w: 0px; }
  .ctx-col { display: none; }
  .workspace { grid-template-columns: var(--list-w) minmax(0,1fr); }
  .kpis .kpi:nth-child(n+3) { display: none; }
}
@media (max-width: 980px) { .cols2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .kpis { display: none; } }
@media (max-width: 760px) {
  :root { --list-w: 0px; }
  .list-col { display: none; }
  .workspace { grid-template-columns: minmax(0,1fr); }
}
