/* 디자인 시스템 — docs/design/prompts/00_디자인시스템.md 와 같은 값 */
:root {
  --bg: #0E1116; --side: #0B0E13; --surface: #161B22; --raised: #1E2530; --border: #2D3541;
  --text: #E6EAF0; --muted: #8B95A5; --accent: #5B8CFF; --ok: #3FB950; --warn: #F0883E; --danger: #F85149;
  --accent-soft: rgba(91, 140, 255, .14); --ok-soft: rgba(63, 185, 80, .14); --warn-soft: rgba(240, 136, 62, .14); --danger-soft: rgba(248, 81, 73, .14);
  --r-card: 12px; --r-ctl: 8px; --side-w: 232px;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: Pretendard, "Pretendard Variable", -apple-system, "Segoe UI", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px; color: var(--text); background: var(--bg); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; font-weight: 600; margin: 0; }
h2 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }

/* 컨트롤 */
button, .btn {
  height: 36px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--border);
  background: transparent; color: var(--text); font: inherit; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
button:hover, .btn:hover { background: var(--raised); text-decoration: none; }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.primary:hover, .btn.primary:hover { text-decoration: none; filter: brightness(1.08); }
button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
button.ghost { border-color: transparent; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; min-width: 140px; height: 40px; justify-content: center; }
button.danger-line { border-color: var(--danger); color: var(--danger); min-width: 140px; height: 40px; justify-content: center; }
button.sm { height: 28px; padding: 0 10px; font-size: 12px; }
button.icon { width: 36px; padding: 0; justify-content: center; font-size: 18px; }
input, select, textarea {
  font: inherit; color: var(--text); background: var(--raised); border: 1px solid var(--border); border-radius: var(--r-ctl);
  padding: 8px 10px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.auth input:not([type=checkbox]), .modal input:not([type=checkbox]):not([type=radio]) { background: var(--bg); height: 44px; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; padding: 0; }
label.field { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
label.field input { font-size: 14px; }
.err-text { color: var(--danger); font-size: 12px; min-height: 16px; }

.switch { position: relative; width: 36px; height: 20px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 10px; background: #3a4250; transition: .15s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::after { left: 18px; }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--raised); font-size: 12px; color: var(--muted); }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.accent { background: var(--accent-soft); color: var(--accent); }
.chip.ok, .chip.warn, .chip.danger, .chip.accent { border: 1px solid color-mix(in srgb, currentColor 45%, transparent); }
/* 모델별 칩 색(시안 02): Opus 파랑 · Sonnet 보라 · Haiku 초록 · Fable 주황 */
.chip.model { border: 1px solid color-mix(in srgb, currentColor 40%, transparent); height: 28px; font-size: 13px; }
.chip.m-opus { background: var(--accent-soft); color: var(--accent); } .chip.m-sonnet { background: rgba(180,140,255,.14); color: #B48CFF; }
.chip.m-haiku { background: var(--ok-soft); color: var(--ok); } .chip.m-fable { background: var(--warn-soft); color: var(--warn); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); display: inline-block; flex: none; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.danger { background: var(--danger); } .dot.accent { background: var(--accent); }
.dot.pulse { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { display: inline-block; animation: spin 1s linear infinite; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 16px; }
.banner { padding: 8px 16px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.banner.warn { background: var(--warn-soft); color: var(--warn); }
.banner.danger { background: var(--danger-soft); color: var(--danger); }
.banner.gray { background: var(--raised); color: var(--muted); }

/* 막대: 쓴 양(채움) · 남은 양(트랙) · 리미트(세로 눈금) */
.bar { position: relative; height: 8px; border-radius: 4px; background: #262d38; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.bar > b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: #fff; border-radius: 1px; }
.bar.warn > i { background: var(--warn); } .bar.danger > i { background: var(--danger); } .bar.ok > i { background: var(--ok); }

/* 틀 */
#app { height: 100%; }
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; }
.side .brand { font-weight: 700; font-size: 15px; padding: 4px 8px 16px; display: flex; gap: 8px; align-items: center; }
.side .brand .logo { width: 28px; height: 28px; padding: 4px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; color: #fff; font-size: 13px; }
.side a.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; font-size: 15px; border-radius: var(--r-ctl); color: var(--muted); }
.side a.nav:hover { background: var(--surface); text-decoration: none; color: var(--text); }
.side a.nav.active { background: var(--accent-soft); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.ic, .logo, .mail-ic { display: inline-grid; place-items: center; flex: none; } .ic svg, .logo svg, .mail-ic svg { width: 100%; height: 100%; }
.side a.nav .ic { width: 22px; height: 22px; }
.side a.nav.active .ic { color: var(--accent); }
.side .spacer { flex: 1; }
.side .who { border-top: 1px solid var(--border); padding: 12px 8px 0; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.col { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.topbar { flex: none; height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 0 24px; border-bottom: 1px solid var(--border); font-size: 14px; }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.col > .main { flex: 1; height: auto; }
.page { flex: 1; overflow: auto; padding: 24px 32px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.mockbadge { position: fixed; right: 8px; bottom: 8px; z-index: 50; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); pointer-events: none; }

/* 인증 화면 */
.auth { height: 100%; display: grid; place-items: center; padding: 24px; overflow: auto; }
.auth .card { width: 445px; max-width: 100%; padding: 36px 32px; display: grid; gap: 16px; }
.auth .card > .row:first-child { flex-direction: column; text-align: center; gap: 12px; margin-bottom: 8px; }
.auth .card button[type=submit] { width: 100%; height: 44px; justify-content: center; font-weight: 600; }
.auth .mail-ic { width: 72px; height: 72px; justify-self: center; color: var(--accent); margin: 8px 0 4px; }
.auth button.wide { width: 100%; height: 44px; justify-content: center; font-weight: 600; }
button.accent-line { border-color: var(--accent); color: var(--accent); }
.auth .logo { width: 52px; height: 52px; padding: 10px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; color: #fff; font-weight: 700; }

/* 목록 */
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); }
.item.link { cursor: pointer; } .item.link:hover { border-color: #3d4757; }
.item.running { border-color: var(--accent); box-shadow: inset 4px 0 0 var(--accent); background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--surface); }
.item .del { opacity: .45; } .item:hover .del, .item .del:focus { opacity: 1; }
@media (hover: none) { .item .del { opacity: 1; } }
.pw { position: relative; display: block; } .pw input { width: 100%; padding-right: 40px; }
.pw button { position: absolute; right: 2px; top: 2px; height: 32px; width: 36px; padding: 0; border: 0; justify-content: center; color: var(--muted); }
.item .title { font-weight: 600; font-size: 17px; }
.item .sub { color: var(--muted); font-size: 15px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--r-card); }
.skeleton { height: 64px; border-radius: var(--r-card); background: linear-gradient(90deg, var(--surface), var(--raised), var(--surface)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }

/* 모달 */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); display: grid; place-items: center; z-index: 20; padding: 16px; }
.modal { width: 600px; max-width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 24px; display: grid; gap: 16px; box-shadow: 0 12px 40px rgba(0,0,0,.5); }
.modal h2 { font-size: 20px; padding-right: 32px; }
.modal { position: relative; grid-template-columns: minmax(0, 1fr); } .modal-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; font-size: 16px; color: var(--muted); }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; }
.steps { display: flex; gap: 8px; font-size: 12px; color: var(--muted); }
.steps span { flex: 1; padding-top: 6px; border-top: 3px solid var(--border); }
.steps span.on { color: var(--text); border-color: var(--accent); }
.steps span.done { border-color: var(--ok); }
.codebox.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; word-break: normal; }
.codebox { font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px; word-break: break-all; }

/* LLM 관리 */
.llm { padding: 0; }
.llm.off { opacity: .6; }
.llm.limit { border: 2px solid var(--warn); }
.llm-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.llm-head .name { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.llm-body { display: grid; grid-template-columns: 1fr 1fr; }
.llm-body > * { padding: 16px 20px; }
.llm-body > * + * { border-left: 1px solid var(--border); }
.llm-note { padding: 14px 16px; display: flex; gap: 8px; align-items: center; }
.usage { display: grid; gap: 6px; }
.usage .lbl { position: relative; height: 20px; font-size: 13px; }
.usage .limit-lbl { position: absolute; top: 2px; transform: translateX(-50%); font-size: 12px; color: var(--muted); white-space: nowrap; }
.bar.big { height: 20px; border-radius: 10px; }
.bar.big > i { border-radius: 10px; }
.usage .ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.usage .nums { font-size: 13px; font-family: var(--mono); }
.limit-in { width: 72px; text-align: right; }
@media (max-width: 900px) { .llm-body { grid-template-columns: 1fr; } .llm-body > * + * { border-left: 0; border-top: 1px solid var(--border); } }

/* 채팅 */
.chat { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 16px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.chat-head .title { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctx { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.ctx .bar { width: 120px; }
.msgs { flex: 1; overflow-y: auto; padding: 16px 24px; position: relative; }
.msgs-inner { max-width: 960px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.more { align-self: center; font-size: 12px; }
.msg-user { align-self: flex-end; max-width: 80%; background: #2F5BD3; color: #fff; border: 1px solid transparent; padding: 10px 14px; border-radius: 12px 12px 4px 12px; white-space: pre-wrap; word-break: break-word; }
.msg-user .atts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.msg-user .atts img { max-width: 160px; max-height: 120px; border-radius: 6px; display: block; }
.msg-ai { align-self: stretch; line-height: 1.6; word-break: break-word; background: var(--surface); border: 1px solid var(--border); border-radius: 4px 12px 12px 12px; padding: 12px 16px; }
/* 어시스턴트 아바타(시안 03) — DOM 은 그대로, 의사 요소로 */
.msg-ai { position: relative; margin-left: 44px; } details.work { margin-left: 44px; }
.msg-ai::before { content: ""; position: absolute; left: -44px; top: 0; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border); background: var(--raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235B8CFF' stroke-width='1.75' stroke-linejoin='round'%3E%3Cpath d='M12 2.5l8.5 4.75v9.5L12 21.5l-8.5-4.75v-9.5z'/%3E%3Cpath d='M3.5 7.25L12 12l8.5-4.75M12 12v9.5'/%3E%3C/svg%3E") center / 18px no-repeat; }
.msg-ai p { margin: 0 0 8px; } .msg-ai p:last-child { margin: 0; }
.msg-ai .code { border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; margin: 0 0 8px; }
.msg-ai .code-h { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 2px 12px; background: var(--raised); font-size: 12px; color: var(--muted); font-family: var(--mono); }
.msg-ai .code pre { margin: 0; border: 0; border-radius: 0; }
.msg-ai pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px 12px; overflow-x: auto; font-family: var(--mono); font-size: 12px; }
.msg-ai code { font-family: var(--mono); font-size: 12.5px; background: var(--raised); padding: 1px 5px; border-radius: 4px; }
.msg-ai pre code { background: none; padding: 0; }
.msg-ai ul { margin: 4px 0 8px; padding-left: 20px; }
.msg-ai .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.msg-err { color: var(--danger); background: var(--danger-soft); border-radius: var(--r-ctl); padding: 8px 12px; }
details.work { border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface); }
details.work > summary { list-style: none; cursor: pointer; padding: 8px 12px; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
details.work > summary::-webkit-details-marker { display: none; }
details.work > summary .line { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-family: var(--mono); font-size: 12px; }
details.work > summary .chev { transition: .15s; }
details.work[open] > summary .chev { transform: rotate(90deg); }
details.work .step { border-top: 1px solid var(--border); padding: 8px 12px 8px 32px; font-size: 12px; }
details.work .step .st { font-family: var(--mono); display: flex; gap: 8px; }
details.work .step pre { margin: 6px 0 0; white-space: pre-wrap; color: var(--muted); font-family: var(--mono); font-size: 11.5px; max-height: 200px; overflow: auto; }
.sys { align-self: center; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; width: 100%; }
.sys::before, .sys::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.card.approval { border-left: 4px solid var(--warn); display: grid; gap: 10px; }
.card.approval .t { font-weight: 700; font-size: 16px; }
.card.handoff { border-left: 4px solid var(--accent); display: grid; gap: 10px; }
.hsteps { display: flex; gap: 16px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.hsteps > span { display: flex; align-items: center; gap: 8px; flex: 1; }
.hsteps i { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border); display: grid; place-items: center; font-style: normal; font-size: 12px; flex: none; }
.hsteps .done { color: var(--text); } .hsteps .done i { background: var(--ok); border-color: var(--ok); color: #fff; }
.hsteps.mstep { margin: 4px 0; } .hsteps.mstep .on i { background: var(--accent); color: #fff; }
.hsteps .on { color: var(--accent); } .hsteps .on i { border-color: var(--accent); color: var(--accent); }
.hsteps > span:not(:last-child)::after { content: ""; flex: 1; min-width: 16px; height: 2px; background: var(--border); }
.hsteps > span.done:not(:last-child)::after { background: var(--ok); }
/* 06 LLM 추가 마법사 — 끝난 단계 카드가 위에 쌓인다 */
.wsteps { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.wstep { border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--raised); padding: 14px 16px; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.wstep-h { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.wstep-h i { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 12px; background: var(--accent); color: #fff; flex: none; }
.wstep.done .wstep-h i { background: var(--ok); }
.wstep.done > :not(.wstep-h) { margin-left: 34px; }
.wstep.on { border-color: rgba(91, 140, 255, .45); }
button.wide { width: 100%; justify-content: center; }
.wresult { border: 1px solid; border-radius: var(--r-ctl); padding: 12px 16px; display: grid; gap: 6px; justify-items: start; }
.wresult.ok { border-color: rgba(63,185,80,.6); background: var(--ok-soft); } .wresult.ok b { color: var(--ok); }
.wresult.danger { border-color: rgba(248,81,73,.6); background: var(--danger-soft); } .wresult.danger b { color: var(--danger); }
.wresult.warn { border-color: rgba(240,136,62,.6); background: var(--warn-soft); } .wresult.warn b { color: var(--warn); }
.wresult button { margin-top: 4px; }
.tobottom { position: sticky; bottom: 8px; margin-left: auto; display: block; border-radius: 999px; background: var(--raised); box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.composer { border-top: 1px solid var(--border); padding: 12px 24px 12px; }
.composer-inner { max-width: 960px; margin: 0 auto; display: grid; gap: 8px; }
.atts-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.atts-bar .chip { height: 36px; padding: 0 8px; background: var(--surface); color: var(--text); border-radius: 6px; border: 1px solid var(--border); }
.atts-bar .chip img { width: 40px; height: 26px; object-fit: cover; border-radius: 4px; }
.atts-bar .chip button { height: 20px; width: 20px; padding: 0; border: 0; justify-content: center; font-size: 12px; color: var(--muted); }
/* 첨부 칩과 입력줄을 한 카드로(시안 04) */
.inputcard { background: var(--raised); border: 1px solid var(--border); border-radius: 12px; }
.inputcard:focus-within { border-color: var(--accent); }
.inputcard:has(.inputbox.drag) { border-color: var(--accent); border-style: dashed; }
.inputcard .atts-bar:not(:empty) { padding: 8px 8px 0; }
.inputbox { display: flex; align-items: flex-end; gap: 8px; padding: 6px; }
.inputbox textarea { flex: 1; border: 0; background: transparent; resize: none; max-height: 200px; min-height: 36px; padding: 8px 4px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.opts select { padding: 4px 8px; font-size: 12px; height: 28px; }
.opts label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }

/* 쪽지 */
.dm-card { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; height: calc(100% - 64px); min-height: 360px; }
.dm-card .msgs { padding: 8px 0; }
.dm-card .msgs-inner { gap: 14px; max-width: none; }
.dm-row { display: flex; align-items: flex-end; gap: 10px; }
.dm-row.me { justify-content: flex-end; }
.bubble-me { max-width: 75%; background: #2F5BD3; color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 16px; white-space: pre-wrap; word-break: break-word; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--raised); display: grid; place-items: center; flex: none; }
.typing { color: var(--accent); letter-spacing: 3px; animation: pulse 1.2s infinite; }
.bubble-l { align-self: flex-start; max-width: 75%; background: #262D3A; border: 1px solid #353E4D; padding: 12px 18px; font-size: 16px; border-radius: 12px 12px 12px 4px; white-space: pre-wrap; }

/* 모바일 */
@media (max-width: 767px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { order: 2; flex-direction: row; padding: 4px; border-right: 0; border-top: 1px solid var(--border); justify-content: space-around; }
  .side .brand, .side .spacer, .side .who, .topbar { display: none; }
  .side a.nav { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px; }
  .page { padding: 16px; }
  .item { flex-wrap: wrap; gap: 8px; } .item > .grow { flex-basis: calc(100% - 48px); }
  .page-head { flex-wrap: wrap; }
  .ctx { flex: 1; min-width: 0; } .ctx > .lbl { display: none; } .ctx .bar { flex: 1; width: auto; min-width: 48px; }
  .page-head h1 { white-space: nowrap; flex-basis: 100%; }
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .llm-head > .muted.grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mockbadge { top: 8px; bottom: auto; }
  .side a.nav.active { box-shadow: none; }
  .chat-head { gap: 8px; } .chat-head .title { flex-basis: calc(100% - 48px); }
  .opts label { flex: 1 1 45%; } .opts select { flex: 1; min-width: 0; }
  .dm-card { height: calc(100% - 48px); padding: 12px; }
  .chat-head { padding: 8px 12px; flex-wrap: wrap; }
  .msgs, .composer { padding-left: 12px; padding-right: 12px; }
  .msg-ai, details.work { margin-left: 0; } .msg-ai::before { display: none; }
}

/* 표 · 머신 */
.sect { display: grid; gap: 12px; margin-bottom: 20px; }
.tbl { width: 100%; border-collapse: collapse; border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; }
.tbl th { text-align: left; font-weight: 500; font-size: 12px; color: var(--muted); background: var(--raised); padding: 8px 16px; }
.tbl td { padding: 10px 16px; border-top: 1px solid var(--border); }
.newtok { border: 1px solid rgba(63,185,80,.5); background: var(--ok-soft); border-radius: var(--r-ctl); padding: 12px 16px; display: grid; gap: 8px; }
.dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.dl > .card { display: flex; gap: 16px; align-items: flex-start; background: var(--bg); min-width: 0; }
.dl-ic { font-size: 40px; line-height: 1; color: var(--accent); }
@media (max-width: 900px) { .dl { grid-template-columns: 1fr; } .tbl { display: block; overflow-x: auto; } }

/* 설정 폼 */
.card.form { max-width: 990px; display: grid; gap: 4px; margin-bottom: 20px; }
.frow { display: grid; grid-template-columns: 200px 1fr; align-items: center; gap: 16px; padding: 8px 0; border-top: 1px solid var(--border); }
.card.form h2 + .frow { border-top: 0; }
.flabel { color: var(--text); }
.frow select { min-width: 320px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--r-ctl); overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; border-radius: 0; height: 34px; min-width: 72px; justify-content: center; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--accent); color: #fff; }
@media (max-width: 767px) { .frow { grid-template-columns: 1fr; gap: 6px; } .frow select { min-width: 0; width: 100%; } }
