/* 비즈데스크 — 깔끔한 업무 화면. 문서(거래명세표)만 종이 모양을 유지한다. */
:root {
  --bg: #f5f6fa; --card: #fff; --soft: #eef0f6; --ink: #171a22; --ink2: #4a5163; --ink3: #6b7385; --line: #e3e6ee; --line2: #cfd4e0;
  --brand: #5b34d6; --brand-ink: #fff; --brand-soft: #efeafc; --red: #d1432f; --red-soft: #fdeceb; --green: #1c7c4f; --green-soft: #e4f4ec; --amber: #a86400; --amber-soft: #fdf1da; --blue: #1f4ea6;
  --font: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  --r: 14px; --shadow: 0 1px 2px rgba(23,26,34,.05), 0 4px 16px rgba(23,26,34,.04);
  --fs-s: .8125rem; --fs-b: .9375rem; --fs-m: 1.0625rem; --fs-l: 1.25rem; --fs-xl: 1.5rem;
}
[data-theme="dark"] {
  --bg: #0f1117; --card: #181b24; --soft: #20242f; --ink: #eceef5; --ink2: #b4bacb; --ink3: #8d95aa; --line: #2a2f3c; --line2: #3a4050;
  --brand: #a68bff; --brand-ink: #12091f; --brand-soft: #25203d; --red: #ff8a76; --red-soft: #3a1f1c; --green: #5fd49b; --green-soft: #17301f; --amber: #f0b45c; --amber-soft: #33270f; --blue: #8fb2ff; --shadow: none;
}
* { box-sizing: border-box; }
html { color-scheme: light dark; }
[data-theme="light"] { color-scheme: light; } [data-theme="dark"] { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-b)/1.55 var(--font); font-variant-numeric: tabular-nums; word-break: keep-all; -webkit-font-smoothing: antialiased; }
::selection { background: var(--brand); color: var(--brand-ink); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); }
h1, h2, h3 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
h2 { font-size: var(--fs-m); }
.num { text-align: right; white-space: nowrap; }
.muted { color: var(--ink3); } .red { color: var(--red); } .green { color: var(--green); } .amber { color: var(--amber); }
[hidden] { display: none !important; }

/* shell */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.app > div { min-width: 0; }
.rail { position: sticky; top: 0; height: 100vh; padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; background: var(--card); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-weight: 800; font-size: var(--fs-m); letter-spacing: -.02em; }
.brand i { width: 28px; height: 28px; border-radius: 9px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-style: normal; font-size: .95rem; }
.rail a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: 10px; color: var(--ink2); text-decoration: none; font-weight: 500; }
.rail a svg { flex: none; opacity: .85; }
.rail a:hover { background: var(--soft); }
.rail a[aria-current="page"] { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.rail .sp { flex: 1; }
.rail .foot { font-size: var(--fs-s); color: var(--ink3); padding: 10px 12px; }
.topbar { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 32px 0; min-height: 56px; flex-wrap: wrap; }
.main { padding: 0 32px 48px; max-width: 1180px; width: 100%; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 20px; flex-wrap: wrap; }
.head h1 { font-size: var(--fs-xl); font-weight: 800; }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: 999px; background: var(--soft); color: var(--ink2); font-size: var(--fs-s); border: 0; }
.pill.ok::before, .pill.busy::before, .pill.off::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.pill.busy::before { background: var(--amber); } .pill.off::before { background: var(--red); }
select.ws { min-height: 36px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); padding: 0 10px; max-width: 200px; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line2); background: var(--card); color: var(--ink); cursor: pointer; font-weight: 600; text-decoration: none; }
.btn:hover { background: var(--soft); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line2)); }
.btn.small { min-height: 34px; padding: 0 12px; font-size: var(--fs-s); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 10px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line2); background: var(--card); cursor: pointer; font-size: var(--fs-s); font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }
.f { margin-bottom: 14px; min-width: 0; }
.f label { display: block; font-size: var(--fs-s); font-weight: 600; color: var(--ink2); margin-bottom: 5px; }
.f input, .f select, .f textarea, table input, table select { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--line2); border-radius: 10px; background: var(--card); }
.f textarea { resize: vertical; }
.f input:focus, .f select:focus, .f textarea:focus, table input:focus { border-color: var(--brand); outline: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.hint { font-size: var(--fs-s); color: var(--ink3); margin-top: 4px; } .err { font-size: var(--fs-s); color: var(--red); margin-top: 4px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.check { display: flex; gap: 8px; align-items: center; min-height: 42px; } .check input { width: 18px; min-height: 0; accent-color: var(--brand); }

/* cards */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); }
.panel > h2 { margin-bottom: 14px; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 10px; flex-wrap: wrap; }
.strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 8px; }
.strip > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.strip .k { font-size: var(--fs-s); color: var(--ink3); font-weight: 600; } .strip .v { font-size: var(--fs-xl); font-weight: 800; margin: 2px 0; letter-spacing: -.02em; } .strip .sub { font-size: var(--fs-s); color: var(--ink3); }
.strip a.card { text-decoration: none; color: inherit; }
.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow-x: auto; box-shadow: var(--shadow); }
table.grid { width: 100%; border-collapse: collapse; }
table.grid th { text-align: left; font-size: var(--fs-s); font-weight: 600; color: var(--ink3); padding: 12px 16px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--soft) 55%, var(--card)); white-space: nowrap; }
table.grid td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: 0; }
table.grid th.num, table.grid td.num { text-align: right; }
tr[data-go] { cursor: pointer; } tr[data-go]:hover td { background: var(--soft); }
.tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: var(--fs-s); font-weight: 600; background: var(--soft); color: var(--ink2); }
.tag.red { background: var(--red-soft); color: var(--red); } .tag.green { background: var(--green-soft); color: var(--green); } .tag.amber { background: var(--amber-soft); color: var(--amber); } .tag.brand { background: var(--brand-soft); color: var(--brand); }
.stage { display: inline-flex; gap: 3px; }
.stage span { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--ink3); font-weight: 600; }
.stage span.on { background: var(--brand-soft); color: var(--brand); } .stage span.now { background: var(--brand); color: var(--brand-ink); }
.stage.paid span.now { background: var(--green); color: #fff; }
.empty { background: var(--card); border: 1px dashed var(--line2); border-radius: var(--r); padding: 40px 24px; text-align: center; }
.empty h3 { margin-bottom: 6px; } .empty p { color: var(--ink3); max-width: 46ch; margin: 0 auto 16px; }
.search { max-width: 280px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 12px; z-index: 30; box-shadow: 0 8px 28px rgba(0,0,0,.25); }

/* editor */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 24px; align-items: start; }
.doctabs { display: inline-flex; padding: 4px; background: var(--soft); border-radius: 12px; margin-bottom: 14px; gap: 2px; }
.doctabs button { min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 600; color: var(--ink2); }
.doctabs button[aria-selected="true"] { background: var(--card); color: var(--brand); box-shadow: var(--shadow); }
.doctabs button[disabled] { opacity: .4; cursor: default; }
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-size: var(--fs-s); color: var(--ink3); padding: 0 6px 6px; font-weight: 600; } .lines td { padding: 4px 6px 4px 0; vertical-align: middle; }
.lines td.amt { text-align: right; white-space: nowrap; font-weight: 600; }
.x { width: 34px; height: 34px; border: 0; background: transparent; color: var(--ink3); border-radius: 8px; cursor: pointer; } .x:hover { background: var(--red-soft); color: var(--red); }
.totals { margin-top: 10px; font-weight: 600; }
.stockwarn { font-size: var(--fs-s); color: var(--amber); margin: 6px 0 0; }
.stackwrap { position: sticky; top: 16px; }
.copyswitch { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; justify-content: space-between; }
.warn { font-size: var(--fs-s); color: var(--ink2); background: var(--amber-soft); border-radius: 10px; padding: 10px 12px; margin: 12px 0 0; }
.sharebox { margin-top: 12px; display: grid; gap: 8px; }
.sharerow { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: var(--fs-s); }

/* auth / landing */
.gate { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.gate .box { width: min(440px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow); text-align: center; }
.gate h1 { font-size: var(--fs-xl); margin: 12px 0 6px; } .gate p { color: var(--ink2); margin: 0 0 18px; } .gate .small { font-size: var(--fs-s); color: var(--ink3); margin-top: 14px; }
.gate .brand-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; margin: 0 auto; font-size: 1.5rem; font-weight: 800; }
.gate .list { text-align: left; color: var(--ink2); margin: 0 0 20px; padding-left: 18px; font-size: var(--fs-s); }
.gate form { text-align: left; }

/* document sheet (paper) */
.sheet, .sheetstack { --ink: #16181c; --ink2: #464c55; --ink3: #626a75; --sheet: #fff; --red: #c4352b; --blue: #1f4ea6; --red-tint: #fbeceb; --blue-tint: #e9effa; --fs-s: .8125rem; --fs-xl: 1.5rem; }
/* the sheet: 거래명세표 */
.sheetstack { position: relative; padding: 0 12px 12px 0; }
.sheetstack.s1::before, .sheetstack.s2::before, .sheetstack.s2::after { content: ""; position: absolute; background: var(--blue-tint); border: 1px solid var(--blue); inset: 8px 0 0 8px; box-shadow: 0 2px 6px rgba(22,24,28,.06); }
.sheetstack.s2::after { inset: 16px -8px -8px 16px; background: var(--red-tint); border-color: var(--red); }
.sheet { --ink-copy: var(--red); position: relative; z-index: 1; background: var(--sheet); border: 1px solid var(--ink-copy); padding: 22px 22px 18px; box-shadow: 0 4px 14px rgba(22,24,28,.1); color: var(--ink-copy); }
.sheet.blue { --ink-copy: var(--blue); }
.sheet .title { text-align: center; font-size: var(--fs-xl); font-weight: 700; letter-spacing: .5em; margin-bottom: 2px; }
.sheet .copy { text-align: center; font-size: var(--fs-s); margin-bottom: 14px; }
.sheet .meta { display: flex; justify-content: space-between; font-size: var(--fs-s); margin-bottom: 8px; }
.parties { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--ink-copy); margin-bottom: 10px; }
.parties > div + div { border-left: 1px solid var(--ink-copy); }
.parties h3 { font-size: var(--fs-s); text-align: center; border-bottom: 1px solid var(--ink-copy); padding: 3px; letter-spacing: .3em; }
.parties dl { margin: 0; display: grid; grid-template-columns: 4.5em 1fr; font-size: var(--fs-s); }
.parties dt, .parties dd { white-space: nowrap; margin: 0; padding: 3px 6px; border-bottom: 1px solid color-mix(in srgb, var(--ink-copy) 35%, transparent); }
.parties dt { font-weight: 600; } .parties dd { color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
.sheet table { width: 100%; border-collapse: collapse; font-size: var(--fs-s); }
.sheet th, .sheet td { border: 1px solid var(--ink-copy); padding: 4px 6px; }
.sheet th { font-weight: 600; text-align: center; }
.sheet td { color: var(--ink); }
.sheet td.num { text-align: right; }
.sheet tfoot td, .sheet tfoot th { font-weight: 700; }
.sheet .note { margin-top: 10px; font-size: var(--fs-s); color: var(--ink2); white-space: pre-wrap; }
.sheet .disc { margin-top: 8px; font-size: .75rem; color: var(--ink3); }
.warn { font-size: var(--fs-s); color: var(--ink2); background: var(--rail); border: 1px solid var(--rule); padding: 8px 10px; margin-bottom: 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 3px; z-index: 20; }
.sheet { border-radius: 6px; }

/* mobile */
.only-s { display: none; } .hide-s { }
.navmore { display: none; }
@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; } .stackwrap { position: static; }
  .main { padding: 0 16px 96px; } .topbar { padding: 12px 16px 0; justify-content: space-between; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; top: auto; height: auto; flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); gap: 2px; overflow: visible; }
  .rail .brand, .rail .foot, .rail .sp, .rail a.secondary { display: none; }
  .rail.open a.secondary { display: flex; }
  .rail.open { flex-wrap: wrap; }
  .rail a { flex: 1; flex-direction: column; gap: 2px; justify-content: center; min-height: 52px; padding: 4px 2px; font-size: 11px; text-align: center; border-radius: 10px; }
  .navmore { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; border: 0; background: none; color: var(--ink2); font-size: 11px; }
  .sheet { padding: 14px 12px; } .sheet .title { letter-spacing: .3em; }
  .lines thead { display: none; }
  .lines tr { display: grid; grid-template-columns: 76px 1fr 44px; gap: 4px; margin-bottom: 14px; }
  .lines td:nth-child(1) { grid-column: 1 / -1; } .lines td:nth-child(2) { grid-column: 1; grid-row: 2; } .lines td:nth-child(3) { grid-column: 2; grid-row: 2; }
  .lines td:nth-child(5) { grid-column: 3; grid-row: 2; } .lines td.amt { grid-column: 1 / -1; text-align: right; }
  .hide-s { display: none; } .only-s { display: inline-flex; }
  .parties { grid-template-columns: 1fr; } .parties > div + div { border-left: 0; border-top: 1px solid var(--ink-copy); }
  .toast { bottom: 84px; } .head h1 { font-size: var(--fs-l); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* print: only the sheet */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff; }
  .rail, .topbar, .head, .editor > :first-child, .copyswitch, .actions, .warn, .toast, .sharebox, .sheetstack::before, .sheetstack::after { display: none !important; }
  .main { padding: 0; max-width: none; } .editor { display: block; } .stackwrap { position: static; }
  .sheet { box-shadow: none; border-width: 1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sheetstack { padding: 0; }
}
.gate .step { font-size: var(--fs-s); color: var(--ink3); font-weight: 600; margin-top: 12px; }
.pick { display: grid; gap: 8px; margin: 0 0 16px; text-align: left; }
.pick button { min-height: 52px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line2); background: var(--card); color: inherit; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.pick button:hover, .pick button:focus-visible { border-color: var(--brand); background: var(--brand-soft); }
.pick button small { display: block; font-weight: 400; color: var(--ink3); font-size: var(--fs-s); }

/* AI 비서 */
/* 홈 빠른 작업 */
.quick { margin-bottom: 20px; }
.quick .ask { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; background: var(--card); border: 1px solid var(--line2); border-radius: 16px; box-shadow: var(--shadow); }
.quick .ask:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.quick .ask input { flex: 1; min-width: 0; border: 0; background: none; min-height: 40px; outline: 0; }
.quick .qa { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; margin-top: 10px; }
.qbtn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-weight: 600; font-size: var(--fs-s); color: var(--ink2); box-shadow: var(--shadow); }
.qbtn svg { color: var(--brand); }
.qbtn:hover { border-color: var(--brand); color: var(--ink); }

/* AI 비서 */
.chat-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; height: calc(100vh - 150px); height: calc(100dvh - 150px); min-height: 460px; }
.chat-side { min-height: 0; overflow-y: auto; }
.chat-list { display: flex; flex-direction: column; gap: 2px; }
.new-chat { justify-content: flex-start; margin-bottom: 8px; }
.chat-item { display: flex; align-items: center; border-radius: 10px; }
.chat-item:hover, .chat-item.on { background: var(--soft); }
.chat-item.on { background: var(--brand-soft); }
.chat-item .open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 0; padding: 8px 10px; border: 0; background: none; cursor: pointer; text-align: left; }
.chat-item .open span { width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.chat-item .open small { color: var(--ink3); font-size: 11px; }
.chat-item .del { width: 30px; height: 30px; border: 0; background: none; color: var(--ink3); border-radius: 8px; cursor: pointer; opacity: 0; display: grid; place-items: center; }
.chat-item:hover .del, .chat-item.on .del, .chat-item .del:focus-visible { opacity: 1; }
.chat-item .del:hover { color: var(--red); background: var(--red-soft); }
.chat-main { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.chat-top { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: var(--fs-s); }
.chat-top .chat-use { margin-right: auto; }
.chat-log { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 14px; scroll-behavior: smooth; }
.chat-empty { margin: auto; max-width: 520px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.chat-empty .chips { justify-content: center; margin-top: 6px; }
.chat-ava { flex: none; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #ff7ab8)); color: #fff; }
.chat-ava.big { width: 52px; height: 52px; border-radius: 16px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: min(680px, 88%); }
.msg.user { align-self: flex-end; }
.msg .bubble { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--soft); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; }
.msg.user .bubble { border-radius: 18px 18px 6px 18px; background: var(--brand); color: var(--brand-ink); }
.msg.err .bubble { background: var(--red-soft); color: var(--red); }
.msg img { display: block; max-width: 220px; max-height: 220px; border-radius: 12px; margin-bottom: 6px; }
.msg .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.typing { display: flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer .box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px 12px; border: 1px solid var(--line2); border-radius: 14px; background: var(--bg); }
.composer .box:focus-within { border-color: var(--brand); }
.composer textarea { border: 0; background: none; resize: none; outline: 0; min-height: 28px; max-height: 180px; padding: 3px 0; line-height: 1.5; }
.composer .icon-btn { width: 42px; height: 42px; min-height: 42px; border-radius: 12px; }
.chat-photo { font-size: var(--fs-s); color: var(--brand); font-weight: 600; }
.chat-note { font-size: 11px; text-align: center; margin: 0 0 8px; padding: 0 12px; }
@media (max-width: 720px) {
  .chat-wrap { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: calc(100vh - 190px); height: calc(100dvh - 190px); min-height: 380px; gap: 0; }
  .chat-side { position: relative; overflow: visible; }
  .chat-list { display: none; position: absolute; z-index: 5; top: 0; left: 0; right: 0; max-height: 60vh; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.15); }
  .chat-list.open { display: flex; }
  .chat-item .del { opacity: 1; }
  .chat-log { padding: 14px; }
  .msg { max-width: 94%; }
  .quick .qa { grid-template-columns: repeat(3, 1fr); }
  .strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .strip > div { padding: 12px 14px; }
  .strip .v { font-size: var(--fs-l); }
}
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; opacity: .6; } }
