:root {
  --bg: #f6f5f8; --surface: #fff; --ink: #1f1a24; --muted: #6b6472; --faint: #9a93a1; --line: #e6e1ea;
  --brand: #7a6781; --brand-ink: #5b4a63; --brand-soft: #f0eaf3;
  --junho: #3d63c9; --junho-soft: #e8eefb; --charlotte: #b5527a; --charlotte-soft: #f8e9ef;
  --danger: #c2413b; --danger-soft: #fbeceb; --ok: #2f8a57; --ok-soft: #e7f4ec; --warn: #a86a12; --warn-soft: #fbf1e1;
  --radius: 12px; --shadow: 0 1px 2px rgba(31, 26, 36, .06), 0 4px 14px rgba(31, 26, 36, .05);
  font-size: 15px;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif; line-height: 1.5; -webkit-font-smoothing: antialiased; }
:lang(ko) body, body:lang(ko) { word-break: keep-all; }
a { color: var(--brand-ink); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* top bar */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 14px; padding: 10px 18px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; text-decoration: none; color: var(--ink); white-space: nowrap; }
.logo img { width: 26px; height: 26px; }
.nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.nav::-webkit-scrollbar { display: none; }
.nav a { padding: 7px 11px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; white-space: nowrap; font-size: .95rem; }
.nav a:hover { background: var(--brand-soft); color: var(--brand-ink); }
.nav a.on { background: var(--brand); color: #fff; }
.top-r { display: flex; align-items: center; gap: 8px; }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
.lang button { border: 0; background: transparent; padding: 5px 9px; font-weight: 700; font-size: .8rem; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--ink); color: #fff; }
.me { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .9rem; }

main { max-width: 1320px; margin: 0 auto; padding: 20px 18px 80px; }
.page-h { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 16px; margin-bottom: 16px; }
.page-h h1 { font-size: 1.45rem; }
.page-h .sub { color: var(--muted); margin-top: 2px; }
.grow { flex: 1; }

/* buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 8px 13px; border-radius: 10px; font-weight: 650; cursor: pointer; text-decoration: none; color: var(--ink); min-height: 38px; }
.btn:hover { border-color: #cfc6d6; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 5px 9px; min-height: 30px; font-size: .85rem; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
label.f { display: block; font-weight: 650; font-size: .88rem; margin: 12px 0 5px; }
label.f small { font-weight: 500; color: var(--faint); margin-left: 6px; }
input[type=text], input[type=password], input[type=url], input[type=date], input[type=number], select, textarea {
  width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 11px; min-height: 40px; }
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 160px; }
.hint { color: var(--muted); font-size: .86rem; }
.err { color: var(--danger); font-weight: 600; font-size: .9rem; margin-top: 8px; }

/* chips */
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: #f1eef3; color: var(--muted); white-space: nowrap; }
.chip.junho { background: var(--junho-soft); color: var(--junho); }
.chip.charlotte { background: var(--charlotte-soft); color: var(--charlotte); }
.chip.red { background: var(--danger-soft); color: var(--danger); }
.chip.green { background: var(--ok-soft); color: var(--ok); }
.chip.amber { background: var(--warn-soft); color: var(--warn); }
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: currentColor; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff; }
.seg button { border: 0; background: transparent; padding: 6px 11px; font-weight: 650; font-size: .86rem; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--brand-soft); color: var(--brand-ink); }

/* board */
.wip { display: flex; gap: 8px; flex-wrap: wrap; }
.wip .chip { font-size: .82rem; padding: 4px 10px; }
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; }
.col { background: #efecf2; border-radius: var(--radius); padding: 10px; min-height: 240px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 8px; }
.col.drop { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 2px 4px 4px; }
.col-h h2 { font-size: .95rem; }
.col-h .n { color: var(--faint); font-weight: 700; font-size: .85rem; }
.col-h .add { margin-left: auto; }
.col-tip { color: var(--faint); font-size: .78rem; padding: 0 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; box-shadow: var(--shadow); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.card:hover { border-color: #cbbfd3; }
.card.dragging { opacity: .45; }
.card .t { font-weight: 700; line-height: 1.35; }
.card .alt { color: var(--faint); font-size: .82rem; line-height: 1.35; }
.meta { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; margin-top: 4px; }
.card .meta { margin-top: 0; }
.empty { color: var(--faint); font-size: .85rem; text-align: center; padding: 18px 6px; border: 1px dashed #d8d1dd; border-radius: 10px; }

/* panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.panel h2 { font-size: 1.05rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.panel h2 .num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; font-size: .8rem; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.list { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px; }
.list li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.list li .body { flex: 1; min-width: 0; }
.list li .t { font-weight: 650; }
.list li .s { color: var(--muted); font-size: .86rem; }
.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.stat div { background: #f8f6f9; border-radius: 10px; padding: 10px; }
.stat b { display: block; font-size: 1.35rem; }
.stat span { color: var(--muted); font-size: .8rem; }
.pre { white-space: pre-wrap; background: #f8f6f9; border-radius: 10px; padding: 12px; font-size: .9rem; border: 1px solid var(--line); }

/* ideas */
.score { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.score label { font-size: .78rem; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.score select { width: auto; min-height: 32px; padding: 3px 6px; }
.ice { font-weight: 800; font-size: 1.15rem; color: var(--brand-ink); min-width: 46px; text-align: center; }

.acts { display: flex; flex-direction: column; gap: 6px; flex: 0 0 auto; }

/* doc */
.doc h1 { font-size: 1.35rem; margin: 4px 0 8px; }
.doc h2 { font-size: 1.05rem; margin: 20px 0 6px; color: var(--brand-ink); }
.doc p { margin: 6px 0; color: var(--muted); }
.doc ul { margin: 6px 0; padding-left: 20px; }
.doc li { margin: 4px 0; }

/* modal */
.scrim { position: fixed; inset: 0; background: rgba(31, 26, 36, .38); z-index: 40; display: flex; align-items: flex-start; justify-content: center; padding: 5vh 12px; overflow-y: auto; }
.modal { background: var(--surface); border-radius: 16px; width: min(720px, 100%); padding: 18px 20px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.modal-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.modal-h h2 { font-size: 1.15rem; flex: 1; }
.moves { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.modal-f { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.modal-f .left { margin-right: auto; }
.links-ed .lk { display: flex; gap: 6px; margin-top: 6px; }
.links-ed .lk input:first-child { flex: 0 0 34%; }

.mt { margin-top: 16px; }
.panel h2.mt { margin-top: 20px; }
.grow0 { flex: 0 0 140px; }
.grid2.three { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.lk-row { display: flex; gap: 6px; margin-top: 10px; }
.lk-row input { flex: 1; }
textarea.tall { min-height: 62vh; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; }
.sm-select { width: auto; min-height: 36px; }
.modal-f .left, .hint.left { margin-right: auto; }

/* auth */
.auth { max-width: 400px; margin: 9vh auto; }
.auth .panel { padding: 24px; }
.auth h1 { font-size: 1.35rem; margin: 6px 0 4px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 60; font-weight: 600; max-width: calc(100% - 32px); box-shadow: var(--shadow); }
#toast.bad { background: var(--danger); }

@media (max-width: 720px) {
  :root { font-size: 15px; }
  .top-in { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .nav { order: 3; flex-basis: 100%; }
  main { padding: 14px 12px 70px; }
  .board { grid-auto-columns: 86%; }
  .page-h h1 { font-size: 1.25rem; }
  .page-h .sub { font-size: .9rem; }
  .wip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .list li.idea { flex-wrap: wrap; }
  .list li.idea .body { flex: 1 1 calc(100% - 60px); }
  .acts { flex-direction: row; width: 100%; }
  .acts .btn { flex: 1; }
  .score label { flex: 0 0 auto; }
}

/* ---------- v0.2 ---------- */
.btn.on { background: var(--brand-soft); color: var(--brand-ink); }
.panel-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.panel-h h2 { margin: 0; }
.panel-h .btn { margin-left: auto; }
.quick-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.quick-row input[type=text] { flex: 1 1 260px; }
.quick-row select { width: auto; }
.panel.quick { padding: 12px 14px; }
.panel.attn { border-color: #e9c98f; background: #fffaf0; margin-top: 14px; }
.list li.task { cursor: pointer; flex-wrap: wrap; }
.list li.task:hover { border-color: #cbbfd3; }
.list li .s.note { font-style: italic; }
.note-in { min-height: 32px !important; padding: 4px 8px !important; width: 170px !important; }
.acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; flex: 0 0 auto; }
.chip.link { text-decoration: none; }
.chip .x { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 0 0 4px; font-weight: 800; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 8px; }
.kpi { background: #f8f6f9; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi .kl { color: var(--muted); font-size: .8rem; font-weight: 650; }
.kpi b { font-size: 1.45rem; line-height: 1.2; }
.kpi .ks { color: var(--faint); font-size: .78rem; }
.kpis.big .kpi { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.bars { display: flex; flex-direction: column; gap: 7px; margin: 10px 0; }
.bar { display: grid; grid-template-columns: 130px 1fr 64px 56px; gap: 10px; align-items: center; font-size: .9rem; }
.bar .lab { color: var(--muted); font-weight: 650; }
.bar .track { background: #efecf2; border-radius: 6px; height: 14px; overflow: hidden; }
.bar .fill { display: block; height: 100%; background: var(--brand); border-radius: 6px; }
.bar .val { text-align: right; font-weight: 750; font-variant-numeric: tabular-nums; }
.bar .rate { color: var(--faint); font-size: .8rem; text-align: right; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; color: var(--muted); font-weight: 650; font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 8px; border-bottom: 1px solid #f0edf2; font-variant-numeric: tabular-nums; }
.tbl td:not(:first-child), .tbl th:not(:first-child) { text-align: right; }
.cols4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cols4 .col { min-height: 160px; }
.cols4 .list li { flex-direction: column; }
.cols4 .acts { width: 100%; }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.panel.action { display: flex; flex-direction: column; gap: 6px; }
.panel.action .btn { margin-top: auto; align-self: flex-start; }
.panel.action.off { opacity: .6; }
details.panel summary { cursor: pointer; font-weight: 700; }
@media (max-width: 1100px) { .cols4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .cols4 { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 96px 1fr 50px 44px; font-size: .84rem; }
  .list li.task .acts { width: 100%; }
  .note-in { flex: 1; width: auto !important; }
}

.sub-h { font-size: .9rem; color: var(--muted); margin: 16px 0 4px; }

/* ---------- AI team ---------- */
.av { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800; flex: 0 0 auto; background: var(--brand); }
.av.big { width: 46px; height: 46px; font-size: 1.15rem; }
.av.sm { width: 26px; height: 26px; font-size: .8rem; }
.av.ag-jarvis, .chip.ag-jarvis { background: #3d63c9; }
.av.ag-friday, .chip.ag-friday { background: #b5527a; }
.av.ag-ultron, .chip.ag-ultron { background: #2f8a57; }
.chip.ag-jarvis, .chip.ag-friday, .chip.ag-ultron { color: #fff; }
.ag-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ag-pill { display: flex; align-items: center; gap: 9px; background: #f8f6f9; border-radius: 12px; padding: 8px 12px; }
.panel.agent .ag-head { display: flex; gap: 12px; align-items: center; margin-bottom: 6px; }
.panel.agent h2 { margin: 0; }
.panel.attn-soft { border-color: #ecd9b4; }
#ai-ask { min-height: 70px; }

/* ---------- board drag and drop ---------- */
.list li.task.dnd { position: relative; }
.list li.task.dnd .body { padding-right: 24px; }
.grip { position: absolute; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 8px; cursor: grab; touch-action: none; opacity: .32; }
.grip::before { content: ''; position: absolute; left: 10px; top: 8px; width: 8px; height: 12px; background: radial-gradient(circle, #7d6f88 1.3px, transparent 1.6px) 0 0 / 4px 4px; }
.list li.task.dnd:hover .grip { opacity: .85; background: #f3eff6; }
@media (hover: none) { .grip { opacity: .75; } }
.list li.task.dragging { opacity: .3; }
.drag-ghost { position: fixed; z-index: 1000; pointer-events: none; margin: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; padding: 9px 10px;
  border: 1px solid #cbbfd3; border-radius: 10px; background: #fff; box-shadow: 0 18px 40px -12px rgba(60,40,80,.45); transform: rotate(1.5deg); opacity: .97; }
.drag-ghost .acts, .drag-ghost .grip { display: none; }
.list li.drop-line { padding: 0; min-height: 0; border: 0; border-top: 3px solid var(--brand); border-radius: 3px; background: none; margin: -1px 2px; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
details.later.drop { outline: 2px dashed var(--brand); outline-offset: -2px; background: var(--brand-soft); }
.board-tip { margin: -4px 0 10px; }
@media (max-width: 720px) {
  .cols4 { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 84%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .cols4 .col { scroll-snap-align: start; }
  body.is-dragging .cols4 { scroll-snap-type: none; }
}

/* ---------- AI office dock ---------- */
.office-wrap { margin: 4px auto 0; max-width: 1140px; }
.ai-dock .grid2 { align-items: start; }
.day-row { padding: 10px 0; border-top: 1px solid var(--line); }
.day-row:first-of-type { border-top: 0; }
.day-who { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.day-who .dot { width: 8px; height: 8px; border-radius: 99px; display: inline-block; }
.day-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.day-chip { font-size: .8rem; padding: 3px 8px; border-radius: 7px; background: #f4f1f6; color: #5d5266; }
.day-chip b { font-weight: 700; margin-right: 2px; }
.day-chip.k-work { background: #e9f6ef; color: #1f6b45; }
.day-chip.k-report { background: #fdf3e1; color: #8a5a12; }
.day-chip.now { box-shadow: 0 0 0 2px var(--brand); }
.daily { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.daily-cell { text-align: center; padding: 8px 2px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.daily-cell b { display: block; font-size: 1.15rem; }
.daily-cell span { font-size: .75rem; color: var(--muted); }
.daily-cell.warn { border-color: #e9c98f; background: #fffaf0; }
.other-row { background: #faf8fb !important; border-style: dashed !important; }
.clamp3 { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; white-space: pre-line; }
.pre-wrap { white-space: pre-wrap; }
.boss-line { font-size: .88rem; padding: 6px 8px; border-radius: 8px; background: #fdeeee; color: #8d2f2f; }
.mb { margin-bottom: 10px; }
@media (max-width: 720px) { .daily { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- AI team chat (ChatGPT-style) ---------- */
.ai-tabs .btn { text-decoration: none; }
.chat-wrap { position: relative; display: grid; grid-template-columns: 250px minmax(0, 1fr); height: calc(100dvh - var(--chat-offset, 190px)); min-height: 380px;
  border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: #fff; }
.chat-list { border-right: 1px solid var(--line); background: #faf8fb; padding: 12px; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.chat-list ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-list li { position: relative; }
.chat-list li a { display: flex; align-items: center; gap: 8px; padding: 7px 30px 7px 7px; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.chat-list li a .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-list li.on a, .chat-list li a:hover { background: #efe9f3; }
.chat-list li .del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--faint); font-size: 1.05rem; width: 26px; height: 26px; border-radius: 7px; cursor: pointer; opacity: 0; }
.chat-list li:hover .del, .chat-list li.on .del, .chat-list li .del:focus-visible { opacity: 1; }
.chat-list li .del:hover { background: #e7e0ec; color: var(--ink); }
.run-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--brand); animation: chatPulse 1.4s ease-in-out infinite; flex: 0 0 auto; }
.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 58px; }
.chat-head .who b { display: block; line-height: 1.2; }
.chat-head .who span { font-size: .82rem; color: var(--muted); }
.chat-head .grow { flex: 1; }
.agent-pick { display: flex; gap: 6px; flex-wrap: wrap; }
.agent-pick button { display: flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 12px 3px 3px; cursor: pointer; font-weight: 700; font-size: .85rem; color: var(--ink); }
.agent-pick button.on { border-color: var(--brand); background: var(--brand-soft); }
.chat-scroll { flex: 1; overflow-y: auto; padding: 18px 18px 8px; overscroll-behavior: contain; }
.chat-msgs { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.me { justify-content: flex-end; }
.msg.me .bubble { background: var(--brand-soft); border-radius: 16px 16px 4px 16px; padding: 9px 13px; max-width: 80%; white-space: pre-wrap; word-break: break-word; }
.msg.ai .bubble { flex: 1; min-width: 0; padding-top: 4px; }
.msg.ai .who { font-weight: 800; font-size: .8rem; letter-spacing: .04em; color: var(--muted); margin-bottom: 3px; }
.md { line-height: 1.6; word-break: break-word; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md pre, .md blockquote, .md table { margin: 0 0 9px; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 2px 0; }
.md pre { background: #1d1b22; color: #ece8f0; padding: 10px 12px; border-radius: 10px; overflow-x: auto; font-size: .85rem; line-height: 1.45; }
.md code { background: #f1edf4; padding: 1px 5px; border-radius: 5px; font-size: .88em; }
.md pre code { background: none; padding: 0; color: inherit; }
.md blockquote { border-left: 3px solid #d9cfe0; padding-left: 10px; color: var(--muted); }
.md table { border-collapse: collapse; font-size: .88rem; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
.md th { background: #faf8fb; }
.md h3, .md h4, .md h5, .md h6 { margin: 12px 0 6px; font-size: 1rem; }
.chat-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .88rem; padding: 2px 0 4px; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 99px; background: #b9a9c6; animation: chatDot 1.2s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes chatDot { 0%, 80%, 100% { transform: scale(.6); opacity: .5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes chatPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.msg-tools { margin-top: 4px; }
.msg-tools .btn { font-size: .78rem; min-height: 26px; padding: 2px 8px; }
.chat-av { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; background: #f3eff6; display: inline-grid; place-items: center; overflow: hidden; }
.chat-av.sm { width: 26px; height: 26px; flex-basis: 26px; }
.chat-av.lg { width: 76px; height: 76px; flex-basis: 76px; }
.chat-av.ag-jarvis { background: #e7ebfb; } .chat-av.ag-friday { background: #f7e8f1; } .chat-av.ag-ultron { background: #e4f3ea; }
.chat-av { position: relative; }
.chat-av svg.chat-doll { display: block; position: static; overflow: hidden; width: 100%; height: 100%; }
.chat-empty { text-align: center; padding: 36px 10px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.chat-empty h2 { font-size: 1.35rem; margin: 6px 0 0; }
.chat-sugs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; max-width: 660px; }
.chat-sugs button { border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 9px 13px; cursor: pointer; text-align: left; font-size: .9rem; color: var(--ink); }
.chat-sugs button:hover { border-color: #cbbfd3; background: #faf8fb; }
.chat-compose { max-width: 760px; width: calc(100% - 28px); margin: 6px auto 4px; display: flex; align-items: flex-end; gap: 8px; border: 1px solid #d9d0de;
  border-radius: 18px; padding: 7px 7px 7px 14px; background: #fff; box-shadow: 0 6px 18px -12px rgba(60,40,80,.35); }
.chat-compose:focus-within { border-color: var(--brand); }
.chat-compose textarea { flex: 1; width: auto; border: 0; outline: none; resize: none; min-height: 24px; max-height: 200px; padding: 6px 0; background: transparent; line-height: 1.45; }
.chat-compose textarea:focus { outline: none; }
.chat-send { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 1.1rem; font-weight: 800; cursor: pointer; flex: 0 0 auto; }
.chat-send:disabled { opacity: .35; cursor: default; }
.chat-stop { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 7px 13px; cursor: pointer; font-weight: 700; flex: 0 0 auto; }
.chat-note { max-width: 760px; margin: 0 auto 10px; padding: 0 14px; color: var(--faint); font-size: .76rem; text-align: center; }
.chat-list-toggle { display: none; }
@media (max-width: 720px) {
  .chat-wrap { grid-template-columns: 1fr; border-radius: 12px; min-height: 340px; }
  .chat-head { flex-wrap: nowrap; gap: 8px; min-height: 0; }
  .chat-head .who { min-width: 0; }
  .chat-head .who span, .chat-note { display: none; }
  .chat-head .btn { padding: 4px 9px; min-height: 32px; }
  .agent-pick { flex: 1; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .agent-pick button { padding-right: 9px; flex: 0 0 auto; }
  .chat-head > .hint { display: none; }
  .chat-list-toggle { white-space: nowrap; flex: 0 0 auto; }
  .chat-page-h { margin-bottom: 8px; }
  .chat-list { display: none; position: absolute; z-index: 30; top: 0; bottom: 0; left: 0; width: 84%; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  .chat-wrap.list-open .chat-list { display: flex; }
  .chat-list-toggle { display: inline-flex; }
  .chat-head { padding: 8px 10px; }
  .msg.me .bubble { max-width: 88%; }
  .chat-scroll { padding: 12px 10px 6px; }
  .chat-compose { width: calc(100% - 16px); }
}
.chat-status[hidden], .msg-tools[hidden], .chat-stop[hidden], .chat-send[hidden] { display: none; }
.chat-note-inline { max-width: 460px; color: var(--faint); font-size: .8rem; margin: 2px auto 0; }

/* ---------- 반영 (ship) ---------- */
.sec-h { font-size: 1.05rem; margin: 18px 2px 0; }
.panel.pr { margin-top: 10px; }
.panel.pr > .t { font-weight: 700; font-size: 1.02rem; }
.row-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.live-box .t { font-weight: 700; margin-bottom: 4px; }
.pv { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.shots { display: flex; gap: 10px; overflow-x: auto; padding: 8px 0 4px; }
.shot { border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 4px; cursor: zoom-in; flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.shot img { width: 160px; height: 346px; object-fit: cover; object-position: top; border-radius: 6px; display: block; }
.shot span { font-size: .75rem; color: var(--muted); }
ul.files { list-style: none; padding: 0; margin: 6px 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; max-height: 240px; overflow: auto; }
.fs { display: inline-block; width: 16px; text-align: center; }
.fs-A { color: #1f6b45; } .fs-M { color: #8a5a12; } .fs-D { color: #b23b3b; } .fs-R { color: #3d63c9; }
.ok-line { color: #1f6b45; font-weight: 650; }
.ship-busy { color: var(--brand-ink); font-weight: 650; }
.lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(20,14,26,.82); display: grid; place-items: center; padding: 20px; cursor: zoom-out; overflow: auto; }
.lightbox img { max-width: min(460px, 100%); height: auto; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.5); background: #fff; }
.lightbox span { position: fixed; top: 14px; left: 16px; color: #fff; font-weight: 700; }
.sec-row { display: flex; align-items: center; gap: 10px; margin-top: 18px; }
.sec-row .sec-h { margin: 0 2px; }
