/* 테마: html[data-theme] = 'kakao'(지금 모습 그대로, 이 파일은 손대지 않음) | 'white' | 'dark'
   화이트·다크: 챗GPT 웹처럼 — 흰(어두운) 바탕, 연한 사이드바, 작은 둥근 프사, 회색 말풍선, 가운데 둥근 알약 입력창. */

html[data-theme="white"] {
  color-scheme: light;
  --bg: #ffffff;
  --rail: #f9f9f9;
  --list: #f9f9f9;
  --room: #ffffff;
  --room-sub: #8f8f8f;
  --card: #ffffff;
  --field: #f3f3f3;
  --hover: #efefef;
  --active: #ececec;
  --line: #ececec;
  --text: #0d0d0d;
  --sub: #5d5d5d;
  --dim: #8f8f8f;
  --mine: #f4f4f4;
  --on-mine: #0d0d0d;
  --other: transparent;
  --badge: #0d0d0d;
  --link: #2964aa;
  --pill: transparent;
  --pill-line: #e3e3e3;
  --send-bg: #0d0d0d;
  --send-fg: #ffffff;
  --send-off: #d7d7d7;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 4px 16px rgba(0, 0, 0, .07);
  --doc-text: #0d0d0d; --doc-sub: #5d5d5d; --doc-line: #ececec; --doc-hover: #f3f3f3; --doc-side: #f9f9f9; --doc-code: #f7f7f7;
  --doc-blue: #0C66E4; --doc-blue-h: #0055CC; --doc-blue-bg: #EEF4FF;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #212121;
  --rail: #181818;
  --list: #181818;
  --room: #212121;
  --room-sub: #9b9b9b;
  --card: #2f2f2f;
  --field: #2a2a2a;
  --hover: #262626;
  --active: #2f2f2f;
  --line: #2c2c2c;
  --text: #ececec;
  --sub: #b4b4b4;
  --dim: #8f8f8f;
  --mine: #303030;
  --on-mine: #ececec;
  --other: transparent;
  --badge: #ececec;
  --link: #8ab4f8;
  --danger: #ff8a8a;
  --pill: transparent;
  --pill-line: #3a3a3a;
  --send-bg: #ececec;
  --send-fg: #0d0d0d;
  --send-off: #4a4a4a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .4);
  --doc-text: #ececec; --doc-sub: #b4b4b4; --doc-line: #2f2f2f; --doc-hover: #2a2a2a; --doc-side: #181818; --doc-code: #262626;
  --doc-blue: #6aa6ff; --doc-blue-h: #8fbcff; --doc-blue-bg: #1e2a3d;
  --info-bg: #1e2a3d; --warn-bg: #3a331d; --ok-bg: #1d3329; --add-bg: #1f4030; --del-bg: #3d2321; --del-fg: #fd9891;
}

/* ── 뼈대: 아이콘 줄 · 사이드바 */
html:is([data-theme="white"], [data-theme="dark"]) body { font-size: 15px; }
@media (min-width: 1200px) { html:is([data-theme="white"], [data-theme="dark"]) .app { grid-template-columns: 60px var(--list-w, 260px) minmax(0, 1fr) auto; } }
@media (min-width: 900px) and (max-width: 1199px) { html:is([data-theme="white"], [data-theme="dark"]) .app { grid-template-columns: 60px var(--list-w, 250px) minmax(0, 1fr); } }
@media (max-width: 899px) {
  html:is([data-theme="white"], [data-theme="dark"]) .app:not(.chat-open) { grid-template-columns: 60px minmax(0, 1fr); }
  html:is([data-theme="white"], [data-theme="dark"]) .msg, html:is([data-theme="white"], [data-theme="dark"]) .day { padding-inline: 14px; }
  html:is([data-theme="white"], [data-theme="dark"]) .composer { width: calc(100% - 20px); margin-bottom: 10px; }
  html:is([data-theme="white"], [data-theme="dark"]) .room-head { padding: 0 8px 0 10px; }
}
html:is([data-theme="white"], [data-theme="dark"]) .rail { background: var(--rail); border-right: 1px solid var(--line); padding: 12px 0; gap: 4px; }
html:is([data-theme="white"], [data-theme="dark"]) .rail-logo { width: 30px; height: 30px; border-radius: 8px; margin-bottom: 12px; }
html:is([data-theme="white"], [data-theme="dark"]) .rail-btn { width: 40px; height: 40px; border-radius: 10px; color: var(--sub); }
html:is([data-theme="white"], [data-theme="dark"]) .rail-btn .ic { width: 20px; height: 20px; }
html:is([data-theme="white"], [data-theme="dark"]) .rail-btn:hover { background: var(--hover); color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .rail-btn.on { background: var(--active); color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .rail-btn.on .ic { stroke-width: 2; }
html:is([data-theme="white"], [data-theme="dark"]) .rail-badge, html:is([data-theme="white"], [data-theme="dark"]) .badge { color: var(--bg); }
html:is([data-theme="white"], [data-theme="dark"]) .rail-me { width: 30px; height: 30px; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 600; }
html:is([data-theme="white"], [data-theme="dark"]) .pop { border-radius: 16px; padding: 6px; }
html:is([data-theme="white"], [data-theme="dark"]) .pop-item { border-radius: 10px; padding: 9px 12px; }

html:is([data-theme="white"], [data-theme="dark"]) .list { background: var(--list); border-right: 1px solid var(--line); }
html:is([data-theme="white"], [data-theme="dark"]) .list-head { padding: 14px 10px 8px 16px; }
html:is([data-theme="white"], [data-theme="dark"]) .list-head h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .list-head .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
html:is([data-theme="white"], [data-theme="dark"]) .list-head .icon-btn .ic { width: 18px; height: 18px; }
html:is([data-theme="white"], [data-theme="dark"]) .list-search { margin: 0 8px 8px; height: 36px; border-radius: 10px; background: transparent; padding: 0 6px 0 10px; }
html:is([data-theme="white"], [data-theme="dark"]) .list-search:hover { background: var(--hover); }
html:is([data-theme="white"], [data-theme="dark"]) .list-search:focus-within { background: var(--card); box-shadow: 0 0 0 1px var(--pill-line) inset; }
html:is([data-theme="white"], [data-theme="dark"]) .kbd-btn kbd { background: transparent; }
html:is([data-theme="white"], [data-theme="dark"]) .rooms { padding: 0 8px 16px; }
html:is([data-theme="white"], [data-theme="dark"]) .section + .section { margin-top: 10px; }
html:is([data-theme="white"], [data-theme="dark"]) .section-head { padding: 10px 8px 4px; font-size: 12px; font-weight: 500; color: #8f8f8f; gap: 4px; }
html:is([data-theme="white"], [data-theme="dark"]) .section-head:hover { color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .section-head .caret { width: 12px; height: 12px; }
html:is([data-theme="white"], [data-theme="dark"]) .section-n { font-weight: 500; }

/* 방 한 줄: 작은 둥근 프사 + 이름 (미리보기·시간은 숨김, 안 읽은 수만) */
html:is([data-theme="white"], [data-theme="dark"]) .room { padding: 6px 8px; gap: 10px; border-radius: 9px; }
html:is([data-theme="white"], [data-theme="dark"]) .room:hover { background: var(--hover); }
html:is([data-theme="white"], [data-theme="dark"]) .room.active { background: var(--active); }
html:is([data-theme="white"], [data-theme="dark"]) .room .av, html:is([data-theme="white"], [data-theme="dark"]) .droom .av.xs { width: 24px; height: 24px; border-radius: 7px; }
html:is([data-theme="white"], [data-theme="dark"]) .room .av-text span { font-size: 6px; }
html:is([data-theme="white"], [data-theme="dark"]) .room-main { flex-direction: row; align-items: center; gap: 6px; }
html:is([data-theme="white"], [data-theme="dark"]) .room-top { flex: 1; min-width: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .room-bottom { flex: none; }
html:is([data-theme="white"], [data-theme="dark"]) .room .last, html:is([data-theme="white"], [data-theme="dark"]) .room time { display: none; }
html:is([data-theme="white"], [data-theme="dark"]) .room .name { font-size: 14px; font-weight: 400; }
html:is([data-theme="white"], [data-theme="dark"]) .room.active .name { font-weight: 500; }
html:is([data-theme="white"], [data-theme="dark"]) .badge { min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; padding: 0 5px; }
html:is([data-theme="white"], [data-theme="dark"]) .droom { height: 34px; border-radius: 9px; }
html:is([data-theme="white"], [data-theme="dark"]) .droom-name { font-size: 14px; font-weight: 500; }
html:is([data-theme="white"], [data-theme="dark"]) .tr { height: 32px; border-radius: 9px; font-size: 14px; color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .tr:hover { background: var(--hover); }
html:is([data-theme="white"], [data-theme="dark"]) .tr.on { background: var(--active); color: var(--text); font-weight: 500; }
html:is([data-theme="white"], [data-theme="dark"]) .tr.on .tr-ic { color: var(--text); }

/* ── 대화 */
html:is([data-theme="white"], [data-theme="dark"]) .main { background: var(--bg); }
html:is([data-theme="white"], [data-theme="dark"]) .room-head { height: 56px; padding: 0 12px 0 20px; }
html:is([data-theme="white"], [data-theme="dark"]) .room-title { gap: 9px; }
html:is([data-theme="white"], [data-theme="dark"]) .room-title .av.sm { width: 26px; height: 26px; border-radius: 7px; }
html:is([data-theme="white"], [data-theme="dark"]) .room-name { font-size: 16px; font-weight: 600; letter-spacing: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .main .icon-btn { width: 34px; height: 34px; border-radius: 8px; color: var(--sub); }
html:is([data-theme="white"], [data-theme="dark"]) .main .icon-btn:hover, html:is([data-theme="white"], [data-theme="dark"]) .main .icon-btn.on { background: var(--hover); color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .main .icon-btn .ic { width: 19px; height: 19px; }
html:is([data-theme="white"], [data-theme="dark"]) .pinned { box-shadow: 0 0 0 1px var(--line); border-radius: 14px; }

/* 가운데 768px 단 */
html:is([data-theme="white"], [data-theme="dark"]) .messages { padding: 8px 0 24px; }
html:is([data-theme="white"], [data-theme="dark"]) .msg, html:is([data-theme="white"], [data-theme="dark"]) .day { max-width: 816px; margin-inline: auto; padding-inline: 24px; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.start { margin-top: 14px; }
html:is([data-theme="white"], [data-theme="dark"]) .day { margin-top: 26px; margin-bottom: 6px; }
html:is([data-theme="white"], [data-theme="dark"]) .day span { background: none; padding: 0; font-size: 12px; color: var(--dim); }
html:is([data-theme="white"], [data-theme="dark"]) .who { display: none; }
html:is([data-theme="white"], [data-theme="dark"]) .msg .name { color: var(--dim); font-size: 12.5px; margin-left: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .stack { max-width: min(640px, 78%); }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .stack { max-width: 100%; }

/* 말풍선: 내 것은 회색 둥근 말풍선, 지난 나는 말풍선 없이 글만 (챗GPT 답처럼) */
html:is([data-theme="white"], [data-theme="dark"]) .bubble { border-radius: 18px; padding: 10px 16px; line-height: 1.55; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .bubble { background: var(--mine); color: var(--on-mine); }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .bubble { background: none; padding: 2px 0; border-radius: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other.start .content > .bubble:first-child,
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine.start .content > .bubble:first-child { border-radius: 18px; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other.start .content > .bubble:first-child { border-radius: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .bubble a { color: var(--link); text-decoration: none; }
html:is([data-theme="white"], [data-theme="dark"]) .quote { border-color: var(--line); }
html:is([data-theme="white"], [data-theme="dark"]) .msg.done .todo-box, html:is([data-theme="white"], [data-theme="dark"]) .msg.mine.done .todo-box { background: var(--text); border-color: var(--text); color: var(--bg); }
html:is([data-theme="white"], [data-theme="dark"]) .link-card { box-shadow: 0 0 0 1px var(--line); border-radius: 16px; }
html:is([data-theme="white"], [data-theme="dark"]) .photos img { border-radius: 16px; }
html:is([data-theme="white"], [data-theme="dark"]) .chip, html:is([data-theme="white"], [data-theme="dark"]) .thread-sum { box-shadow: 0 0 0 1px var(--line); }

/* 말풍선 아래: 회색 작은 도구(복사·할 일 …)와 시간 */
html:is([data-theme="white"], [data-theme="dark"]) .line { display: grid; grid-template-columns: auto auto; column-gap: 2px; row-gap: 2px; align-items: center; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .line { justify-content: end; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .line { justify-content: start; }
html:is([data-theme="white"], [data-theme="dark"]) .line > .content { grid-column: 1 / -1; grid-row: 1; }
html:is([data-theme="white"], [data-theme="dark"]) .line > time { grid-row: 2; font-size: 11.5px; color: var(--dim); padding: 0 6px; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .line > time { grid-column: 2; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .line > .tools { grid-column: 1; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .line > time { grid-column: 1; padding-left: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .line > .tools { grid-column: 2; }
html:is([data-theme="white"], [data-theme="dark"]) .tools { position: static; grid-row: 2; transform: none; background: none; box-shadow: none; padding: 0; gap: 0; height: 28px; }
html:is([data-theme="white"], [data-theme="dark"]) .msg:hover .tools, html:is([data-theme="white"], [data-theme="dark"]) .tools:focus-within { transform: none; }
html:is([data-theme="white"], [data-theme="dark"]) .tools button { width: 28px; height: 28px; border-radius: 7px; color: var(--dim); }
html:is([data-theme="white"], [data-theme="dark"]) .tools .ic { width: 16px; height: 16px; }
html:is([data-theme="white"], [data-theme="dark"]) .tools button:hover { background: var(--hover); color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .tools [data-act="react"], html:is([data-theme="white"], [data-theme="dark"]) .tools [data-act="pin"], html:is([data-theme="white"], [data-theme="dark"]) .tools [data-act="select"] { display: none; }

/* ── 입력창: 가운데 둥근 알약 (왼쪽 +, 오른쪽 검은 원 ↑) */
html:is([data-theme="white"], [data-theme="dark"]) .composer { width: calc(100% - 48px); max-width: 768px; margin: 0 auto 18px; flex-direction: row; align-items: flex-end; gap: 6px; padding: 8px 8px 8px 8px; background: var(--card); border: 1px solid var(--pill-line); border-radius: 26px; box-shadow: 0 2px 12px rgba(0, 0, 0, .05); }
html:is([data-theme="white"], [data-theme="dark"]) .composer:focus-within { border-color: var(--dim); }
html:is([data-theme="white"], [data-theme="dark"]) .composer-bar { display: contents; }
html:is([data-theme="white"], [data-theme="dark"]) .composer .attach { order: 0; width: 36px; height: 36px; border-radius: 50%; color: var(--text); }
html:is([data-theme="white"], [data-theme="dark"]) .composer .attach:hover { background: var(--hover); }
html:is([data-theme="white"], [data-theme="dark"]) #input { order: 1; flex: 1; min-height: 36px; max-height: 200px; padding: 7px 4px; line-height: 22px; font-size: 15.5px; }
html:is([data-theme="white"], [data-theme="dark"]) .composer-hint { display: none; }
html:is([data-theme="white"], [data-theme="dark"]) .send { order: 2; margin: 0; width: 36px; height: 36px; padding: 0; border-radius: 50%; font-size: 0; background: var(--send-bg); color: var(--send-fg); display: grid; place-items: center; }
html:is([data-theme="white"], [data-theme="dark"]) .send::before { content: ''; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 19V5M6 11l6-6 6 6'/%3E%3C/svg%3E") center / contain no-repeat; }
html:is([data-theme="white"], [data-theme="dark"]) .send:disabled, html:is([data-theme="white"], [data-theme="dark"]) .send:disabled:hover { background: var(--send-off); color: var(--send-fg); box-shadow: none; }
html:is([data-theme="white"], [data-theme="dark"]) .ic-clip { display: none; }
html:is([data-theme="white"], [data-theme="dark"]) .ic-plus { display: grid; }
.ic-plus { display: none; }
.ic-clip { display: grid; }
html:is([data-theme="white"], [data-theme="dark"]) .sel-bar { background: var(--bg); border-top: 1px solid var(--line); }

/* ── 오른쪽 패널 · 작은 창 */
html:is([data-theme="white"], [data-theme="dark"]) .panel-in { background: var(--list); }
html:is([data-theme="white"], [data-theme="dark"]) .panel-head { height: 56px; font-size: 15px; font-weight: 600; }
html:is([data-theme="white"], [data-theme="dark"]) .btn-primary { background: var(--text); color: var(--bg); border-radius: 999px; }
html:is([data-theme="white"], [data-theme="dark"]) .btn-plain { border-radius: 999px; }
html:is([data-theme="white"], [data-theme="dark"]) .modal-card { border-radius: 20px; }
html:is([data-theme="white"], [data-theme="dark"]) .doc-view { background: var(--bg); }

/* ── 테마 고르기 (웹 첫 로그인 · 계정 메뉴) */
.theme-pick { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px; background: var(--bg); color: var(--text); animation: fade var(--t-mid) var(--ease); overflow-y: auto; }
.theme-pick.over { background: rgba(0, 0, 0, .35); }
.tp-card { width: min(860px, 100%); background: var(--card); border-radius: 24px; padding: 36px 36px 28px; box-shadow: 0 24px 64px rgba(0, 0, 0, .18), 0 0 0 1px var(--line); text-align: center; }
.tp-logo { width: 48px; height: 48px; border-radius: 12px; }
.tp-card h2 { margin: 14px 0 6px; font-size: 24px; font-weight: 700; letter-spacing: -.02em; }
.tp-card > p { margin: 0 0 26px; color: var(--sub); font-size: 14.5px; }
.tp-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.tp-opt { display: flex; flex-direction: column; gap: 10px; padding: 10px; border-radius: 18px; box-shadow: 0 0 0 1px var(--line) inset; text-align: center; transition: box-shadow var(--t), transform var(--t) var(--ease); }
.tp-opt:hover { transform: translateY(-2px); }
.tp-opt.on { box-shadow: 0 0 0 2.5px var(--focus) inset; }
.tp-opt b { font-size: 15px; font-weight: 600; padding-bottom: 4px; }
.tp-start { margin-top: 26px; min-width: 200px; height: 46px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 600; font-size: 15.5px; }
.tp-start:hover { opacity: .9; }
/* 미리보기: 아이콘 줄 · 사이드바 · 대화 · 입력창을 작게 */
.pv { display: grid; grid-template-columns: 10% 30% 1fr; height: 150px; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); text-align: left; }
.pv-rail { background: var(--p-rail); border-right: 1px solid var(--p-line); }
.pv-side { background: var(--p-side); border-right: 1px solid var(--p-line); padding: 10px 6px; display: flex; flex-direction: column; gap: 6px; }
.pv-side i { display: flex; align-items: center; gap: 4px; height: 12px; border-radius: 4px; }
.pv-side i::before { content: ''; width: 9px; height: 9px; border-radius: var(--p-av-r); background: var(--p-av); flex: none; }
.pv-side i::after { content: ''; flex: 1; height: 4px; border-radius: 2px; background: var(--p-txt); opacity: .35; }
.pv-side i.on { background: var(--p-sel); }
.pv-main { background: var(--p-main); display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 10px; }
.pv-b { align-self: flex-end; height: 14px; width: 55%; border-radius: var(--p-b-r); background: var(--p-mine); }
.pv-b.w2 { width: 38%; }
.pv-o { height: 5px; width: 70%; border-radius: 3px; background: var(--p-txt); opacity: .35; }
.pv-o.w2 { width: 50%; }
.pv-o.bub { height: 14px; width: 45%; border-radius: var(--p-b-r); background: var(--p-other); opacity: 1; }
.pv-in { margin-top: 4px; height: 16px; border-radius: var(--p-in-r); background: var(--p-in); box-shadow: 0 0 0 1px var(--p-line) inset; display: flex; justify-content: flex-end; padding: 2px; }
.pv-in::after { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--p-send); }
.pv-white { --p-rail: #f9f9f9; --p-side: #f9f9f9; --p-line: #ececec; --p-main: #fff; --p-mine: #f4f4f4; --p-other: transparent; --p-txt: #0d0d0d; --p-sel: #ececec; --p-av: #c9c9c9; --p-av-r: 3px; --p-b-r: 7px; --p-in: #fff; --p-in-r: 8px; --p-send: #0d0d0d; }
.pv-dark { --p-rail: #181818; --p-side: #181818; --p-line: #2c2c2c; --p-main: #212121; --p-mine: #303030; --p-other: transparent; --p-txt: #ececec; --p-sel: #2f2f2f; --p-av: #555; --p-av-r: 3px; --p-b-r: 7px; --p-in: #2f2f2f; --p-in-r: 8px; --p-send: #ececec; }
.pv-kakao { --p-rail: #f3f3f4; --p-side: #fff; --p-line: #e4e4e6; --p-main: #cad6e2; --p-mine: #ffe14f; --p-other: #fff; --p-txt: #161618; --p-sel: #ebebed; --p-av: #b6c0ca; --p-av-r: 35%; --p-b-r: 5px; --p-in: #fff; --p-in-r: 2px; --p-send: #ffe14f; }
.pv-kakao .pv-in { border-radius: 0; margin: 4px -10px -10px; height: 20px; }
@media (max-width: 720px) {
  .tp-list { grid-template-columns: 1fr; }
  .tp-card { padding: 24px 18px; }
}
/* 시간이 없는 줄(같은 분에 이어 쓴 메시지)은 아래 줄을 비워 두지 않고, 도구는 옆에 떠서 보인다 */
html:is([data-theme="white"], [data-theme="dark"]) .msg:not(.end) .tools { position: absolute; top: 50%; transform: translateY(-50%); background: var(--card); box-shadow: var(--shadow); border-radius: 10px; padding: 2px; height: auto; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine:not(.end) .tools { right: calc(100% + 6px); }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other:not(.end) .tools { left: calc(100% + 6px); }
html:is([data-theme="white"], [data-theme="dark"]) .msg:not(.end) .line { row-gap: 0; }
html:is([data-theme="white"], [data-theme="dark"]) .msg + .msg:not(.start) { margin-top: 4px; }

/* 말풍선이 넓으면 아래 칸도 넓어진다: 시간·도구를 말풍선 끝에 붙인다 */
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .line > time { justify-self: end; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .line > .tools { justify-self: end; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .line > time { justify-self: start; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .line > .tools { justify-self: start; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.mine .line { grid-template-columns: 1fr auto; }
html:is([data-theme="white"], [data-theme="dark"]) .msg.other .line { grid-template-columns: auto 1fr; }
