/* Dynamic Island 느낌: 검은 바탕, 알약 모양, 아이콘 중심, 부드러운 움직임 */
:root {
  --accent: #7aa2ff;
  --font-size: 14px;
  --radius: 22px;
  --ease: cubic-bezier(0.2, 0.9, 0.25, 1.15);
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #0d0d0f;
  --surface-2: #161619;
  --surface-3: #202024;
  --line: rgba(255, 255, 255, 0.08);
  --text: #f2f2f4;
  --muted: #8b8b93;
  --user: #1c1f2a;
  --code: #141417;
  --ok: #5ee08a;
  --warn: #ffb547;
  --bad: #ff6b6b;
  --add: rgba(94, 224, 138, 0.12);
  --del: rgba(255, 107, 107, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}
:root[data-theme="light"] {
  --bg: #f4f4f6;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --surface-3: #e6e6ea;
  --line: rgba(0, 0, 0, 0.08);
  --text: #111114;
  --muted: #74747c;
  --user: #e9edfb;
  --code: #f2f2f5;
  --ok: #1f9d4f;
  --warn: #c47a00;
  --bad: #d13b3b;
  --add: rgba(31, 157, 79, 0.1);
  --del: rgba(209, 59, 59, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}
/* 궤도 테마: 앱 아이콘처럼 깊은 밤하늘 보라와 해 같은 주황 */
:root[data-theme="orbit"] {
  --bg: #0a0810;
  --surface: #13101b;
  --surface-2: #1c1826;
  --surface-3: #282233;
  --line: rgba(255, 214, 160, 0.09);
  --text: #f5efe6;
  --muted: #9a90a6;
  --user: #2a2030;
  --code: #17131f;
  --ok: #8fe0a6;
  --warn: #ffb547;
  --bad: #ff7a7a;
  --add: rgba(143, 224, 166, 0.12);
  --del: rgba(255, 122, 122, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(255, 181, 71, 0.04);
}
:root[data-theme="orbit"] body { background: radial-gradient(1200px 700px at 50% -10%, #1e1a2a 0%, #0a0810 60%) fixed; }
:root[data-theme="orbit"] #sidebar, :root[data-theme="orbit"] #settingsNav { background: transparent; }
/* 궤도 테마 밝은 쪽: 아침 햇빛 같은 크림색 바탕과 주황 */
:root[data-theme="orbit-light"] {
  --bg: #f7f1e8;
  --surface: #fffaf2;
  --surface-2: #f1e8db;
  --surface-3: #e6dacb;
  --line: rgba(80, 50, 20, 0.1);
  --text: #21182b;
  --muted: #7c7085;
  --user: #f3e3c8;
  --code: #f4ece0;
  --ok: #2f9a5a;
  --warn: #c97a10;
  --bad: #cf4040;
  --add: rgba(47, 154, 90, 0.12);
  --del: rgba(207, 64, 64, 0.1);
  --shadow: 0 10px 30px rgba(120, 80, 30, 0.12);
}
:root[data-theme="orbit-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #fde9c8 0%, #f7f1e8 60%) fixed; }
:root[data-theme="orbit-light"] #sidebar, :root[data-theme="orbit-light"] #settingsNav { background: transparent; }

/* 궤도 2 테마: 파란 해. 어두운 쪽은 깊은 남색 밤하늘, 밝은 쪽은 맑은 하늘색 */
:root[data-theme="orbit2"] {
  --bg: #060a14;
  --surface: #0e1424;
  --surface-2: #151d31;
  --surface-3: #1f2a43;
  --line: rgba(150, 190, 255, 0.1);
  --text: #eaf1ff;
  --muted: #8e9bb8;
  --user: #18243f;
  --code: #0c1220;
  --ok: #7fe0b0;
  --warn: #ffc46b;
  --bad: #ff7a8a;
  --add: rgba(127, 224, 176, 0.12);
  --del: rgba(255, 122, 138, 0.12);
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 60px rgba(91, 157, 255, 0.05);
}
:root[data-theme="orbit2"] body { background: radial-gradient(1200px 700px at 50% -10%, #14203d 0%, #060a14 60%) fixed; }
:root[data-theme="orbit2-light"] {
  --bg: #eef4fd;
  --surface: #f8fbff;
  --surface-2: #e4edfa;
  --surface-3: #d5e2f5;
  --line: rgba(30, 60, 120, 0.1);
  --text: #111a2e;
  --muted: #66748f;
  --user: #d9e7fd;
  --code: #e8f0fb;
  --ok: #1f9a62;
  --warn: #c27a0e;
  --bad: #d1364a;
  --add: rgba(31, 154, 98, 0.12);
  --del: rgba(209, 54, 74, 0.1);
  --shadow: 0 10px 30px rgba(40, 80, 160, 0.12);
}
:root[data-theme="orbit2-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #d6e6ff 0%, #eef4fd 60%) fixed; }
:root[data-theme="orbit2"] #sidebar, :root[data-theme="orbit2"] #settingsNav,
:root[data-theme="orbit2-light"] #sidebar, :root[data-theme="orbit2-light"] #settingsNav { background: transparent; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: var(--font-size)/1.6 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", sans-serif;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; white-space: nowrap; }
button:disabled { opacity: 0.4; cursor: default; }
input, textarea { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 7px 10px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
svg { display: block; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9em; }
.spacer { flex: 1; }
.grow { flex: 1; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }

.icon-btn { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; color: var(--muted); transition: background 0.2s, color 0.2s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }
.pill-btn { background: var(--surface-3); border-radius: 999px; padding: 6px 16px; transition: transform 0.15s var(--ease), filter 0.2s; }
.pill-btn:hover { filter: brightness(1.15); }
.pill-btn:active { transform: scale(0.96); }
.pill-btn.primary { background: var(--accent); color: #000; font-weight: 600; }
.pill-btn.small { padding: 2px 10px; font-size: 0.85em; }

#app { display: grid; grid-template-columns: var(--side-w, 240px) 1fr auto; height: 100vh; }

/* 사이드바 */
#sidebar { background: var(--bg); border-right: 1px solid var(--line); padding: 40px 10px 10px; display: flex; flex-direction: column; gap: 10px; -webkit-app-region: drag; }
#sidebar > * { -webkit-app-region: no-drag; }
.side-top { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 0 8px; -webkit-app-region: drag; }
.side-top button { -webkit-app-region: no-drag; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; letter-spacing: 0.3px; }
.brand #brandMark { display: inline-grid; }
#convList { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
#convList li { padding: 8px 10px; border-radius: 12px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); transition: background 0.2s, color 0.2s; }
#convList li:hover { background: var(--surface); color: var(--text); }
#convList li.active { background: var(--surface-2); color: var(--text); }

/* 대화 */
#main { position: relative; display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.drag-strip { height: 34px; flex: none; -webkit-app-region: drag; }
#messages { flex: 1; overflow-y: auto; padding: 4px 24px 12px; }
.msg { max-width: 760px; margin: 0 auto 16px; animation: rise 0.35s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user .bubble { background: var(--user); border-radius: 20px; padding: 9px 16px; margin-left: auto; width: fit-content; max-width: 82%; white-space: pre-wrap; word-break: break-word; }
.msg.assistant .bubble { word-break: break-word; }
.msg .meta { color: var(--muted); font-size: 0.78em; margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.msg.user .meta { justify-content: flex-end; }
.msg .atts { color: var(--muted); font-size: 0.85em; text-align: right; margin-bottom: 3px; }
.notice { max-width: 760px; margin: 0 auto 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 0.88em; display: flex; gap: 8px; align-items: center; animation: rise 0.35s var(--ease); }
.notice .ic { color: var(--ok); }
.notice.plain { background: none; border: none; color: var(--muted); padding: 0; }
.msg.error .bubble { background: var(--del); color: var(--bad); border-radius: 16px; padding: 8px 8px 8px 14px; display: flex; gap: 8px; align-items: center; }
details.thinking { color: var(--muted); font-size: 0.9em; margin-bottom: 6px; }
details.thinking summary { cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.thinking summary::-webkit-details-marker { display: none; }
details.thinking .thinking-body { white-space: pre-wrap; border-left: 2px solid var(--line); padding-left: 10px; margin-top: 4px; }
.typing:empty::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.25; transform: scale(0.7); } }
.bubble p { margin: 0.35em 0; }
.bubble pre { background: var(--code); border: 1px solid var(--line); border-radius: 14px; padding: 12px; overflow-x: auto; font-size: 0.88em; }
.bubble code { background: var(--code); border-radius: 6px; padding: 1px 5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.bubble pre code { background: none; padding: 0; }
.bubble table { border-collapse: collapse; }
.bubble th, .bubble td { border: 1px solid var(--line); padding: 3px 8px; }
.bubble .link { text-decoration: underline dotted; cursor: help; }
.bubble ul, .bubble ol { padding-left: 1.3em; }

.empty { max-width: 760px; margin: 22vh auto 0; text-align: center; }
.empty-mark { display: grid; place-items: center; margin-bottom: 16px; }
.vision-mark { color: var(--text); }
.empty-mark .sun { transform-origin: 32px 32px; animation: sunGlow 4s ease-in-out infinite; }
@keyframes sunGlow { 50% { transform: scale(1.06); } }
.empty-title { font-size: 1.5em; font-weight: 600; }

/* 아래 섬: 입력창 + 독 */
#island { padding: 0 24px 16px; }
#island > * { max-width: 760px; margin-left: auto; margin-right: auto; }
#banner { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 6px 5px 14px; display: flex; gap: 8px; align-items: center; margin-bottom: 8px; font-size: 0.9em; width: fit-content; animation: rise 0.35s var(--ease); }
#banner .ic { color: var(--warn); }
#composer { display: flex; gap: 6px; align-items: flex-end; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; padding: 7px; box-shadow: var(--shadow); transition: border-color 0.25s, box-shadow 0.25s; }
#composer:focus-within { border-color: color-mix(in srgb, var(--accent) 55%, transparent); box-shadow: var(--shadow), 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
#composer textarea { flex: 1; border: none; background: transparent; resize: none; max-height: 240px; padding: 6px 4px; }
.send { width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #000; display: grid; place-items: center; flex: none; transition: transform 0.2s var(--ease); }
.send:active { transform: scale(0.9); }
.send svg { width: 17px; height: 17px; }
.send.busy { background: var(--text); }
.attach-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.attach-row:empty { display: none; }
.chip { background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 0.85em; display: inline-flex; gap: 4px; align-items: center; }
.chip button { padding: 0 6px; color: var(--muted); }

#dock { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.dock-group { display: flex; align-items: center; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.dock-btn { height: 30px; min-width: 30px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); transition: background 0.2s, color 0.2s, transform 0.2s var(--ease); }
.dock-btn:hover { background: var(--surface-3); color: var(--text); }
.dock-btn:active { transform: scale(0.92); }
.dock-btn svg { width: 16px; height: 16px; }
.dock-btn.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.dock-btn.cost { font-variant-numeric: tabular-nums; font-size: 0.82em; }
.dock-btn.cost.warn { color: var(--warn); }
.dock-badge { color: var(--accent); display: inline-grid; place-items: center; width: 26px; }
.dock-badge svg { width: 15px; height: 15px; }
.seg { position: relative; display: inline-flex; background: var(--surface-2); border-radius: 999px; padding: 2px; }
.seg .thumb { position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 999px; background: var(--accent); transition: transform 0.42s var(--ease), width 0.42s var(--ease); z-index: 0; }
.seg button { position: relative; z-index: 1; padding: 3px 11px; border-radius: 999px; color: var(--muted); font-size: 0.85em; font-weight: 600; transition: color 0.3s ease; }
.seg button.active { color: #000; }

/* 시트 (기억, 기록) */
#sheet { width: 420px; height: 100vh; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; animation: slide 0.35s var(--ease); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 38px 14px 8px 18px; }
.sheet-title { font-weight: 700; font-size: 1.05em; }
.sheet-body { display: none; padding: 4px 18px 30px; overflow-y: auto; flex: 1; }
.sheet-body.active { display: block; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button { background: var(--surface-2); border-radius: 999px; padding: 3px 11px; font-size: 0.85em; color: var(--muted); transition: background 0.3s ease, color 0.3s ease, transform 0.2s var(--ease); }
.chips button:active { transform: scale(0.94); }
.chips button.active { background: var(--text); color: var(--bg); }
.editor { width: 100%; min-height: 240px; margin-top: 10px; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.88em; }
.editor.short { min-height: 110px; }
.section-title { color: var(--muted); font-size: 0.8em; margin: 22px 0 6px; letter-spacing: 0.4px; }
.changes { list-style: none; padding: 0; margin: 0; }
.changes li { border-bottom: 1px solid var(--line); padding: 8px 0; font-size: 0.88em; display: flex; gap: 8px; align-items: flex-start; }
.changes li .what { flex: 1; }
.changes li .src { color: var(--muted); font-size: 0.85em; display: flex; gap: 5px; align-items: center; }
.changes li .src svg { width: 12px; height: 12px; }
.changes li.undone .what { text-decoration: line-through; opacity: 0.5; }
pre.log { background: var(--code); border-radius: 14px; padding: 12px; font-size: 0.78em; white-space: pre-wrap; word-break: break-all; min-height: 200px; margin-top: 10px; }

/* 설정 화면 */
#settings { position: fixed; inset: 0; background: var(--bg); display: grid; grid-template-columns: 220px 1fr; z-index: 5; animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
#settingsNav { padding: 44px 10px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; -webkit-app-region: drag; }
#settingsNav > * { -webkit-app-region: no-drag; }
.settings-title { font-weight: 700; font-size: 1.15em; padding: 0 12px 12px; -webkit-app-region: drag; }
#settingsNav button { text-align: left; padding: 8px 12px; border-radius: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
#settingsNav button svg { width: 16px; height: 16px; }
#settingsNav button:hover { background: var(--surface); color: var(--text); }
#settingsNav button.active { background: var(--surface-2); color: var(--text); }
#settingsBody { position: relative; overflow-y: auto; padding: 44px 40px 40px; }
#settingsBody .close { position: fixed; top: 14px; right: 16px; }
.stab { display: none; max-width: 640px; animation: rise 0.3s var(--ease); }
.stab.active { display: block; }
.stab h2 { font-size: 1.5em; margin: 0 0 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.card-title { font-weight: 600; margin-bottom: 4px; }
.field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; }
.field + .field { border-top: 1px solid var(--line); }
.num { width: 90px; text-align: right; }
.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); transition: background 0.25s; cursor: pointer; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 999px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform 0.42s var(--ease), width 0.25s ease, left 0.42s var(--ease); }
.switch:active i::after { width: 23px; }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch:active input:checked + i::after { left: -2px; }
.switch input:disabled + i { opacity: 0.35; cursor: default; }
.soon { font-size: 0.75em; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.stats { display: flex; gap: 10px; margin: 12px 0 4px; flex-wrap: wrap; }
.stat { background: var(--surface-2); border-radius: 16px; padding: 10px 14px; min-width: 110px; }
.stat b { display: block; font-size: 1.3em; }
.stat span { color: var(--muted); font-size: 0.82em; display: flex; gap: 5px; align-items: center; }
.stat span svg { width: 13px; height: 13px; }
.cost-card { display: flex; gap: 24px; align-items: center; }
#costNumbers b { font-size: 1.8em; display: block; }
.diff { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.82em; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 8px 0; }
.diff .fname { background: var(--surface-2); padding: 4px 10px; font-weight: 600; }
.diff .l { padding: 1px 10px; white-space: pre-wrap; }
.diff .l.add { background: var(--add); }
.diff .l.del { background: var(--del); text-decoration: line-through; }
.import-item { font-size: 0.85em; margin: 3px 0; color: var(--muted); }
.import-item.bad { color: var(--bad); }
input[type="color"] { width: 44px; height: 28px; padding: 2px; border-radius: 8px; }
input[type="range"] { width: 180px; accent-color: var(--accent); }

#toasts { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 20; align-items: center; }
.toast { background: #000; color: #fff; border: 1px solid rgba(255, 255, 255, 0.12); padding: 8px 18px; border-radius: 999px; max-width: 520px; font-size: 0.88em; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5); animation: drop 0.4s var(--ease); }
@keyframes drop { from { transform: translateY(-14px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }

/* 열기/닫기 애니메이션 */
#sheet.closing { animation: slideOut 0.26s ease forwards; }
@keyframes slideOut { to { transform: translateX(40px); opacity: 0; } }
#settings { animation: popIn 0.34s var(--ease); }
#settings.closing { animation: popOut 0.22s ease forwards; }
@keyframes popIn { from { opacity: 0; transform: scale(0.985); } to { opacity: 1; transform: none; } }
@keyframes popOut { to { opacity: 0; transform: scale(0.985); } }
.toast.out { animation: rise 0.25s ease reverse forwards; }
#deepBtn svg { transition: transform 0.5s var(--ease); }
#deepBtn.on svg { transform: rotate(72deg) scale(1.1); }
.dock-btn.on { animation: pop 0.35s var(--ease); }
@keyframes pop { 40% { transform: scale(1.12); } }
#banner { transition: opacity 0.3s ease; }

/* 처리 단계 */
.steps { margin: 0 0 8px; display: flex; flex-direction: column; gap: 3px; }
.step { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.86em; animation: rise 0.3s var(--ease); }
.step .st { width: 14px; height: 14px; display: grid; place-items: center; flex: none; }
.step .st svg { width: 14px; height: 14px; }
.step.run { color: var(--text); }
.step.run .st::before { content: ""; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--surface-3); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
.step.done .st { color: var(--ok); }
.step.error .st { color: var(--bad); }
@keyframes spin { to { transform: rotate(360deg); } }
details.steps-done { color: var(--muted); font-size: 0.86em; margin-bottom: 6px; }
details.steps-done summary { cursor: pointer; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details.steps-done summary::-webkit-details-marker { display: none; }
details.steps-done summary svg { width: 13px; height: 13px; color: var(--ok); }
details.steps-done .steps { margin-top: 6px; padding-left: 4px; }

/* 대화 정리 */
.notes { line-height: 1.65; }
.notes h2 { font-size: 0.82em; color: var(--muted); letter-spacing: 0.4px; margin: 18px 0 4px; font-weight: 600; }
.notes h2:first-child { margin-top: 4px; }
.notes ul { padding-left: 1.2em; margin: 0; }
.notes .empty-note { color: var(--muted); padding: 30px 0 10px; text-align: center; }
.notes .empty-note svg { width: 28px; height: 28px; margin: 0 auto 10px; opacity: 0.6; }

/* 스크롤바 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 999px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
#sheet ::-webkit-scrollbar-thumb, .card ::-webkit-scrollbar-thumb { border-color: var(--surface); }

/* 대화 목록 메뉴 */
#convList li { position: relative; display: flex; align-items: center; gap: 6px; padding-right: 4px; }
#convList li .t { flex: 1; overflow: hidden; text-overflow: ellipsis; }
#convList li .pinmark { color: var(--accent); display: inline-grid; }
#convList li .pinmark svg { width: 12px; height: 12px; }
#convList li .more { width: 24px; height: 24px; opacity: 0; transition: opacity 0.2s; }
#convList li:hover .more, #convList li.menu-open .more { opacity: 1; }
#convList li input { flex: 1; min-width: 0; padding: 2px 6px; border-radius: 8px; font-size: 0.95em; }
.conv-menu { position: fixed; z-index: 30; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 5px; min-width: 150px; box-shadow: var(--shadow); animation: menuIn 0.22s var(--ease); transform-origin: top left; }
@keyframes menuIn { from { opacity: 0; transform: scale(0.92) translateY(-4px); } to { opacity: 1; transform: none; } }
.conv-menu.out { animation: menuIn 0.15s ease reverse forwards; }
.conv-menu button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 11px; color: var(--text); font-size: 0.92em; transition: background 0.15s, color 0.2s; }
.conv-menu button svg { width: 15px; height: 15px; color: var(--muted); }
.conv-menu button:hover { background: var(--surface-3); }
.conv-menu button.danger { color: var(--bad); }
.conv-menu button.danger svg { color: var(--bad); }
.conv-menu button.danger.armed { background: var(--bad); color: #fff; }
.conv-menu button.danger.armed svg { color: #fff; }
#convList li.leaving { animation: leave 0.28s ease forwards; }
@keyframes leave { to { opacity: 0; transform: translateX(-16px); height: 0; padding-top: 0; padding-bottom: 0; } }

/* 기록 */
.stab.wide { max-width: 980px; }
.rec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.rec-head h2 { margin: 0 8px 0 0 !important; }
.date-nav { display: inline-flex; align-items: center; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px; }
.date-nav span { font-variant-numeric: tabular-nums; font-size: 0.9em; padding: 0 6px; min-width: 92px; text-align: center; }
.date-nav .icon-btn { width: 28px; height: 28px; }
#recTabs { margin-bottom: 14px; }
#recBody { display: flex; flex-direction: column; gap: 14px; animation: rise 0.3s var(--ease); }
#convRecords { display: none; flex-direction: column; gap: 12px; }
#convRecords.active { display: flex; }
.mini { background: var(--surface-2); border-radius: 18px; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; animation: rise 0.35s var(--ease) both; }
.mini-title { color: var(--muted); font-size: 0.78em; letter-spacing: 0.3px; }
.mini-row { display: flex; gap: 14px; align-items: center; }
#sheet .kpi b { font-size: 1.35em; }
#sheet .kpis { gap: 18px; }
#sheet .hb { grid-template-columns: 80px 1fr 40px; }
#sheet table.tbl { font-size: 0.8em; }
#sheet table.tbl th, #sheet table.tbl td { padding: 6px 8px; }
.kpis { display: flex; gap: 22px; flex-wrap: wrap; }
.kpi b { display: block; font-size: 1.7em; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.kpi span { color: var(--muted); font-size: 0.8em; }
.rc-body { flex: 1; min-height: 0; display: flex; gap: 18px; align-items: center; }
.rc-body.col { flex-direction: column; align-items: stretch; }
.chart .bar { transform-box: fill-box; transform-origin: bottom; animation: grow 0.5s var(--ease) both; animation-delay: calc(var(--i) * 12ms); }
@keyframes grow { from { transform: scaleY(0); } }
.chart .arc { animation: fadeArc 0.6s ease both; }
@keyframes fadeArc { from { opacity: 0; } }
.legend { display: flex; flex-direction: column; gap: 5px; font-size: 0.86em; flex: 1; min-width: 0; }
.legend div { display: flex; align-items: center; gap: 8px; }
.legend i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend span { flex: 1; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend b { font-variant-numeric: tabular-nums; font-weight: 600; }
.hbars { display: flex; flex-direction: column; gap: 7px; width: 100%; }
.hb { display: grid; grid-template-columns: 110px 1fr 44px; align-items: center; gap: 10px; font-size: 0.85em; }
.hb span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb .track { height: 8px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.hb .fill { height: 100%; border-radius: 999px; transform-origin: left; animation: growX 0.55s var(--ease) both; animation-delay: calc(var(--i) * 40ms); }
@keyframes growX { from { transform: scaleX(0); } }
.hb b { text-align: right; font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; width: 100%; }
.stack div { transform-origin: left; animation: growX 0.6s var(--ease) both; }
.rc-empty { color: var(--muted); display: grid; place-items: center; flex: 1; }
.rc-empty svg { width: 30px; height: 30px; opacity: 0.4; }

/* 표 */
.tbl-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.86em; font-variant-numeric: tabular-nums; }
table.tbl th { position: sticky; top: 0; background: var(--surface-2); color: var(--muted); font-weight: 600; text-align: left; padding: 8px 12px; white-space: nowrap; }
table.tbl td { padding: 8px 12px; border-top: 1px solid var(--line); vertical-align: top; }
table.tbl td.num, table.tbl th.num { text-align: right; }
table.tbl tr { animation: rise 0.3s var(--ease) both; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tr.total td { font-weight: 700; background: var(--surface-2); }
table.tbl td.msg { max-width: 640px; white-space: pre-wrap; word-break: break-word; }
.who { display: inline-flex; align-items: center; gap: 6px; }
.who svg { width: 13px; height: 13px; }
.tag { display: inline-block; background: var(--surface-3); border-radius: 999px; padding: 0 8px; font-size: 0.9em; }
.detail-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.detail-charts > div { background: var(--surface-2); border-radius: 18px; padding: 14px 16px; display: flex; gap: 14px; align-items: center; }
#rawView { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.55); display: grid; place-items: center; animation: fade 0.2s ease; }
.raw-box { width: min(900px, 90vw); height: 80vh; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; display: flex; flex-direction: column; overflow: hidden; animation: popIn 0.3s var(--ease); }
.raw-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px 10px 18px; border-bottom: 1px solid var(--line); font-weight: 600; }
#rawPre { flex: 1; margin: 0; overflow: auto; padding: 14px 18px; font-size: 0.78em; white-space: pre-wrap; word-break: break-all; }
#recBody .card { margin-bottom: 0; }

/* 테마 미리보기 */
.section-h { font-weight: 600; margin: 26px 0 12px 2px; }
.theme-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.theme-h .seg { font-weight: 400; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.theme-card { display: flex; flex-direction: column; gap: 9px; cursor: pointer; text-align: left; padding: 0; animation: rise 0.35s var(--ease) both; }
.theme-card .pv { position: relative; aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 0 0 0 transparent; transition: box-shadow 0.35s var(--ease), transform 0.3s var(--ease); display: flex; }
.theme-card:hover .pv { transform: translateY(-3px); }
.theme-card:active .pv { transform: scale(0.97); }
.theme-card.selected .pv { box-shadow: 0 0 0 2.5px var(--accent), 0 10px 30px rgba(0, 0, 0, 0.35); }
.theme-card .lb { display: flex; align-items: center; gap: 7px; font-size: 0.92em; color: var(--muted); transition: color 0.25s; }
.theme-card.selected .lb { color: var(--text); font-weight: 600; }
.theme-card .lb .ck { width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--surface-3); display: grid; place-items: center; transition: background 0.3s, border-color 0.3s; }
.theme-card .lb .ck svg { width: 10px; height: 10px; color: #000; opacity: 0; transform: scale(0.4); transition: opacity 0.25s, transform 0.35s var(--ease); }
.theme-card.selected .lb .ck { background: var(--accent); border-color: var(--accent); }
.theme-card.selected .lb .ck svg { opacity: 1; transform: none; }
.pv .half { flex: 1; position: relative; display: flex; overflow: hidden; }
.pv .sd { width: 26%; height: 100%; border-right: 1px solid rgba(128, 128, 128, 0.15); padding: 9% 5%; display: flex; flex-direction: column; gap: 6%; }
.pv .sd i { display: block; height: 5px; border-radius: 3px; }
.pv .mn { flex: 1; position: relative; padding: 9% 7%; display: flex; flex-direction: column; gap: 7%; }
.pv .b1 { align-self: flex-end; width: 46%; height: 12%; border-radius: 99px; }
.pv .b2 { width: 62%; height: 5px; border-radius: 3px; }
.pv .b3 { width: 44%; height: 5px; border-radius: 3px; }
.pv .cp { position: absolute; left: 7%; right: 7%; bottom: 13%; height: 13%; border-radius: 99px; display: flex; justify-content: flex-end; align-items: center; padding: 0 2.5%; }
.pv .cp b { width: 9px; height: 9px; border-radius: 50%; }

/* 허락 카드 */
.approve { border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 8%, var(--surface)); border-radius: 18px; padding: 12px 14px; margin: 6px 0 10px; display: flex; flex-direction: column; gap: 10px; animation: rise 0.35s var(--ease); }
.approve .ap-title { display: flex; gap: 8px; align-items: center; font-weight: 600; }
.approve .ap-title svg { width: 16px; height: 16px; color: var(--warn); }
.approve pre { margin: 0; background: var(--code); border-radius: 12px; padding: 10px 12px; font-size: 0.82em; white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }
.approve .ap-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.approve.done { opacity: 0.7; }
.approve.done .ap-btns { display: none; }
.approve .ap-res { font-size: 0.85em; color: var(--muted); }

/* 아티팩트 */
#sheet.wide { width: min(720px, 55vw); }
#artifactBody { display: none; flex-direction: column; gap: 8px; padding-bottom: 14px; }
#artifactBody.active { display: flex; }
.art-bar { display: flex; align-items: center; gap: 4px; font-weight: 600; }
#artFrame { flex: 1; width: 100%; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.art-chip { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px 5px 10px; margin: 4px 6px 4px 0; cursor: pointer; font-size: 0.88em; transition: border-color 0.2s, transform 0.2s var(--ease); }
.art-chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.art-chip svg { width: 14px; height: 14px; color: var(--accent); }

/* 설정: 컴퓨터 작업 */
.conn { display: inline-flex; align-items: center; gap: 8px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); transition: background 0.3s, box-shadow 0.3s; }
.conn.on i { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
.conn b { font-weight: 500; }
.code { font-variant-numeric: tabular-nums; letter-spacing: 4px; font-size: 1.25em; font-weight: 700; background: var(--surface-2); border-radius: 12px; padding: 3px 12px; }
.steps-guide { margin: 12px 0 2px; padding-left: 1.3em; color: var(--muted); font-size: 0.88em; line-height: 1.9; }
.steps-guide code { background: var(--surface-2); border-radius: 6px; padding: 1px 6px; color: var(--text); }
#sheet.wide { width: min(640px, 48vw); }
#dock { flex-wrap: wrap; gap: 8px; }

/* 좁은 화면 (크롬 사이드 패널) */
.menu-btn { display: none; }
#sideBackdrop { display: none; }
@media (max-width: 720px) {
  #app { grid-template-columns: 1fr; }
  #sidebar { position: fixed; inset: 0 auto 0 0; width: min(280px, 82vw); z-index: 9; padding-top: 16px; background: var(--bg); transform: translateX(-102%); transition: transform 0.38s var(--ease); box-shadow: var(--shadow); }
  body.side-open #sidebar { transform: none; }
  :root[data-theme] #sidebar { background: var(--bg); }
  #settingsBody .close { background: var(--surface-2); z-index: 2; }
  #sideBackdrop { display: block; position: fixed; inset: 0; z-index: 8; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
  body.side-open #sideBackdrop { opacity: 1; pointer-events: auto; }
  .menu-btn { display: inline-grid; position: absolute; top: 6px; left: 10px; z-index: 3; -webkit-app-region: no-drag; }
  .drag-strip { position: relative; height: 44px; }
  #messages { padding: 4px 14px 12px; }
  #island { padding: 0 12px 12px; }
  .msg.user .bubble { max-width: 90%; }
  #sheet, #sheet.wide { position: fixed; inset: 0; width: 100%; z-index: 6; }
  .sheet-head { padding-top: 14px; }
  #settings { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  #settingsNav { flex-direction: row; overflow-x: auto; padding: 12px 52px 8px 10px; border-right: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  #settingsNav::-webkit-scrollbar { display: none; }
  .settings-title { display: none; }
  #settingsNav button { flex: none; padding: 6px 10px; }
  #settingsBody { padding: 18px 16px 30px; }
  #settingsBody .close { top: 10px; right: 10px; }
  .detail-charts { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
  .cost-card { flex-direction: column; align-items: flex-start; }
  .hb { grid-template-columns: 80px 1fr 40px; }
  .rec-head { flex-wrap: wrap; }
}

/* 사이드 패널 연결 안내 */
#vpOverlay { position: fixed; inset: 0; z-index: 50; background: var(--bg, #000); display: none; place-items: center; padding: 24px; }
#vpOverlay.show { display: grid; animation: fade 0.25s ease; }
.vp-box { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 300px; text-align: center; }
.vp-box img { width: 64px; height: 64px; border-radius: 16px; }
.vp-title { font-weight: 700; font-size: 1.3em; }
.vp-msg { color: var(--muted); font-size: 0.92em; line-height: 1.6; }
#vpCode { width: 100%; text-align: center; letter-spacing: 6px; font-size: 1.3em; padding: 10px; }
#vpSave { width: 100%; padding: 10px; }

/* ---------- Liquid Glass 테마 ----------
   창 뒤(바탕화면)가 흐리게 비치는 맥 vibrancy 위에, 반투명한 유리 면과 가장자리 빛을 얹는다.
   크롬 사이드 패널처럼 창 뒤가 안 비치는 곳은 흐린 색 덩어리를 바탕에 깐다. */
:root[data-theme="glass"] {
  --bg: rgba(14, 16, 24, 0.38);
  --surface: rgba(255, 255, 255, 0.08);
  --surface-2: rgba(255, 255, 255, 0.12);
  --surface-3: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.14);
  --text: #f5f7fb;
  --muted: rgba(235, 240, 250, 0.62);
  --user: rgba(10, 132, 255, 0.42);
  --code: rgba(0, 0, 0, 0.28);
  --ok: #63e6a0;
  --warn: #ffc457;
  --bad: #ff7b7b;
  --add: rgba(99, 230, 160, 0.14);
  --del: rgba(255, 123, 123, 0.14);
  --shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
  --glass-edge: rgba(255, 255, 255, 0.22);
  --glass-hi: rgba(255, 255, 255, 0.32);
  --glass-lo: rgba(255, 255, 255, 0.05);
  --glass-sheet: rgba(24, 26, 36, 0.9);
}
:root[data-theme="glass-light"] {
  --bg: rgba(246, 248, 252, 0.42);
  --surface: rgba(255, 255, 255, 0.5);
  --surface-2: rgba(255, 255, 255, 0.62);
  --surface-3: rgba(255, 255, 255, 0.82);
  --line: rgba(255, 255, 255, 0.75);
  --text: #0f1320;
  --muted: rgba(20, 28, 50, 0.58);
  --user: rgba(10, 132, 255, 0.2);
  --code: rgba(255, 255, 255, 0.55);
  --ok: #1f9d55;
  --warn: #c47a00;
  --bad: #d13b3b;
  --add: rgba(31, 157, 85, 0.12);
  --del: rgba(209, 59, 59, 0.1);
  --shadow: 0 6px 20px rgba(40, 50, 80, 0.08);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-hi: rgba(255, 255, 255, 0.95);
  --glass-lo: rgba(255, 255, 255, 0.35);
  --glass-sheet: rgba(246, 247, 251, 0.92);
}
/* 앱 창: 바탕은 완전히 투명하게 두고 맥 vibrancy 재질이 비치게 한다
   (반투명 색을 깔면 흐림 효과와 겹치는 곳에 네모난 얼룩이 생긴다) */
:root.glass, :root.glass body { background: transparent; }
:root.glass #sidebar, :root.glass #settingsNav { background: transparent; }
:root.glass.in-panel body {
  background:
    radial-gradient(60% 50% at 10% 10%, rgba(255, 138, 216, 0.35), transparent 70%),
    radial-gradient(55% 50% at 95% 25%, rgba(90, 200, 250, 0.4), transparent 70%),
    radial-gradient(70% 60% at 50% 105%, rgba(125, 122, 255, 0.4), transparent 70%),
    var(--glass-sheet) fixed;
}
/* 유리 면: 흐림 + 채도 + 위쪽 가장자리 빛 + 아래쪽 약한 반사 */
:root.glass #composer, :root.glass .dock-group, :root.glass #banner, :root.glass .notice:not(.plain),
:root.glass .card, :root.glass .msg.user .bubble, :root.glass .stat, :root.glass .seg, :root.glass .chip,
:root.glass .toast, :root.glass .pill-btn, :root.glass #convList li.active, :root.glass #settingsNav button.active {
  -webkit-backdrop-filter: blur(26px) saturate(185%);
  backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 1px var(--glass-lo), var(--shadow);
}
:root.glass .msg.user .bubble, :root.glass .stat, :root.glass .chip, :root.glass .pill-btn,
:root.glass #convList li.active, :root.glass #settingsNav button.active { box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 1px var(--glass-lo); }
:root.glass #composer { position: relative; }
/* 빛이 맺히는 위쪽 (Liquid Glass의 반짝이는 가장자리) */
:root.glass #composer::before, :root.glass .dock-group::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent 50%);
}
:root.glass #composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--glass-edge));
  box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 1px var(--glass-lo), var(--shadow), 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
:root.glass .dock-group { position: relative; }
/* 덮는 화면은 거의 불투명한 유리로. (흐림 효과를 넣으면 그 안의 고정 위치 버튼(닫기)이 가려져서 넣지 않는다) */
:root.glass #sheet, :root.glass #settings { background: var(--glass-sheet); }
:root.glass #sheet { border-left: 1px solid var(--glass-edge); }
:root.glass .seg .thumb { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 8px rgba(10, 132, 255, 0.35); }
:root.glass .send { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 2px 6px color-mix(in srgb, var(--accent) 30%, transparent); }
:root.glass .send, :root.glass .pill-btn.primary, :root.glass .seg button.active { color: #fff; }
:root.glass .switch i { background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--glass-edge); }
:root.glass .toast { background: var(--glass-sheet); color: var(--text); }
/* 테마 미리보기 속 유리 */
.pv .gl { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5); }

/* ---------- 음성 대화 ---------- */
#micBtn.on { color: var(--accent); }
#island.voice-on #composer, #island.voice-on #attachRow { display: none; }
#voiceBar { display: flex; align-items: center; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 26px;
  padding: 10px 10px 10px 12px; box-shadow: var(--shadow); animation: popIn 0.32s var(--ease); }
#voiceBar.hidden { display: none; }
.vb-orb { --lv: 0; position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; display: grid; place-items: center; }
.vb-orb i { width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--accent) 45%, color-mix(in srgb, var(--accent) 60%, #000) 100%);
  transform: scale(calc(0.85 + var(--lv) * 0.55)); box-shadow: 0 0 calc(8px + var(--lv) * 28px) color-mix(in srgb, var(--accent) 70%, transparent); transition: filter 0.3s; }
.vb-orb::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  transform: scale(calc(0.7 + var(--lv) * 0.6)); opacity: calc(0.25 + var(--lv)); }
#voiceBar[data-state="thinking"] .vb-orb i { animation: vbThink 1.1s ease-in-out infinite; }
#voiceBar[data-state="thinking"] .vb-orb::before { border-style: dashed; animation: vbSpin 2.4s linear infinite; opacity: 0.6; transform: none; }
@keyframes vbThink { 50% { filter: brightness(1.35); transform: scale(0.95); } }
@keyframes vbSpin { to { transform: rotate(360deg); } }
.vb-main { flex: 1; min-width: 0; }
.vb-label { font-size: 0.78em; color: var(--accent); font-weight: 600; letter-spacing: 0.2px; }
.vb-text { color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.4em; }
#voiceBar[data-state="listening"] .vb-text:empty::before { content: "말해 봐…"; color: var(--muted); }
:root.glass #voiceBar { -webkit-backdrop-filter: blur(26px) saturate(185%); backdrop-filter: blur(26px) saturate(185%);
  border: 1px solid var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), inset 0 -1px 1px var(--glass-lo), var(--shadow); }
select { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 8px; color: var(--text); max-width: 240px; }

/* 앱 창에서는 맥이 창 뒤를 이미 흐리게 보여 주니까, CSS 흐림은 끈다
   (투명한 창 위에서 CSS 흐림을 쓰면 색이 이상하게 번진다). 크롬 패널에서만 쓴다. */
:root.glass:not(.in-panel) *, :root.glass:not(.in-panel) *::before {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Claude 대화 옮기기 목록 */
.conv-pick { list-style: none; margin: 10px 0 0; padding: 0; max-height: 340px; overflow-y: auto; border-top: 1px solid var(--line); }
.conv-pick li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 0.92em; }
.conv-pick li .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-pick li .ck { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--surface-3); display: grid; place-items: center; flex: none; transition: background 0.2s, border-color 0.2s; }
.conv-pick li .ck svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity 0.2s; }
.conv-pick li.on .ck { background: var(--accent); border-color: var(--accent); }
.conv-pick li.on .ck svg { opacity: 1; }

/* ---------- 사이드바: 프로젝트·아티팩트 바로가기, 구역 ---------- */
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.side-nav-btn { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 12px; color: var(--muted); text-align: left; transition: background 0.2s, color 0.2s; }
.side-nav-btn svg { width: 16px; height: 16px; }
.side-nav-btn:hover { background: var(--surface); color: var(--text); }
#convList li.sec { font-size: 0.74em; color: var(--muted); letter-spacing: 0.3px; padding: 14px 10px 4px; cursor: default; background: none !important; opacity: 0.8; }
#convList li.sec:first-child { padding-top: 6px; }
#convList li .ptag { color: var(--muted); display: inline-grid; opacity: 0.7; }
#convList li .ptag svg { width: 12px; height: 12px; }
.conv-menu .menu-note { padding: 8px 12px; color: var(--muted); font-size: 0.85em; }
.conv-menu button.on { color: var(--accent); }

/* ---------- 프로젝트 · 아티팩트 화면 ---------- */
#main.page-on #messages, #main.page-on #island { display: none; }
#pageView { flex: 1; overflow-y: auto; padding: 4px 24px 30px; animation: rise 0.3s var(--ease); }
.page { max-width: 820px; margin: 0 auto; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.page-head h2 { margin: 0; font-size: 1.5em; }
.page .small { font-size: 0.8em; }
.pj-grid, .af-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.pj-card, .af-card { position: relative; display: flex; flex-direction: column; gap: 4px; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; cursor: pointer; transition: transform 0.2s var(--ease), border-color 0.2s; min-height: 96px; }
.pj-card:hover, .af-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.pj-card svg { width: 18px; height: 18px; color: var(--accent); }
.pj-card b, .af-card b { font-size: 0.98em; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pj-card .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-kind { display: flex; align-items: center; gap: 6px; color: var(--accent); font-size: 0.78em; font-weight: 600; }
.af-kind svg { width: 14px; height: 14px; }
.af-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.af-card:hover .af-tools { opacity: 1; }
.af-tools .icon-btn { width: 28px; height: 28px; }
.af-tools .icon-btn.armed { color: var(--bad); }
.pj-name { font-size: 1.3em; font-weight: 700; background: transparent; border: 1px solid transparent; flex: 1; min-width: 0; }
.pj-name:hover { border-color: var(--line); }
.pj-desc { width: 100%; margin-bottom: 14px; }
.pj-docs, .pj-convs { list-style: none; margin: 6px 0 0; padding: 0; }
.pj-docs li, .pj-convs li { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--line); font-size: 0.92em; }
.pj-docs li span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-docs li svg { width: 15px; height: 15px; }
.pj-convs li { cursor: pointer; }
.pj-convs li:hover { color: var(--accent); }
.pill-btn.danger { color: var(--bad); }
.pill-btn.danger.armed { background: var(--del); }
#projectChip { display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent); border-radius: 999px; padding: 2px 4px 2px 12px; font-size: 0.85em; margin-bottom: 8px; }
#projectChip.hidden { display: none; }
#projectChip svg { width: 14px; height: 14px; }
#projectChip .icon-btn { width: 24px; height: 24px; }
.conv-pick li .tag { font-size: 0.75em; background: var(--surface-2); border-radius: 999px; padding: 1px 8px; color: var(--muted); white-space: nowrap; }

/* 대화 목록은 따로 스크롤 (위쪽 메뉴는 그대로) */
#sidebar { height: 100vh; overflow: hidden; }
#convList { min-height: 0; overscroll-behavior: contain; }

/* 단축키 표 */
.keys { width: 100%; border-collapse: collapse; font-size: 0.88em; margin-top: 6px; }
.keys th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 6px; }
.keys td { padding: 5px 6px; border-top: 1px solid var(--line); }
.keys td:first-child { white-space: nowrap; width: 1%; }
.keys kbd { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }

/* 지켜보는 중 */
#watchBar { display: flex; flex-wrap: wrap; gap: 6px; }
#watchBar:not(:empty) { margin-bottom: 8px; }
.watch-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 12px; font-size: 0.85em; animation: rise 0.3s var(--ease); }
.watch-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse 1.6s ease-in-out infinite; }
.watch-chip .icon-btn { width: 24px; height: 24px; }
@keyframes pulse { 50% { opacity: 0.3; } }

/* 구역: 누르면 펼치고 접는다 */
#convList li.sec { display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 10px 8px 6px; font-size: 0.78em; color: var(--muted); opacity: 1; border-radius: 10px; }
#convList li.sec:hover { color: var(--text); background: none; }
#convList li.sec .chev { display: inline-grid; transition: transform 0.25s var(--ease); }
#convList li.sec .chev svg { width: 12px; height: 12px; }
#convList li.sec.open .chev { transform: rotate(90deg); }
#convList li.sec .st { flex: 1; }
#convList li.sec .cnt { font-size: 0.9em; opacity: 0.7; }

/* 세부 설정은 숨긴다 (값은 그대로 쓰인다) */
.detail { display: none !important; }

/* 프로젝트 폴더 (대화 목록 안) */
#convList li.sec.proj { font-size: 0.86em; color: var(--text); padding: 7px 8px; margin-top: 2px; }
#convList li.sec.proj .pj { display: inline-grid; color: var(--accent); }
#convList li.sec.proj .pj svg { width: 14px; height: 14px; }
#convList li.sec.proj .st { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#convList li.sec.proj:hover { background: var(--surface); }
#convList li.sec .go { width: 22px; height: 22px; opacity: 0; transition: opacity 0.2s; }
#convList li.sec .go svg { width: 13px; height: 13px; }
#convList li.sec:hover .go { opacity: 1; }
#convList li.indent { padding-left: 30px; }

/* 사용량 */
.card-title.sub { margin: 18px 4px 8px; color: var(--muted); }
.lim { margin: 10px 0 12px; }
.lim-h { display: flex; justify-content: space-between; font-size: 0.92em; }
.lim-h b.warn { color: var(--warn); }
.lim-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 5px 0 3px; }
.lim-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.6s var(--ease); }
.kv { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; font-size: 0.84em; }
.kv > div { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.kv > div span:last-child { color: var(--text); font-variant-numeric: tabular-nums; text-align: right; }

/* ================= 대화 목록 모양 ================= */
.palette-btn { display: none; -webkit-app-region: no-drag; margin: 4px 0 0 76px; }

@media (min-width: 721px) {
  /* --- 카드 --- */
  :root[data-list="cards"] #convList { padding: 0 2px; }
  #convList .card-filters { display: flex; flex-wrap: wrap; gap: 5px; padding: 4px 2px 10px; cursor: default; background: none !important; }
  #convList .card-filters button { display: inline-flex; align-items: center; gap: 5px; font-size: 0.76em; padding: 3px 9px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
  #convList .card-filters button.on { background: var(--text); color: var(--bg); border-color: transparent; }
  #convList .card-filters i { width: 7px; height: 7px; border-radius: 50%; }
  #convList li.card-item { display: block; position: relative; white-space: normal; padding: 10px 12px 10px 14px; margin-bottom: 7px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text); overflow: hidden; transition: transform 0.2s var(--ease), border-color 0.2s; }
  #convList li.card-item::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--pc); }
  #convList li.card-item:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--surface); }
  #convList li.card-item.active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
  #convList li.card-item .ci-top { display: flex; align-items: center; gap: 5px; padding-right: 20px; }
  #convList li.card-item b { font-size: 0.9em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #convList li.card-item .ci-snip { font-size: 0.78em; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
  #convList li.card-item .ci-meta { font-size: 0.7em; color: var(--muted); opacity: 0.8; margin-top: 4px; }
  #convList li.card-item .more { position: absolute; top: 6px; right: 4px; }

  /* --- 궤도 타임라인 --- */
  #convList li.tl-day { cursor: default; background: none !important; font-size: 0.74em; color: var(--accent); font-weight: 600; letter-spacing: 0.3px; padding: 12px 8px 4px 52px; }
  #convList li.tl-item { position: relative; display: flex; align-items: center; gap: 0; padding: 7px 4px 7px 0; border-radius: 10px; color: var(--muted); }
  #convList li.tl-item::before { content: ""; position: absolute; left: 47px; top: 0; bottom: 0; width: 1.5px; background: color-mix(in srgb, var(--accent) 25%, transparent); }
  #convList li.tl-item .tl-time { width: 40px; flex: none; text-align: right; font-size: 0.7em; font-variant-numeric: tabular-nums; opacity: 0.75; padding-right: 0; }
  #convList li.tl-item .tl-dot { position: relative; z-index: 1; width: 10px; height: 10px; flex: none; margin: 0 9px 0 3px; border-radius: 50%; border: 2px solid var(--pc); background: var(--bg); transition: transform 0.2s var(--ease); }
  #convList li.tl-item.active .tl-dot, #convList li.tl-item:hover .tl-dot { background: var(--pc); transform: scale(1.2); box-shadow: 0 0 10px var(--pc); }
  #convList li.tl-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9em; }
  #convList li.tl-item.active { color: var(--text); background: none; }
  #convList li.tl-item:hover { background: none; color: var(--text); }

  /* --- 아이콘 줄 + 펼침 패널 --- */
  :root[data-list="rail"] #app { grid-template-columns: 68px 1fr auto; }
  :root[data-list="rail"] #sidebar { padding: 40px 8px 10px; align-items: center; }
  :root[data-list="rail"] .brand { font-size: 0; gap: 0; }
  :root[data-list="rail"] .side-top { flex-direction: column; gap: 8px; padding: 0; }
  :root[data-list="rail"] .side-nav { align-items: center; }
  :root[data-list="rail"] .side-nav-btn span { display: none; }
  :root[data-list="rail"] .side-nav-btn { padding: 9px; justify-content: center; }
  :root[data-list="rail"] #convList { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 100%; padding-top: 8px; }
  #convList li.rail-btn { width: 40px; height: 40px; padding: 0; display: grid; place-items: center; border-radius: 14px; color: var(--muted); transition: background 0.2s, transform 0.2s var(--ease); }
  #convList li.rail-btn svg { width: 18px; height: 18px; }
  #convList li.rail-btn:hover, #convList li.rail-btn.on { background: var(--surface-2); color: var(--text); }
  #convList li.rail-btn.on { box-shadow: inset 0 0 0 1.5px var(--accent); }
  #convList li.rail-sep { width: 22px; height: 1px; padding: 0; background: var(--line); margin: 4px 0; cursor: default; }
  .rail-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 0.85em; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
  .flyout { position: fixed; left: 72px; top: 36px; bottom: 12px; width: 280px; z-index: 8; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); padding: 14px 8px; display: flex; flex-direction: column; animation: popIn 0.25s var(--ease); }
  .flyout .fo-head { display: flex; justify-content: space-between; padding: 0 8px 8px; }
  .flyout .fo-list { list-style: none; margin: 0; padding: 0; overflow-y: auto; }
  .flyout .fo-list li { position: relative; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 12px; cursor: pointer; font-size: 0.92em; }
  .flyout .fo-list li .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .flyout .fo-list li .muted { font-size: 0.75em; }
  .flyout .fo-list li:hover, .flyout .fo-list li.active { background: var(--surface-2); }

  /* --- 검색 창 (목록 숨김) --- */
  :root[data-list="spotlight"] #app { grid-template-columns: 1fr auto; }
  :root[data-list="spotlight"] #sidebar { display: none; }
  :root[data-list="spotlight"] .palette-btn { display: inline-grid; }
}
.palette-wrap { position: fixed; inset: 0; z-index: 20; display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh; background: rgba(0, 0, 0, 0.25); animation: fade 0.15s ease; }
.palette { width: min(560px, 90vw); background: var(--surface); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); overflow: hidden; animation: popIn 0.22s var(--ease); }
.palette input { width: 100%; border: none; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; padding: 16px 20px; font-size: 1.05em; }
.palette .pl-body { max-height: 52vh; overflow-y: auto; padding: 6px; }
.palette .pl-sec { font-size: 0.72em; color: var(--muted); padding: 10px 12px 4px; }
.palette .pl-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; text-align: left; }
.palette .pl-row svg { width: 16px; height: 16px; color: var(--muted); }
.palette .pl-row .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette .pl-row .muted { font-size: 0.78em; }
.palette .pl-row:hover, .palette .pl-row:focus { background: var(--surface-2); outline: none; }
.palette .pl-dot { width: 9px; height: 9px; border-radius: 50%; margin: 0 4px; }
:root.glass .flyout, :root.glass .palette { background: var(--glass-sheet); }

/* 위쪽 도구 (검색 · 목록 펼치기 · 새 대화) */
.side-tools { display: inline-flex; align-items: center; gap: 2px; -webkit-app-region: no-drag; }
.side-tools .icon-btn { width: 28px; height: 28px; }
.side-tools .icon-btn svg { width: 16px; height: 16px; }
@media (min-width: 721px) {
  :root[data-list="rail"] .side-tools { flex-direction: column; gap: 4px; }
  :root[data-list="rail"] .side-tools .icon-btn { width: 36px; height: 36px; }
  :root[data-list="rail-open"] #app { grid-template-columns: var(--side-w, 260px) 1fr auto; }
  :root[data-list="spotlight"] #searchBtn { display: none; }
}
/* 펼침 패널은 내용만큼만 (길면 스크롤) */
@media (min-width: 721px) {
  .flyout { bottom: auto; max-height: calc(100vh - 60px); }
}
/* 아이콘 줄 폭: 창 버튼(빨강·노랑·초록)이 줄 안에 들어오게 넓힌다 */
@media (min-width: 721px) {
  :root[data-list="rail"] #app { grid-template-columns: 84px 1fr auto; }
  :root[data-list="rail"] #sidebar { padding: 44px 0 10px; }
  .flyout { left: 92px; }
}

/* 프로젝트 아이콘·색 고르기 */
.pj-look { display: flex; align-items: center; gap: 10px; margin: -6px 0 12px; flex-wrap: wrap; }
.pj-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.05em; flex: none; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); }
.pj-look #pjIcon { width: 80px; text-align: center; }
.pj-colors { display: flex; gap: 6px; }
.pj-colors button { width: 22px; height: 22px; border-radius: 50%; border: 2px solid transparent; transition: transform 0.15s var(--ease); }
.pj-colors button:hover { transform: scale(1.12); }
.pj-colors button.on { border-color: var(--text); }
.pj-look input[type="color"] { width: 30px; height: 26px; padding: 1px; border-radius: 8px; }
#convList li.sec.proj .pj.emoji { font-size: 13px; width: 14px; text-align: center; }
.pj-icon.sm { width: 28px; height: 28px; font-size: 0.85em; margin-bottom: 4px; }

/* ---------- 프로젝트 아이콘 ---------- */
.ic-badge { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; line-height: 1; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 1px 4px rgba(0, 0, 0, 0.2); }
.ic-badge svg { display: block; }
#convList li.rail-btn .ic-badge { box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
#convList li.sec.proj .pj { display: inline-grid; }
.pj-icon-btn { padding: 0; border-radius: 50%; transition: transform 0.2s var(--ease); }
.pj-icon-btn:hover { transform: scale(1.06); }
.pj-card .ic-badge { margin-bottom: 4px; }

/* 아이콘 고르기 창 */
.ip-wrap { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(0, 0, 0, 0.3); animation: fade 0.15s ease; }
.ip { width: min(420px, 92vw); height: min(640px, 88vh); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45); overflow: hidden; animation: popIn 0.22s var(--ease); }
:root.glass .ip { background: var(--glass-sheet); }
.ip-head { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 16px 10px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent); }
.ip-head .ic-badge { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3); }
.ip-colors { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 6px 16px 12px; }
.ip-colors button, .ip-custom { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; transition: transform 0.15s var(--ease); }
.ip-colors button:hover, .ip-custom:hover { transform: scale(1.12); }
.ip-colors button.on { border-color: var(--text); }
.ip-none { background: conic-gradient(#ff453a, #ffd60a, #30d158, #0a84ff, #bf5af2, #ff453a); }
.ip-custom { display: grid; place-items: center; background: var(--surface-3); color: var(--text); cursor: pointer; font-size: 16px; position: relative; overflow: hidden; }
.ip-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ip-search { margin: 0 14px 8px; }
.ip-body { flex: 1; overflow-y: auto; padding: 0 12px 12px; }
.ip-body h4 { margin: 12px 4px 6px; font-size: 0.8em; color: var(--muted); font-weight: 600; position: sticky; top: 0; background: inherit; }
.ip-body section { content-visibility: auto; contain-intrinsic-size: 400px; }
.ip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.ip-cell { height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); transition: background 0.12s, color 0.12s; }
.ip-cell:hover { background: var(--surface-2); color: var(--text); }
.ip-cell.on { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent); }
.ip-grid.emoji .ip-cell { font-size: 21px; }
.ip-loading { padding: 30px; text-align: center; color: var(--muted); }
.ip-foot { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.ip-foot .ip-clear { flex: 1; padding: 7px; border-radius: 12px; background: var(--surface-2); color: var(--muted); }
.ip-tabs { flex: 1.4; display: flex; gap: 4px; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.ip-tabs button { flex: 1; padding: 5px; border-radius: 9px; color: var(--muted); }
.ip-tabs button.on { background: var(--accent); color: #fff; }

/* 끌어서 순서 바꾸기 */
[data-sort-id].dragging { opacity: 0.4; }
[data-sort-id].drop-before { box-shadow: inset 0 2px 0 var(--accent); }
[data-sort-id].drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.pj-grid [data-sort-id].drop-before { box-shadow: inset 3px 0 0 var(--accent); }
.pj-grid [data-sort-id].drop-after { box-shadow: inset -3px 0 0 var(--accent); }

.isl-items.off { opacity: 0.45; pointer-events: none; }

/* iMessage 탭 */
#navImessage { position: relative; }
#navImessage.active { background: var(--surface); color: var(--text); }
#navImessage .dot { display: none; width: 7px; height: 7px; border-radius: 50%; background: #30d158; margin-left: auto; }
#navImessage.unread .dot { display: block; }
:root[data-list="rail"] #navImessage .dot { position: absolute; top: 6px; right: 6px; margin: 0; }
.msg.user.via-im .bubble { background: #1f7a3d; color: #fff; }
.msg.user.via-im .meta svg { vertical-align: -1px; }

.isl-city { width: 150px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 0.9em; text-align: right; }
.isl-city:disabled { opacity: 0.5; }

.isl-w { gap: 8px; cursor: grab; }
.isl-w .grip { color: var(--muted); font-size: 11px; letter-spacing: -2px; }
.isl-w .t { flex: 1; }
.isl-w svg { opacity: 0.7; }
.card-title .small { font-weight: 400; margin-left: 6px; }

/* 대답하는 동안 도는 행성 */
.orbit-loader { display: flex; align-items: center; height: 34px; margin: 2px 0 4px; color: var(--muted); }
.orbit-loader .sun { animation: orbit-glow 1.6s ease-in-out infinite; transform-origin: 32px 32px; }
@keyframes orbit-glow { 50% { opacity: 0.75; transform: scale(0.9); } }
.msg.assistant .bubble.typing:empty { display: none; }

/* ---------- 네뷸라 · 종이 · 오로라 · 모노 ---------- */
:root[data-theme="nebula"] {
  --bg: #0b0614; --surface: #150d22; --surface-2: #1d1330; --surface-3: #291a42;
  --line: rgba(230,150,255,0.11); --text: #f6ecff; --muted: #a593bd; --user: #2a1740; --code: #110a1c;
  --ok: #7fe0c4; --warn: #ffc46b; --bad: #ff6f8f;
  --add: color-mix(in srgb, #7fe0c4 12%, transparent); --del: color-mix(in srgb, #ff6f8f 12%, transparent);
}
:root[data-theme="nebula-light"] {
  --bg: #fbf4ff; --surface: #fffaff; --surface-2: #f3e8fb; --surface-3: #e8d7f5;
  --line: rgba(110,40,150,0.12); --text: #2a1238; --muted: #7d6890; --user: #f3dcfb; --code: #f5ecfb;
  --ok: #1f9a7a; --warn: #b97700; --bad: #d1365a;
  --add: color-mix(in srgb, #1f9a7a 12%, transparent); --del: color-mix(in srgb, #d1365a 12%, transparent);
}
:root[data-theme="aurora"] {
  --bg: #04100f; --surface: #0a1a1a; --surface-2: #0f2423; --surface-3: #16302e;
  --line: rgba(120,255,210,0.1); --text: #e6fff6; --muted: #86a8a0; --user: #0f2b26; --code: #071413;
  --ok: #5ef0b5; --warn: #ffd27a; --bad: #ff7a8a;
  --add: color-mix(in srgb, #5ef0b5 12%, transparent); --del: color-mix(in srgb, #ff7a8a 12%, transparent);
}
:root[data-theme="aurora-light"] {
  --bg: #eefaf6; --surface: #f8fffc; --surface-2: #e2f4ee; --surface-3: #cfeae1;
  --line: rgba(20,110,90,0.14); --text: #0d2a24; --muted: #5c7f77; --user: #d6f3ea; --code: #e6f5f0;
  --ok: #0f9a6e; --warn: #b97700; --bad: #d1365a;
  --add: color-mix(in srgb, #0f9a6e 12%, transparent); --del: color-mix(in srgb, #d1365a 12%, transparent);
}
:root[data-theme="mono"] {
  --bg: #0a0a0a; --surface: #141414; --surface-2: #1c1c1c; --surface-3: #262626;
  --line: rgba(255,255,255,0.1); --text: #f5f5f5; --muted: #8a8a8a; --user: #1f1f1f; --code: #111111;
  --ok: #d6d6d6; --warn: #e6e6e6; --bad: #ff6b6b;
  --add: color-mix(in srgb, #d6d6d6 12%, transparent); --del: color-mix(in srgb, #ff6b6b 12%, transparent);
}
:root[data-theme="mono-light"] {
  --bg: #ffffff; --surface: #fafafa; --surface-2: #f0f0f0; --surface-3: #e4e4e4;
  --line: rgba(0,0,0,0.1); --text: #0a0a0a; --muted: #6b6b6b; --user: #f0f0f0; --code: #f4f4f4;
  --ok: #2b2b2b; --warn: #3a3a3a; --bad: #d12f2f;
  --add: color-mix(in srgb, #2b2b2b 12%, transparent); --del: color-mix(in srgb, #d12f2f 12%, transparent);
}
:root[data-theme="nebula"] #sidebar, :root[data-theme="nebula-light"] #sidebar,
:root[data-theme="aurora"] #sidebar, :root[data-theme="aurora-light"] #sidebar,
:root[data-theme="nebula"] #settingsNav, :root[data-theme="nebula-light"] #settingsNav,
:root[data-theme="aurora"] #settingsNav, :root[data-theme="aurora-light"] #settingsNav { background: transparent; }

/* 네뷸라: 성운 빛 + 반짝이는 별가루 */
:root[data-theme="nebula"] body {
  background:
    radial-gradient(1.2px 1.2px at 12% 18%, #fff 50%, transparent 51%) 0 0 / 240px 240px,
    radial-gradient(1px 1px at 63% 72%, #ffd6f5 50%, transparent 51%) 0 0 / 190px 190px,
    radial-gradient(1px 1px at 38% 44%, #cfd8ff 50%, transparent 51%) 0 0 / 310px 310px,
    radial-gradient(800px 520px at 82% 8%, rgba(255, 111, 216, 0.2), transparent 62%),
    radial-gradient(900px 600px at 10% 30%, rgba(124, 92, 255, 0.2), transparent 62%),
    radial-gradient(900px 600px at 55% 110%, rgba(64, 132, 255, 0.16), transparent 62%),
    #0b0614;
  background-attachment: fixed;
}
:root[data-theme="nebula-light"] body {
  background:
    radial-gradient(800px 520px at 82% 8%, rgba(255, 111, 216, 0.22), transparent 62%),
    radial-gradient(900px 600px at 10% 30%, rgba(150, 120, 255, 0.2), transparent 62%),
    radial-gradient(900px 600px at 55% 110%, rgba(100, 160, 255, 0.16), transparent 62%),
    #fbf4ff;
  background-attachment: fixed;
}
:root[data-theme^="nebula"] .empty-title { background: linear-gradient(90deg, #ff8ae2, #b49bff 50%, #7fb8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme^="nebula"] .empty-mark svg { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--accent) 55%, transparent)); }
:root[data-theme="nebula"] #composer { box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55), 0 0 50px rgba(255, 111, 216, 0.08); }
:root[data-theme="nebula-light"] .send, :root[data-theme="mono-light"] .send { color: #fff; }

/* 오로라: 하늘 위쪽에 일렁이는 빛 띠 */
:root[data-theme="aurora"] body {
  background:
    radial-gradient(60% 40% at 20% 0%, rgba(94, 240, 181, 0.18), transparent 70%),
    radial-gradient(50% 35% at 55% 5%, rgba(64, 200, 255, 0.14), transparent 70%),
    radial-gradient(45% 35% at 85% 0%, rgba(160, 110, 255, 0.14), transparent 70%),
    linear-gradient(180deg, #061816 0%, #04100f 55%);
  background-attachment: fixed;
}
:root[data-theme="aurora-light"] body {
  background:
    radial-gradient(60% 40% at 20% 0%, rgba(15, 169, 122, 0.18), transparent 70%),
    radial-gradient(50% 35% at 55% 5%, rgba(40, 170, 230, 0.14), transparent 70%),
    radial-gradient(45% 35% at 85% 0%, rgba(140, 100, 240, 0.12), transparent 70%),
    #eefaf6;
  background-attachment: fixed;
}
:root[data-theme^="aurora"] #main::before {
  content: ""; position: fixed; inset: -10% -10% auto -10%; height: 55vh; pointer-events: none; z-index: 0;
  background: linear-gradient(100deg, transparent 10%, color-mix(in srgb, var(--accent) 16%, transparent) 30%, rgba(64, 200, 255, 0.1) 50%, rgba(160, 110, 255, 0.12) 70%, transparent 90%);
  filter: blur(40px); opacity: 0.8; animation: auroraWave 14s ease-in-out infinite alternate;
}
:root[data-theme^="aurora"] #messages, :root[data-theme^="aurora"] #island, :root[data-theme^="aurora"] .drag-strip { position: relative; z-index: 1; }
@keyframes auroraWave { from { transform: translateX(-4%) skewY(-3deg); } to { transform: translateX(4%) skewY(2deg); } }
:root[data-theme^="aurora"] #composer { backdrop-filter: blur(10px); background: color-mix(in srgb, var(--surface) 75%, transparent); }

/* 모노: 흑백, 굵은 글씨, 넓은 여백, 장식 없음 */
:root[data-theme^="mono"] .empty-title { font-size: 2.2em; font-weight: 800; letter-spacing: -0.03em; }
:root[data-theme^="mono"] .brand { font-weight: 800; letter-spacing: -0.02em; }
:root[data-theme^="mono"] .msg { margin-bottom: 26px; }
:root[data-theme^="mono"] .msg.user .bubble { background: transparent; border: 1.5px solid var(--text); border-radius: 18px; }
:root[data-theme^="mono"] #composer { border: 1.5px solid var(--text); box-shadow: none; border-radius: 14px; }
:root[data-theme^="mono"] #composer:focus-within { box-shadow: 4px 4px 0 var(--text); }
:root[data-theme^="mono"] .card { box-shadow: none; border: 1.5px solid var(--line); }
:root[data-theme^="mono"] .vision-mark .sun { fill: var(--text); }

/* 궤도 색 고르기 */
.orbit-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 2px 4px; }
.orbit-colors .oc-t { color: var(--muted); font-size: 0.86em; margin-right: 4px; }
.orbit-colors .oc { display: flex; align-items: center; gap: 7px; padding: 6px 12px 6px 7px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 0.88em; transition: transform 0.15s, border-color 0.2s; }
.orbit-colors .oc .oc-ico { width: 20px; height: 20px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }
.orbit-colors .oc:hover { transform: translateY(-1px); }
.orbit-colors .oc.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }


/* 설정 묶음 부제목: 맥 시스템 설정처럼 굵은 소제목 아래에 둥근 묶음 카드 */
.sub-pane { display: contents; }
.sub-h { font-weight: 700; font-size: 0.95em; color: var(--text); margin: 26px 6px 8px; letter-spacing: -0.01em; }
.stab > .sub-pane:first-of-type > .section-h:first-child { margin-top: 2px; }
#settingsBody .card { padding: 10px 16px; border-radius: 12px; margin-bottom: 10px; }
#settingsBody .field { padding: 9px 0; min-height: 26px; }
#settingsBody .card-title { padding-top: 4px; }

/* 대답 중에 보내서 차례를 기다리는 메시지 */
.msg.user.queued { opacity: 0.55; }
.msg.user.queued::after { content: "대기"; display: block; text-align: right; font-size: 0.75em; color: var(--muted); margin-top: 3px; }

/* 파일·아티팩트 크게 보기: 앱 창 안에서 옆 창을 전체로 */
#sheet.art-full { position: fixed; top: 0; right: 0; bottom: 0; left: 0; width: auto !important; height: 100vh; z-index: 60; animation: none; }
.msg.user.added::after { content: "답에 더함"; display: block; text-align: right; font-size: 0.75em; color: var(--muted); margin-top: 3px; }

/* 우클릭 메뉴 */
.ctx-menu { position: fixed; z-index: 100; min-width: 190px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); display: flex; flex-direction: column; gap: 2px; animation: popIn 0.16s var(--ease); }
.ctx-menu button { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; background: none; border: 0; color: var(--text); font-size: 0.92em; text-align: left; }
.ctx-menu button svg { width: 15px; height: 15px; opacity: 0.75; flex: none; }
.ctx-menu button:hover:not(:disabled) { background: var(--surface-2); }
.ctx-menu button:disabled { opacity: 0.4; }
.ctx-menu button.danger { color: var(--bad); }
.ctx-menu button.danger svg { opacity: 1; }

/* 궤도 색: 화성 · 루나 · 일식 */
:root[data-theme="mars"] {
  --bg: #120807; --surface: #1d0f0c; --surface-2: #2a1612; --surface-3: #3a1d17;
  --line: rgba(255,140,100,0.12); --text: #f7e9e2; --muted: #a88a80; --user: #3a1a14; --code: #160b09;
  --ok: #8fe0a6; --warn: #ff6b3d; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="mars"] body { background: radial-gradient(1200px 700px at 50% -10%, #3a1610 0%, #120807 60%) fixed; }
:root[data-theme="mars"] #sidebar, :root[data-theme="mars"] #settingsNav { background: transparent; }
:root[data-theme="mars-light"] {
  --bg: #f6ebe3; --surface: #fff6f0; --surface-2: #efdccf; --surface-3: #e5ccbb;
  --line: rgba(120,50,20,0.1); --text: #2a1510; --muted: #8a6a5e; --user: #f5d3c2; --code: #f3e4d9;
  --ok: #2f9a5a; --warn: #d9481f; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="mars-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #f6c9ad 0%, #f6ebe3 60%) fixed; }
:root[data-theme="mars-light"] #sidebar, :root[data-theme="mars-light"] #settingsNav { background: transparent; }
:root[data-theme="luna"] {
  --bg: #0b0d11; --surface: #14171d; --surface-2: #1d2129; --surface-3: #272c36;
  --line: rgba(220,230,255,0.09); --text: #eef1f6; --muted: #8b93a3; --user: #232833; --code: #0f1216;
  --ok: #8fe0a6; --warn: #c9d4e8; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="luna"] body { background: radial-gradient(1200px 700px at 50% -10%, #22262f 0%, #0b0d11 60%) fixed; }
:root[data-theme="luna"] #sidebar, :root[data-theme="luna"] #settingsNav { background: transparent; }
:root[data-theme="luna-light"] {
  --bg: #eef0f4; --surface: #fafbfc; --surface-2: #e3e6ec; --surface-3: #d5dae2;
  --line: rgba(30,40,60,0.1); --text: #1a1e26; --muted: #6c7483; --user: #dde2ea; --code: #e8ebf0;
  --ok: #2f9a5a; --warn: #5a6a86; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="luna-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #ffffff 0%, #eef0f4 60%) fixed; }
:root[data-theme="luna-light"] #sidebar, :root[data-theme="luna-light"] #settingsNav { background: transparent; }
:root[data-theme="eclipse"] {
  --bg: #000000; --surface: #0b0b0b; --surface-2: #151515; --surface-3: #1f1f1f;
  --line: rgba(255,210,120,0.12); --text: #f6efe0; --muted: #948b78; --user: #1d1a12; --code: #080808;
  --ok: #8fe0a6; --warn: #ffcf5a; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="eclipse"] body { background: radial-gradient(1200px 700px at 50% -10%, #2a1f08 0%, #000000 60%) fixed; }
:root[data-theme="eclipse"] #sidebar, :root[data-theme="eclipse"] #settingsNav { background: transparent; }
:root[data-theme="eclipse-light"] {
  --bg: #f8f4ea; --surface: #fffcf4; --surface-2: #efe6d2; --surface-3: #e4d8bd;
  --line: rgba(90,70,20,0.12); --text: #1c170c; --muted: #7d735e; --user: #f3e4bd; --code: #f1ead8;
  --ok: #2f9a5a; --warn: #b8860b; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="eclipse-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #ffe6a6 0%, #f8f4ea 60%) fixed; }
:root[data-theme="eclipse-light"] #sidebar, :root[data-theme="eclipse-light"] #settingsNav { background: transparent; }
:root[data-theme="eclipse"] .empty-mark svg { filter: drop-shadow(0 0 16px rgba(255, 207, 90, 0.45)); }
:root[data-theme="luna-light"] .send, :root[data-theme="eclipse-light"] .send { color: #fff; }
:root[data-theme="eclipse"] .send, :root[data-theme="luna"] .send { color: #111; }

/* 파일 카드 미리보기 */
.af-card { padding-top: 10px; }
.af-thumb { position: relative; height: 132px; margin: 0 -6px 6px; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--line); pointer-events: none; }
.af-thumb iframe { position: absolute; top: 0; left: 0; width: 1000px; height: 640px; border: 0; transform: scale(0.24); transform-origin: 0 0; background: #fff; }

/* Vision 할 일 목록 카드 */
.plan-card { border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 10px 14px; margin: 2px 0 10px; display: flex; flex-direction: column; gap: 7px; max-width: 560px; }
.plan-card .pl { display: flex; align-items: center; gap: 10px; font-size: 0.93em; color: var(--muted); }
.plan-card .pl i { width: 15px; height: 15px; border-radius: 50%; border: 1.5px dashed var(--muted); flex: none; box-sizing: border-box; }
.plan-card .pl.doing { color: var(--text); }
.plan-card .pl.doing i { border: 2px solid color-mix(in srgb, var(--accent) 25%, transparent); border-top-color: var(--accent); animation: spin 0.9s linear infinite; }
.plan-card .pl.done span { text-decoration: line-through; opacity: 0.75; }
.plan-card .pl.done i { border: 0; background: var(--accent); -webkit-mask: none; position: relative; }
.plan-card .pl.done i::after { content: ""; position: absolute; left: 4.5px; top: 2px; width: 4px; height: 8px; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); }

/* 궤도 색: 토성 · 금성 · 블랙홀 · 유로파 */
:root[data-theme="saturn"] {
  --bg: #100c06; --surface: #1b150c; --surface-2: #271e11; --surface-3: #352915;
  --line: rgba(255,220,150,0.12); --text: #f8efdc; --muted: #a8987a; --user: #2f2414; --code: #140f08;
  --ok: #8fe0a6; --warn: #f2c46d; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="saturn"] body { background: radial-gradient(1200px 700px at 50% -10%, #33260f 0%, #100c06 60%) fixed; }
:root[data-theme="saturn"] #sidebar, :root[data-theme="saturn"] #settingsNav { background: transparent; }
:root[data-theme="saturn-light"] {
  --bg: #f8f1e2; --surface: #fffaf0; --surface-2: #efe3c9; --surface-3: #e3d3b0;
  --line: rgba(110,80,20,0.12); --text: #2a2010; --muted: #857558; --user: #f1dfb5; --code: #f2e8d3;
  --ok: #2f9a5a; --warn: #b07a1e; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="saturn-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #f6dfae 0%, #f8f1e2 60%) fixed; }
:root[data-theme="saturn-light"] #sidebar, :root[data-theme="saturn-light"] #settingsNav { background: transparent; }
:root[data-theme="venus"] {
  --bg: #120e10; --surface: #1c1618; --surface-2: #272022; --surface-3: #342a2d;
  --line: rgba(255,220,210,0.1); --text: #fbf1ee; --muted: #ad9a97; --user: #33272a; --code: #151012;
  --ok: #8fe0a6; --warn: #f4c7b8; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="venus"] body { background: radial-gradient(1200px 700px at 50% -10%, #3a2a2c 0%, #120e10 60%) fixed; }
:root[data-theme="venus"] #sidebar, :root[data-theme="venus"] #settingsNav { background: transparent; }
:root[data-theme="venus-light"] {
  --bg: #fbf6f3; --surface: #fffdfb; --surface-2: #f3e8e3; --surface-3: #e8d8d1;
  --line: rgba(110,60,50,0.1); --text: #2b1f1c; --muted: #8f7c77; --user: #f6e1d7; --code: #f5ece8;
  --ok: #2f9a5a; --warn: #c9826b; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="venus-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #ffe7dc 0%, #fbf6f3 60%) fixed; }
:root[data-theme="venus-light"] #sidebar, :root[data-theme="venus-light"] #settingsNav { background: transparent; }
:root[data-theme="blackhole"] {
  --bg: #030206; --surface: #0c0812; --surface-2: #150f1e; --surface-3: #201830;
  --line: rgba(200,150,255,0.12); --text: #f2ecff; --muted: #9a8fb0; --user: #1e1430; --code: #08060c;
  --ok: #8fe0a6; --warn: #b98cff; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="blackhole"] body { background: radial-gradient(1200px 700px at 50% -10%, #2a1240 0%, #030206 60%) fixed; }
:root[data-theme="blackhole"] #sidebar, :root[data-theme="blackhole"] #settingsNav { background: transparent; }
:root[data-theme="blackhole-light"] {
  --bg: #f4f0fa; --surface: #fcfaff; --surface-2: #e9e2f5; --surface-3: #dbd0ee;
  --line: rgba(60,30,110,0.1); --text: #1a1228; --muted: #73688a; --user: #e3d7f8; --code: #ede7f7;
  --ok: #2f9a5a; --warn: #7b4fd6; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="blackhole-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #e5d6ff 0%, #f4f0fa 60%) fixed; }
:root[data-theme="blackhole-light"] #sidebar, :root[data-theme="blackhole-light"] #settingsNav { background: transparent; }
:root[data-theme="europa"] {
  --bg: #060b10; --surface: #0d1620; --surface-2: #14202c; --surface-3: #1d2c3b;
  --line: rgba(170,220,255,0.1); --text: #eaf5fb; --muted: #8aa2b0; --user: #16293a; --code: #09121a;
  --ok: #8fe0a6; --warn: #9fd8f5; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="europa"] body { background: radial-gradient(1200px 700px at 50% -10%, #16303f 0%, #060b10 60%) fixed; }
:root[data-theme="europa"] #sidebar, :root[data-theme="europa"] #settingsNav { background: transparent; }
:root[data-theme="europa-light"] {
  --bg: #eef6fa; --surface: #fbfeff; --surface-2: #ddeaf1; --surface-3: #cbdde7;
  --line: rgba(20,60,90,0.1); --text: #10212b; --muted: #62808f; --user: #d6e9f3; --code: #e5f0f6;
  --ok: #2f9a5a; --warn: #3c8db5; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="europa-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #d3ecf7 0%, #eef6fa 60%) fixed; }
:root[data-theme="europa-light"] #sidebar, :root[data-theme="europa-light"] #settingsNav { background: transparent; }
:root[data-theme="blackhole"] .empty-mark svg { filter: drop-shadow(0 0 16px rgba(185, 140, 255, 0.5)); }
:root[data-theme="saturn"] .send, :root[data-theme="venus"] .send, :root[data-theme="europa"] .send { color: #111; }
:root[data-theme="saturn-light"] .send, :root[data-theme="venus-light"] .send, :root[data-theme="blackhole-light"] .send, :root[data-theme="europa-light"] .send { color: #fff; }

/* 태양계 시리즈 */
:root[data-theme="sol-mercury"] {
  --bg: #0b0a08; --surface: #16140f; --surface-2: #23211c; --surface-3: #312e29;
  --line: color-mix(in srgb, #ffd27a 14%, transparent); --text: #f4efe4; --muted: #928f88; --user: #3b3220; --code: #12100c;
  --ok: #8fe0a6; --warn: #ffd27a; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-mercury"] body { background: radial-gradient(1200px 700px at 50% -10%, #1d1a14 0%, #0b0a08 60%) fixed; }
:root[data-theme="sol-mercury-light"] {
  --bg: #fbf7ef; --surface: #fffefb; --surface-2: #fbf3e3; --surface-3: #fcf0da;
  --line: color-mix(in srgb, #b89758 14%, transparent); --text: #312a26; --muted: #8c8680; --user: #fcf0d8; --code: #fbf3e3;
  --ok: #2f9a5a; --warn: #b89758; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-mercury-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #fceed2 0%, #fbf7ef 60%) fixed; }
:root[data-theme="sol-mercury"] #sidebar, :root[data-theme="sol-mercury"] #settingsNav, :root[data-theme="sol-mercury-light"] #sidebar, :root[data-theme="sol-mercury-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-mercury"] .send { color: #0b0a08; }
:root[data-theme="sol-mercury-light"] .send { color: #fff; }
:root[data-theme="sol-venus"] {
  --bg: #100c07; --surface: #1b150c; --surface-2: #282219; --surface-3: #362f25;
  --line: color-mix(in srgb, #f1c27d 14%, transparent); --text: #fbf1de; --muted: #989184; --user: #3d311e; --code: #17110a;
  --ok: #8fe0a6; --warn: #f1c27d; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-venus"] body { background: radial-gradient(1200px 700px at 50% -10%, #2a2214 0%, #100c07 60%) fixed; }
:root[data-theme="sol-venus-light"] {
  --bg: #faf6ef; --surface: #fffdfb; --surface-2: #f9f1e4; --surface-3: #f8edda;
  --line: color-mix(in srgb, #ae8c5a 14%, transparent); --text: #2f2826; --muted: #8a8580; --user: #f8ecd8; --code: #f9f1e4;
  --ok: #2f9a5a; --warn: #ae8c5a; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-venus-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #f8e9d2 0%, #faf6ef 60%) fixed; }
:root[data-theme="sol-venus"] #sidebar, :root[data-theme="sol-venus"] #settingsNav, :root[data-theme="sol-venus-light"] #sidebar, :root[data-theme="sol-venus-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-venus"] .send { color: #100c07; }
:root[data-theme="sol-venus-light"] .send { color: #fff; }
:root[data-theme="sol-earth"] {
  --bg: #050a14; --surface: #0c1628; --surface-2: #192335; --surface-3: #273142;
  --line: color-mix(in srgb, #4aa3ff 14%, transparent); --text: #eaf3ff; --muted: #8a919c; --user: #162d4a; --code: #091120;
  --ok: #8fe0a6; --warn: #4aa3ff; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-earth"] body { background: radial-gradient(1200px 700px at 50% -10%, #0f2140 0%, #050a14 60%) fixed; }
:root[data-theme="sol-earth-light"] {
  --bg: #eff4f8; --surface: #fafcff; --surface-2: #deecf9; --surface-3: #d1e5f9;
  --line: color-mix(in srgb, #3575b8 14%, transparent); --text: #1b2435; --muted: #7a828d; --user: #cee4f9; --code: #deecf9;
  --ok: #2f9a5a; --warn: #3575b8; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-earth-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #c6e0fa 0%, #eff4f8 60%) fixed; }
:root[data-theme="sol-earth"] #sidebar, :root[data-theme="sol-earth"] #settingsNav, :root[data-theme="sol-earth-light"] #sidebar, :root[data-theme="sol-earth-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-earth"] .send { color: #050a14; }
:root[data-theme="sol-earth-light"] .send { color: #fff; }
:root[data-theme="sol-mars"] {
  --bg: #120807; --surface: #1d0f0c; --surface-2: #2a1c19; --surface-3: #372926;
  --line: color-mix(in srgb, #ff6b3d 14%, transparent); --text: #f7e9e2; --muted: #978a86; --user: #411e14; --code: #190c0a;
  --ok: #8fe0a6; --warn: #ff6b3d; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-mars"] body { background: radial-gradient(1200px 700px at 50% -10%, #3a1610 0%, #120807 60%) fixed; }
:root[data-theme="sol-mars-light"] {
  --bg: #fbf0eb; --surface: #fffbf9; --surface-2: #fbe3da; --surface-3: #fcd8cc;
  --line: color-mix(in srgb, #b84d2c 14%, transparent); --text: #311e1e; --muted: #8c7c7a; --user: #fcd5c8; --code: #fbe3da;
  --ok: #2f9a5a; --warn: #b84d2c; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-mars-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #fccfc0 0%, #fbf0eb 60%) fixed; }
:root[data-theme="sol-mars"] #sidebar, :root[data-theme="sol-mars"] #settingsNav, :root[data-theme="sol-mars-light"] #sidebar, :root[data-theme="sol-mars-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-mars"] .send { color: #120807; }
:root[data-theme="sol-mars-light"] .send { color: #fff; }
:root[data-theme="sol-asteroid"] {
  --bg: #0c0a08; --surface: #17130e; --surface-2: #24201b; --surface-3: #312d27;
  --line: color-mix(in srgb, #c8a27a 14%, transparent); --text: #f1e9df; --muted: #918b85; --user: #332a1f; --code: #130f0c;
  --ok: #8fe0a6; --warn: #c8a27a; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-asteroid"] body { background: radial-gradient(1200px 700px at 50% -10%, #241c14 0%, #0c0a08 60%) fixed; }
:root[data-theme="sol-asteroid-light"] {
  --bg: #f7f4ef; --surface: #fdfcfb; --surface-2: #f2ece3; --surface-3: #efe5da;
  --line: color-mix(in srgb, #907558 14%, transparent); --text: #2a2426; --muted: #868280; --user: #eee4d8; --code: #f2ece3;
  --ok: #2f9a5a; --warn: #907558; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-asteroid-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #ebe0d2 0%, #f7f4ef 60%) fixed; }
:root[data-theme="sol-asteroid"] #sidebar, :root[data-theme="sol-asteroid"] #settingsNav, :root[data-theme="sol-asteroid-light"] #sidebar, :root[data-theme="sol-asteroid-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-asteroid"] .send { color: #0c0a08; }
:root[data-theme="sol-asteroid-light"] .send { color: #fff; }
:root[data-theme="sol-jupiter"] {
  --bg: #0e0a06; --surface: #1a130c; --surface-2: #272019; --surface-3: #352d26;
  --line: color-mix(in srgb, #e0a96d 14%, transparent); --text: #f8eee2; --muted: #968e86; --user: #3a2b1c; --code: #150f0a;
  --ok: #8fe0a6; --warn: #e0a96d; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-jupiter"] body { background: radial-gradient(1200px 700px at 50% -10%, #2e2014 0%, #0e0a06 60%) fixed; }
:root[data-theme="sol-jupiter-light"] {
  --bg: #f9f4ee; --surface: #fefcfb; --surface-2: #f6ece1; --surface-3: #f4e6d7;
  --line: color-mix(in srgb, #a17a4e 14%, transparent); --text: #2d2524; --muted: #89827f; --user: #f4e5d4; --code: #f6ece1;
  --ok: #2f9a5a; --warn: #a17a4e; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-jupiter-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #f3e1ce 0%, #f9f4ee 60%) fixed; }
:root[data-theme="sol-jupiter"] #sidebar, :root[data-theme="sol-jupiter"] #settingsNav, :root[data-theme="sol-jupiter-light"] #sidebar, :root[data-theme="sol-jupiter-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-jupiter"] .send { color: #0e0a06; }
:root[data-theme="sol-jupiter-light"] .send { color: #fff; }
:root[data-theme="sol-saturn"] {
  --bg: #100c06; --surface: #1b150c; --surface-2: #282218; --surface-3: #362f25;
  --line: color-mix(in srgb, #f2c46d 14%, transparent); --text: #f8efdc; --muted: #979082; --user: #3d311c; --code: #17110a;
  --ok: #8fe0a6; --warn: #f2c46d; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-saturn"] body { background: radial-gradient(1200px 700px at 50% -10%, #33260f 0%, #100c06 60%) fixed; }
:root[data-theme="sol-saturn-light"] {
  --bg: #faf6ee; --surface: #fffdfb; --surface-2: #f9f1e1; --surface-3: #f9edd7;
  --line: color-mix(in srgb, #ae8d4e 14%, transparent); --text: #302824; --muted: #8b857f; --user: #f8ecd4; --code: #f9f1e1;
  --ok: #2f9a5a; --warn: #ae8d4e; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-saturn-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #f8eace 0%, #faf6ee 60%) fixed; }
:root[data-theme="sol-saturn"] #sidebar, :root[data-theme="sol-saturn"] #settingsNav, :root[data-theme="sol-saturn-light"] #sidebar, :root[data-theme="sol-saturn-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-saturn"] .send { color: #100c06; }
:root[data-theme="sol-saturn-light"] .send { color: #fff; }
:root[data-theme="sol-uranus"] {
  --bg: #05100f; --surface: #0b1c1f; --surface-2: #18292c; --surface-3: #263739;
  --line: color-mix(in srgb, #7fe3e6 14%, transparent); --text: #e8fbfb; --muted: #899898; --user: #1e3c3f; --code: #091719;
  --ok: #8fe0a6; --warn: #7fe3e6; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-uranus"] body { background: radial-gradient(1200px 700px at 50% -10%, #0f2b30 0%, #05100f 60%) fixed; }
:root[data-theme="sol-uranus-light"] {
  --bg: #f2f8f7; --surface: #fbfefe; --surface-2: #e6f6f5; --surface-3: #ddf4f4;
  --line: color-mix(in srgb, #5ba3a6 14%, transparent); --text: #222c32; --muted: #80888b; --user: #dbf4f4; --code: #e6f6f5;
  --ok: #2f9a5a; --warn: #5ba3a6; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-uranus-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #d5f3f3 0%, #f2f8f7 60%) fixed; }
:root[data-theme="sol-uranus"] #sidebar, :root[data-theme="sol-uranus"] #settingsNav, :root[data-theme="sol-uranus-light"] #sidebar, :root[data-theme="sol-uranus-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-uranus"] .send { color: #05100f; }
:root[data-theme="sol-uranus-light"] .send { color: #fff; }
:root[data-theme="sol-neptune"] {
  --bg: #040817; --surface: #0a1330; --surface-2: #17203c; --surface-3: #252d49;
  --line: color-mix(in srgb, #4f7dff 14%, transparent); --text: #e7eeff; --muted: #888d9e; --user: #152451; --code: #080f26;
  --ok: #8fe0a6; --warn: #4f7dff; --bad: #ff7a7a;
  --add: color-mix(in srgb, #8fe0a6 12%, transparent); --del: color-mix(in srgb, #ff7a7a 12%, transparent);
}
:root[data-theme="sol-neptune"] body { background: radial-gradient(1200px 700px at 50% -10%, #0d1b4a 0%, #040817 60%) fixed; }
:root[data-theme="sol-neptune-light"] {
  --bg: #eff1f8; --surface: #fafbff; --surface-2: #dfe5f9; --surface-3: #d2dcf9;
  --line: color-mix(in srgb, #395ab8 14%, transparent); --text: #1c2035; --muted: #7b7e8d; --user: #cfdaf9; --code: #dfe5f9;
  --ok: #2f9a5a; --warn: #395ab8; --bad: #cf4040;
  --add: color-mix(in srgb, #2f9a5a 12%, transparent); --del: color-mix(in srgb, #cf4040 12%, transparent);
}
:root[data-theme="sol-neptune-light"] body { background: radial-gradient(1200px 700px at 50% -10%, #c7d4fa 0%, #eff1f8 60%) fixed; }
:root[data-theme="sol-neptune"] #sidebar, :root[data-theme="sol-neptune"] #settingsNav, :root[data-theme="sol-neptune-light"] #sidebar, :root[data-theme="sol-neptune-light"] #settingsNav { background: transparent; }
:root[data-theme="sol-neptune"] .send { color: #040817; }
:root[data-theme="sol-neptune-light"] .send { color: #fff; }

/* 궤도 색 · 태양계 시리즈 두 줄 */
.orbit-colors { flex-direction: column; align-items: stretch; gap: 10px; }
.orbit-colors .oc-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.orbit-colors .oc-row .oc-t { min-width: 92px; }
.orbit-colors .oc .oc-ico.planet { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 1px var(--line); }

/* 태양계 시리즈 행성 표시: 조금 크게 그려서 가운데 맞춤 */
svg.planet-mark { margin: -12.5%; overflow: visible; }


/* 예약 문자 목록 */
.sched-list { list-style: none; margin: 6px 0 0; padding: 0; }
.sched-list li { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 0.92em; }
.sched-list li:first-child { border-top: 0; }
.sched-list li span { flex: 1; }
.sched-list li.done { color: var(--muted); }

/* 외출 모드일 때 커피잔 버튼은 강조색으로 채운다 */
#awakeBtn.away { background: var(--accent); color: var(--bg); }

/* ---------- Vision 문서 편집기 ---------- */
.doc-edit { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.de-title { font-size: 1.25em; font-weight: 700; border: 0; background: none; color: var(--text); padding: 4px 2px; outline: none; }
.de-bar { display: flex; flex-wrap: wrap; gap: 4px; position: sticky; top: 0; z-index: 2; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.de-btn { padding: 5px 10px; border-radius: 8px; border: 0; background: none; color: var(--text); font-size: 0.88em; }
.de-btn:hover, .de-btn.on { background: var(--surface-2); }
.de-btn.primary { background: var(--accent); color: var(--bg); margin-left: auto; }
.de-doc { flex: 1 0 auto; background: var(--dbg); color: var(--dtext); border-radius: 12px; padding: 28px 34px; line-height: 1.7; outline: none; min-height: 300px; border: 1px solid var(--line); }
.de-doc h1 { font-size: 1.6em; margin: 0.4em 0; } .de-doc h2 { font-size: 1.25em; margin: 0.6em 0 0.3em; }
.de-doc table { border-collapse: collapse; } .de-doc td, .de-doc th { border: 1px solid var(--dline); padding: 5px 8px; }
.de-slides { flex: 1; display: grid; grid-template-columns: 118px 1fr; gap: 10px; min-height: 0; }
.de-thumbs { display: flex; flex-direction: column; gap: 6px; overflow: auto; }
.de-thumb { display: flex; flex-direction: column; gap: 4px; text-align: left; aspect-ratio: 16 / 9; padding: 6px 8px; border-radius: 8px; background: var(--dbg); color: var(--dtext); border: 2px solid var(--line); font-size: 0.72em; overflow: hidden; }
.de-thumb .n { color: var(--dtext); opacity: .6; font-size: 0.9em; } .de-thumb.on { border-color: var(--accent); }
.de-stage { overflow: auto; }
.de-slide { aspect-ratio: 16 / 9; background: var(--dbg); color: var(--dtext); border: 1px solid var(--line); border-radius: 12px; padding: 6% 7%; display: flex; flex-direction: column; gap: 4%; box-shadow: 0 2px 14px rgba(0, 0, 0, 0.15); container-type: inline-size; }
.de-slide h1 { margin: 0; font-size: 6cqw; line-height: 1.2; outline: none; }
.de-slide .b { font-size: 3cqw; line-height: 1.55; outline: none; flex: 1; } .de-slide .b ul { margin: 0; padding-left: 1.2em; }
.de-present { position: fixed; inset: 0; z-index: 200; background: #000; display: flex; align-items: center; justify-content: center; }
.de-present .de-slide.big { width: min(100vw, 177.7vh); border-radius: 0; box-shadow: none; }
.de-phint { position: absolute; bottom: 14px; right: 20px; color: #aaa; font-size: 13px; }
.de-fx { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 10px; padding: 7px 10px; font-family: Menlo, monospace; font-size: 0.85em; }
.de-sheetbox { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--dbg); }
.de-sheet { border-collapse: collapse; font-size: 0.86em; color: var(--dtext); background: var(--dcard); }
.de-sheet th { background: var(--dcard); color: var(--dtext); opacity: .85; font-weight: 500; padding: 4px 8px; border: 1px solid var(--dline); position: sticky; top: 0; }
.de-sheet th.edit { color: var(--dtext); outline: none; }
.de-sheet td { border: 1px solid var(--dline); padding: 4px 8px; min-width: 70px; height: 22px; outline: none; white-space: nowrap; }
.de-sheet td:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.de-sheet td.num { text-align: right; font-variant-numeric: tabular-nums; } .de-sheet td.f { color: var(--accent); }
.de-chart { background: var(--dbg); border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow: auto; }
.de-chart svg { max-width: 100%; height: auto; }
#artifactBody.doc-mode #artFrame { display: none; }
/* 파일 화면의 새로 만들기 */
.new-tiles { margin: 0 0 18px; }
.nt-title { margin: 0 0 8px 2px; }
.nt-row { display: flex; flex-wrap: wrap; gap: 12px; }
.nt { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; background: none; border: 0; color: var(--text); padding: 0; font-size: 0.92em; }
.nt-ic { width: 120px; height: 82px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 55%, var(--surface)); transition: transform 0.2s var(--ease); }
.nt-ic svg { width: 30px; height: 30px; color: #fff; }
.nt:hover .nt-ic { transform: translateY(-2px); }
/* 발표 화면은 테마 바탕색으로 */
.de-present { background: #000; }
.de-present .de-slide.big { border: 0; }
.de-doc span[style*="background"], .de-slide span[style*="background"] { color: #15161a; }

.de-sheet td.f { color: inherit; font-weight: 600; }

/* 내 메시지 아래 버튼 줄 (마우스 올렸을 때) */
.msg.user { position: relative; }
.u-acts { display: inline-flex; align-items: center; gap: 0; vertical-align: middle; }
/* 내 메시지의 시간 줄은 마우스를 올렸을 때만 (자리는 그대로 두어 흔들리지 않게) */
.msg.user > .meta { visibility: hidden; gap: 4px; }
.msg.user:hover > .meta, .msg.user.queued > .meta { visibility: visible; }
.u-act { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 8px; border: 0; background: none; color: var(--muted); }
.u-act svg { width: 13px; height: 13px; }
.u-act:hover:not(:disabled) { color: var(--text); }
.u-act.danger:hover:not(:disabled) { color: var(--bad); }
.u-act:disabled { opacity: 0.35; }

/* 긴 문서도 배경이 끝까지: 종이가 내용만큼 늘어나고, 빛 번짐은 위쪽에만 */
.de-doc { background: radial-gradient(130% 600px at 50% -120px, color-mix(in srgb, var(--accent) 24%, var(--surface)) 0%, var(--surface) 70%) no-repeat, var(--surface); }
.de-slides, .de-chart { flex: 0 0 auto; }

/* 편집기: 위 도구 줄은 고정, 내용만 스크롤 */
.doc-edit { overflow: hidden !important; }
.doc-edit > .de-bar { position: static; flex: none; }
.de-scroll { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 10px; }
.de-scroll > .de-slides { flex: 1 0 auto; }
/* 글자 색 */
.de-a { font-weight: 700; text-decoration: underline; text-decoration-color: #e5484d; text-decoration-thickness: 3px; text-underline-offset: 2px; }
.de-colors { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px; flex: none; }
.de-csw { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); padding: 0; }
.de-csw.reset { width: auto; padding: 0 10px; border-radius: 999px; background: var(--surface); color: var(--text); font-size: 0.8em; }

/* 파일을 끌어 올렸을 때 */
body.drop-on::after { content: "여기에 놓기"; position: fixed; inset: 10px; z-index: 300; border: 2px dashed var(--accent); border-radius: 18px; background: color-mix(in srgb, var(--accent) 10%, transparent); display: grid; place-items: center; color: var(--text); font-weight: 600; pointer-events: none; }

/* 모델 버튼과 팝업 */
.dock-btn.model-btn { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; align-items: center; font-size: 0.85em; color: var(--text); }
.model-btn b { font-weight: 600; color: var(--text); }
.model-btn span { color: var(--muted); }
.dock-btn.model-btn:hover, .dock-btn.model-btn.open { background: color-mix(in srgb, var(--text) 10%, transparent); }
.model-btn svg { width: 12px; height: 12px; opacity: 0.6; transform: rotate(90deg); }
.model-pop { position: fixed; z-index: 100; min-width: 320px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); animation: popIn 0.16s var(--ease); }
.mp-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.88em; }
.mp-t { color: var(--muted); white-space: nowrap; }
.mp-row .seg { font-size: 0.92em; }

/* Liquid Glass: 팝업·메뉴·창은 뒤가 흐리게 비치는 유리 (글자는 잘 읽히게 꽤 진하게) */
:root[data-theme="glass"] { --glass-solid: rgba(26, 28, 36, 0.92); }
:root[data-theme="glass-light"] { --glass-solid: rgba(248, 249, 252, 0.93); }
:root.glass .ctx-menu, :root.glass .model-pop, :root.glass .conv-menu, :root.glass .flyout, :root.glass .palette,
:root.glass .ip, :root.glass .toast, :root.glass #settings, :root.glass #sheet, :root.glass #rawView .raw-box,
:root.glass #vpOverlay > * {
  background: var(--glass-solid) !important;
}
/* 앱 창(투명 창)에서 CSS 흐림을 쓰면 그 자리 뒤쪽이 네모나게 얼룩진다. 그래서 흐림은 크롬 패널에서만 */
:root.glass.in-panel .ctx-menu, :root.glass.in-panel .model-pop, :root.glass.in-panel .palette, :root.glass.in-panel .toast {
  -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
  backdrop-filter: blur(22px) saturate(160%) !important;
}
:root.glass .ctx-menu button:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 10%, transparent); }

/* 대화 목록 너비 조절: 오른쪽 모서리를 끈다 */
@media (min-width: 721px) { #sidebar { position: relative; } } /* 좁은 화면(폰·패널)에선 목록이 위에 떠야 해서 넓을 때만 */
.side-resizer { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 6; -webkit-app-region: no-drag; }
.side-resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: var(--accent); opacity: 0; transition: opacity 0.15s; }
.side-resizer:hover::after, body.side-resizing .side-resizer::after { opacity: 0.6; }
body.side-resizing { cursor: col-resize; user-select: none; }
:root[data-list="rail"] .side-resizer, :root[data-list="spotlight"] .side-resizer { display: none; }

/* 아이콘 줄 (대화 목록 접힘): 로고 · 새 대화 · 검색 · 대화 목록 · 프로젝트 · 파일 · iMessage … 맨 아래 설정 */
@media (min-width: 721px) {
  :root[data-list="rail"] #sidebar { gap: 6px; }
  :root[data-list="rail"] #convList { overflow-y: auto; padding-bottom: 60px; }
  :root[data-list="rail"] .side-top { gap: 6px; }
  :root[data-list="rail"] .brand { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; margin-bottom: 10px; }
  :root[data-list="rail"] .brand svg { width: 26px; height: 26px; }
  :root[data-list="rail"] .side-tools { gap: 6px; }
  :root[data-list="rail"] #newConv { order: 1; }
  :root[data-list="rail"] #searchBtn { order: 2; }
  :root[data-list="rail"] #railToggle { order: 0; }
  :root[data-list="rail"] .side-tools .icon-btn, :root[data-list="rail"] .side-nav-btn { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 12px; color: var(--text); }
  :root[data-list="rail"] .side-tools .icon-btn svg, :root[data-list="rail"] .side-nav-btn svg { width: 22px; height: 22px; }
  :root[data-list="rail"] .side-nav { gap: 6px; }
  :root[data-list="rail"] #sideSettings { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); }
}

/* 밝은 Liquid Glass: 흰 창 위의 흰 버튼이 안 보이던 문제 — 창은 살짝 회색, 버튼·카드·스위치는 회색 톤 + 테두리 */
:root[data-theme="glass-light"] { --glass-solid: rgba(234, 236, 242, 0.96); }
:root[data-theme="glass-light"] #settings, :root[data-theme="glass-light"] #sheet,
:root[data-theme="glass-light"] .model-pop, :root[data-theme="glass-light"] .ctx-menu, :root[data-theme="glass-light"] .conv-menu,
:root[data-theme="glass-light"] .flyout, :root[data-theme="glass-light"] .palette, :root[data-theme="glass-light"] .ip {
  --surface: rgba(255, 255, 255, 0.85);
  --surface-2: rgba(20, 30, 60, 0.08);
  --surface-3: rgba(20, 30, 60, 0.14);
  --line: rgba(20, 30, 60, 0.12);
  --glass-edge: rgba(20, 30, 60, 0.14);
  --glass-hi: rgba(255, 255, 255, 0.9);
  --glass-lo: rgba(20, 30, 60, 0.04);
}
:root[data-theme="glass-light"] #settingsBody .card { background: rgba(255, 255, 255, 0.85); }
:root[data-theme="glass-light"] #settingsNav button.active { background: rgba(20, 30, 60, 0.1); }
:root[data-theme="glass-light"] #settings .pill-btn:not(.primary) { background: #fff; color: var(--text); }
:root[data-theme="glass-light"] #settings .switch i { background: rgba(20, 30, 60, 0.18); }
:root[data-theme="glass-light"] #settingsBody .close { background: rgba(20, 30, 60, 0.08); }

/* 첨부·프로젝트 자료 미리보기: 누르면 옆 창에서 본다 */
.msg .atts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.att-chip { display: inline-flex; align-items: center; gap: 5px; max-width: 260px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 1em; cursor: pointer; transition: background 0.15s; }
.att-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-chip svg { flex: none; color: var(--muted); }
.att-chip:hover { background: var(--surface-3); }
.att-chip.no-prev { cursor: default; background: transparent; color: var(--muted); }
.pj-docs li.pj-doc { cursor: pointer; border-radius: 8px; }
.pj-docs li.pj-doc:hover { background: var(--surface-2); }

/* 음성 테스트 */
.vtest { margin: 2px 0 8px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); animation: fade 0.25s ease; }
.vt-steps { display: flex; gap: 16px; font-size: 0.86em; color: var(--muted); }
.vt-steps span { display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s; }
.vt-steps i { width: 8px; height: 8px; border-radius: 50%; background: var(--surface-3); transition: background 0.2s, box-shadow 0.2s; }
.vt-steps .run { color: var(--text); }
.vt-steps .run i { background: var(--accent); animation: vtPulse 1s ease-in-out infinite; }
.vt-steps .ok { color: var(--text); }
.vt-steps .ok i { background: var(--ok); }
.vt-steps .bad { color: var(--bad); }
.vt-steps .bad i { background: var(--bad); }
@keyframes vtPulse { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 22%, transparent); } }
.vt-meter { height: 4px; margin: 10px 0 8px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.vt-meter b { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.08s linear; }
.vtest:not(.live) .vt-meter { opacity: 0.4; }
.vt-text { min-height: 1.4em; font-size: 0.92em; line-height: 1.45; }
.vt-text.muted { color: var(--muted); }

/* 음성 대화 바: 화면 보기 눈 버튼 */
#voiceBar .vb-eye { color: var(--muted); transition: color 0.2s, background-color 0.2s; }
#voiceBar .vb-eye.on { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
#voiceBar .vb-eye.on svg { animation: vbEyeBlink 4s ease-in-out infinite; }
@keyframes vbEyeBlink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.15); } }

/* 아이폰 Vision 앱 연결 */
.pa-pin { font-size: 1.4em; letter-spacing: 3px; font-variant-numeric: tabular-nums; color: var(--accent); }
.pa-note { padding: 6px 0 4px; }

/* 아이폰 Vision 앱 (맥이 보내 준 화면): 노치·홈 막대 여백, 연결 안내 띠 */
/* 높이는 실제 보이는 높이(dvh)로. 노치·홈 막대 여백은 바깥이 아니라 위쪽 줄·입력창·목록 안쪽에만 (바깥에 주면 화면이 길어져 아래가 잘린다) */
:root.in-phone body { padding: 0; height: 100dvh; overflow: hidden; }
:root.in-phone #app, :root.in-phone #main, :root.in-phone #sidebar, :root.in-phone #sheet, :root.in-phone #sheet.art-full { height: 100dvh; }
:root.in-phone #app { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); box-sizing: border-box; }
:root.in-phone .drag-strip { padding-top: env(safe-area-inset-top); height: calc(44px + env(safe-area-inset-top)); box-sizing: border-box; }
:root.in-phone #island { padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
:root.in-phone #sidebar { padding-top: calc(16px + env(safe-area-inset-top)); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }
:root.in-phone #sheet { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); box-sizing: border-box; }

:root.in-phone, :root.in-phone body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
:root.in-phone #input { font-size: 16px; } /* 16px 아래면 아이폰이 입력할 때 화면을 확대한다 */
#phoneBanner { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 8px); transform: translateX(-50%); z-index: 50; padding: 7px 14px; border-radius: 999px; background: var(--surface-2); color: var(--text); font-size: 13px; box-shadow: var(--shadow); animation: fade 0.25s ease; }
:root.in-phone #navBrowser, :root.in-phone .side-resizer { display: none !important; } /* 맥에서 열리는 브라우저 창은 폰에선 안 씀 */
:root.in-phone .menu-btn { top: calc(6px + env(safe-area-inset-top)); width: 40px; height: 40px; } /* 시계·다이내믹 아일랜드 밑에 깔리지 않게 */


/* ---------- 닫기(✕) 버튼: 둥근 유리 버튼으로 통일 ---------- */
#settingsClose, #sheetClose, #rawClose, #voiceBar .vb-close {
  width: 34px; height: 34px; padding: 0; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--text) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: inset 0 1px 0 color-mix(in srgb, #fff 18%, transparent);
  color: var(--text); -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%);
  transition: background-color 0.15s, transform 0.12s cubic-bezier(.2, .8, .2, 1), opacity 0.15s;
}
#settingsClose svg, #sheetClose svg, #rawClose svg, #voiceBar .vb-close svg { width: 15px; height: 15px; stroke-width: 2.2; }
#settingsClose:hover, #sheetClose:hover, #rawClose:hover, #voiceBar .vb-close:hover { background: color-mix(in srgb, var(--text) 16%, transparent); }
#settingsClose:active, #sheetClose:active, #rawClose:active, #voiceBar .vb-close:active { transform: scale(0.88); }
:root[data-theme="glass-light"] #settingsBody .close { background: color-mix(in srgb, var(--text) 9%, transparent); }

/* ---------- 아이폰 앱: 설정 화면 ---------- */
/* 위쪽 탭 줄은 시계 줄 아래로, 오른쪽은 ✕ 자리를 비워 둔다 */
:root.in-phone #settingsNav { padding-top: calc(env(safe-area-inset-top) + 10px); padding-right: 14px; margin-right: 52px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
:root.in-phone #settingsBody .close { top: calc(env(safe-area-inset-top) + 9px); right: 12px; z-index: 6; }
:root.in-phone #settingsBody { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
/* 단축키 표는 폰에선 필요 없음 */
:root.in-phone [data-sub="g-keys"], :root.in-phone [data-sub-tab="g-keys"] { display: none !important; }
/* 문서 창 위쪽 줄 */
:root.in-phone .sheet-head { padding-top: 10px; }

/* ---------- 아이폰 앱: Liquid Glass ---------- */
/* 대화 목록·설정·문서 창: 뒤가 은은하게 비치는 유리 (글자는 또렷하게) */
:root.glass.in-phone #sidebar {
  background: rgba(22, 24, 34, 0.72) !important;
  -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  border-right: 1px solid var(--glass-edge); box-shadow: 12px 0 40px rgba(0, 0, 0, 0.35);
}
:root[data-theme="glass-light"].in-phone #sidebar { background: rgba(246, 247, 251, 0.78) !important; box-shadow: 12px 0 40px rgba(30, 40, 70, 0.15); }
:root.glass.in-phone #settings, :root.glass.in-phone #sheet {
  background: rgba(18, 20, 30, 0.82) !important;
  -webkit-backdrop-filter: blur(34px) saturate(170%) !important; backdrop-filter: blur(34px) saturate(170%) !important;
}
:root[data-theme="glass-light"].in-phone #settings, :root[data-theme="glass-light"].in-phone #sheet { background: rgba(244, 246, 251, 0.86) !important; }
:root.glass.in-phone #settingsNav { background: transparent; border-bottom: 1px solid var(--glass-edge); }
:root.glass.in-phone #sideBackdrop { background: rgba(0, 0, 0, 0.3); }
/* 맨 위 목록 버튼도 유리 알약으로 */
:root.glass.in-phone .menu-btn { border-radius: 50%; background: color-mix(in srgb, var(--text) 8%, transparent); border: 1px solid var(--glass-edge); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* 카메라 버튼: 폰에서만 (첨부가 켜져 있을 때) */
#camBtn { display: none; }
:root.in-phone #attachBtn:not(.hidden) + #camBtn { display: inline-grid; }

/* ================= 새 화면 (2026-11-27): 심플 · 위 막대 · 옆 목록 없음 ================= */
/* 심플 테마: 흰 바탕 · 검정 · 주황은 로고에만 */
:root[data-theme="simple-light"] {
  --bg: #ffffff; --surface: #ffffff; --surface-2: #f4f3f0; --surface-3: #eceae6;
  --line: rgba(23, 24, 26, 0.09); --text: #17181a; --muted: #6b6e75; --user: #f4f3f0; --code: #f7f6f3;
  --ok: #2f7d4f; --warn: #c4570c; --bad: #b3261e; --add: rgba(47, 125, 79, 0.1); --del: rgba(179, 38, 30, 0.1);
  --shadow: 0 12px 32px rgba(23, 24, 26, 0.1);
  --accent: #17181a !important;
}
:root[data-theme="simple"] {
  --bg: #111113; --surface: #18181b; --surface-2: #1f1f23; --surface-3: #2a2a2f;
  --line: rgba(255, 255, 255, 0.08); --text: #f2f2f3; --muted: #8e9097; --user: #232327; --code: #1a1a1d;
  --ok: #5fbf85; --warn: #f0954a; --bad: #ff7a70; --add: rgba(95, 191, 133, 0.12); --del: rgba(255, 122, 112, 0.12);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  --accent: #f2f2f3 !important;
}
:root[data-theme^="simple"] body { background: var(--bg); }
:root[data-theme^="simple"] .send, :root[data-theme^="simple"] .pill-btn.primary, :root[data-theme^="simple"] .seg button.active { color: var(--bg); }

/* 옆 대화 목록 없음 → 위 막대에서 프로젝트 / 대화 바꾸기 */
#app { grid-template-columns: 1fr auto !important; }
#sidebar, #sideBackdrop, .drag-strip, #dock { display: none !important; }
#topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 16px 0 84px; -webkit-app-region: drag; }
:root.in-panel #topbar { padding-left: 12px; }
:root.in-phone #topbar { height: auto; padding: calc(env(safe-area-inset-top) + 6px) 8px 6px; }
#topbar > * { -webkit-app-region: no-drag; }
#topbar .tb-space { flex: 1; -webkit-app-region: drag; }
#topbar button { border: none; background: transparent; color: var(--text); font: inherit; }
.tb-logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.tb-logo:hover, .tb-crumb:hover, .tb-btn:hover, .tb-icon:hover, #topbar .open { background: var(--surface-2) !important; }
.tb-crumb { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px; border-radius: 10px; min-width: 0; max-width: 280px; font-size: 0.98em; }
.tb-crumb .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-crumb.proj { font-weight: 600; }
.tb-crumb svg { width: 14px; height: 14px; color: var(--muted); transform: rotate(90deg); flex: none; }
.tb-crumb .badge, .tb-crumb > span:first-child:not(.t) { flex: none; }
.tb-crumb input { font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; background: var(--surface); color: var(--text); width: 220px; }
.tb-sep { color: var(--muted); opacity: 0.5; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-radius: 10px; font-size: 0.95em; flex: none; }
.tb-btn svg { width: 14px; height: 14px; }
.model-btn b { font-weight: 500; color: var(--muted); }
.model-btn svg { color: var(--muted); transform: rotate(90deg); }
.tb-new { border: 1px solid var(--line) !important; }
.tb-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted) !important; flex: none; }
.tb-icon svg { width: 18px; height: 18px; }
:root.in-phone .tb-new span, :root.in-phone .tb-sep, :root.in-phone #crumbProj { display: none; }
:root.in-phone .tb-new { border: none !important; padding: 0 8px; }
:root.in-phone .tb-crumb { max-width: 46vw; }

/* 위 막대에서 열리는 작은 창 */
.top-pop { position: fixed; z-index: 120; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 8px; animation: popIn 0.16s var(--ease); }
.top-pop.model-pop { width: 320px; min-width: 0; gap: 4px; padding: 10px; }
.model-pop .mp-row { padding: 4px 6px; }
.model-pop .mp-switch { min-height: 40px; }
.mp-line { height: 1px; background: var(--line); margin: 4px 2px; }
.mp-usage { display: flex; flex-direction: column; gap: 8px; width: 100%; padding: 8px 6px; border-radius: 10px; text-align: left; }
.mp-usage:hover { background: var(--surface-2) !important; }
.mp-use-h { display: flex; justify-content: space-between; font-size: 0.9em; }
.mp-use-h b { font-weight: 500; font-variant-numeric: tabular-nums; }
.mp-use-h b.warn { color: var(--warn); }
.mp-use .lim-bar { height: 6px; margin: 6px 0 0; }

.switcher { display: flex; width: 540px; max-width: calc(100vw - 16px); height: 380px; padding: 0; overflow: hidden; }
.sw-projs { width: 200px; flex: none; border-right: 1px solid var(--line); padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.sw-convs { flex: 1; min-width: 0; padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.switcher button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; text-align: left; color: var(--text); font-size: 0.95em; width: 100%; flex: none; }
.switcher button .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.switcher button:hover { background: var(--surface-2); }
.switcher button.on { background: var(--surface-2); font-weight: 600; }
.sw-proj { color: var(--muted) !important; }
.sw-proj.on { color: var(--text) !important; }
.sw-dot { width: 18px; height: 18px; border-radius: 5px; background: var(--surface-3); flex: none; }
.sw-line { height: 1px; background: var(--line); margin: 6px 4px; flex: none; }
.sw-new { border: 1px dashed var(--line) !important; margin-bottom: 6px; }
.sw-new svg { width: 15px; height: 15px; }
.sw-empty { color: var(--muted); font-size: 0.9em; padding: 12px; }
:root.in-phone .switcher { flex-direction: column; height: 70vh; }
:root.in-phone .sw-projs { width: auto; border-right: none; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; overflow-y: hidden; flex: none; }
:root.in-phone .sw-projs button { width: auto; white-space: nowrap; }
:root.in-phone .sw-line { display: none; }
.conv-menu .menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }

/* 홈 (로고) */
.home { max-width: 420px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 28px; }
.home-mark { display: grid; place-items: start; }
.home-list { display: flex; flex-direction: column; }
.home-item { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 0 6px; border-bottom: 1px solid var(--line); font-size: 1.05em; color: var(--text); text-align: left; }
.home-item:hover { background: var(--surface-2); }
.home-item svg { width: 20px; height: 20px; color: var(--muted); }

/* 빈 대화: 글 없이 로고만 */
.empty { margin-top: 26vh; }
.empty-title { display: none; }

/* 입력창: 첨부 · 글 · 말하기 · 보내기만 */
#island { padding: 0 24px 22px; }
#composer { border-radius: 16px; box-shadow: none; border-color: color-mix(in srgb, var(--text) 16%, transparent); padding: 6px; align-items: center; }
#composer:focus-within { box-shadow: none; border-color: color-mix(in srgb, var(--text) 35%, transparent); }
#composer textarea { padding: 8px 6px; font-size: 1.02em; }
.send { width: 36px; height: 36px; border-radius: 11px; }
#composer .icon-btn { width: 36px; height: 36px; border-radius: 10px; }
:root.in-phone #island { padding: 0 10px calc(env(safe-area-inset-bottom) + 10px); }

/* Vision 로고: 심플 테마에서도 Liquid Glass처럼 파란 해 (검은 해 X) · 밝은 바탕에선 달을 진하게 */
:root[data-theme^="simple"] { --mark: #0a84ff; }
:root[data-theme="simple-light"] { --mark-moon: #17181a; }

/* ================= 설정: 아이폰 설정처럼 (목록 → 들어가기) ================= */
#settings { grid-template-columns: 1fr !important; }
#settingsNav { display: none !important; }
#settingsBody { padding: 0 24px 48px !important; -webkit-app-region: no-drag; }
#settingsBody > * { max-width: 620px; margin-left: auto; margin-right: auto; }
#setHead { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: center; height: 56px; margin-bottom: 8px; background: var(--bg); -webkit-app-region: drag; }
:root.in-phone #setHead { padding-top: env(safe-area-inset-top); height: calc(env(safe-area-inset-top) + 52px); }
.sh-title { font-weight: 600; font-size: 1.05em; }
.sh-back { position: absolute; left: 0; display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 8px 0 2px; border-radius: 10px; color: var(--text); font-size: 0.98em; -webkit-app-region: no-drag; }
:root.in-phone .sh-back { bottom: 8px; }
.sh-back svg { width: 18px; height: 18px; }
.sh-back:hover { background: var(--surface-2); }
#settingsBody .close { z-index: 6; }
.stab h2 { display: none; }
.stab .sub-h { display: none; }
.stab.listing > :not(.sub-list) { display: none !important; }
.stab.drill > :not(.sub-pane.on) { display: none !important; }
.stab.drill > .sub-pane.on { display: block; }
.set-group { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin-bottom: 22px; }
.set-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 16px; text-align: left; color: var(--text); font-size: 1em; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row:hover { background: var(--surface-2); }
.set-row .t { flex: 1; }
.set-row > svg { width: 15px; height: 15px; color: var(--muted); flex: none; }
.set-row .si { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.set-row .si svg { width: 17px; height: 17px; color: var(--text); }
#setRoot { padding-top: 8px; }
#settingsBody .card { border-radius: 14px; }
/* 모델 메뉴: 세부 설정 접기 */
.mp-more { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 36px; padding: 0 6px; border-radius: 10px; color: var(--muted); font-size: 0.9em; }
.mp-more:hover { background: var(--surface-2); }
.mp-more svg { width: 14px; height: 14px; transform: rotate(90deg); transition: transform 0.2s var(--ease); }
.mp-more.open svg { transform: rotate(-90deg); }

/* ================= 내신 모드 ================= */
.ns { max-width: 620px; margin: 4vh auto 40px; display: flex; flex-direction: column; gap: 26px; }
.ns button { font: inherit; color: var(--text); }
.ns h3 { margin: 0 0 6px; font-size: 0.9em; font-weight: 500; color: var(--muted); }
.ns-top { display: flex; align-items: flex-end; gap: 14px; }
.ns-exam { font-size: 1em; color: var(--muted); }
.ns-dday { font-size: 3.4em; font-weight: 650; letter-spacing: -2px; line-height: 1; font-variant-numeric: tabular-nums; }
.ns-top .ns-exam:first-child { margin-bottom: 6px; }
.ns-top { flex-wrap: wrap; }
.ns-top .ns-exam:has(+ .ns-dday) { flex-basis: 100%; }
.ns-link { margin-left: auto; color: var(--muted) !important; font-size: 0.9em !important; padding: 6px 10px; border-radius: 8px; }
.ns-link:hover { background: var(--surface-2); }
.ns-sec { display: flex; flex-direction: column; }
.ns-todo { display: flex; align-items: center; gap: 12px; min-height: 48px; border-bottom: 1px solid var(--line); }
.ns-todo input { width: 18px; height: 18px; accent-color: var(--text); }
.ns-todo .t { flex: 1; }
.ns-todo.done .t { color: var(--muted); text-decoration: line-through; }
.ns-x { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: var(--muted) !important; flex: none; }
.ns-x:hover { background: var(--surface-2); }
.ns-x svg { width: 16px; height: 16px; }
.ns-add, .ns-answer, .ns-field input, .ns-subrow input, .ns-subrow select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 44px; }
.ns-add { margin-top: 10px; border-style: dashed; }
.ns-sub { display: flex; align-items: center; gap: 12px; min-height: 60px; border-bottom: 1px solid var(--line); }
.ns-sub-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ns-sub-name span { color: var(--muted); font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-acts { display: flex; gap: 6px; flex: none; }
.ns-chip { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line) !important; background: var(--surface); }
.ns-chip:hover { background: var(--surface-2); }
.ns-chip.on { background: var(--text); color: var(--bg) !important; border-color: var(--text) !important; }
.ns-wrongrow { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; border: 1px solid var(--line) !important; border-radius: 14px; text-align: left; }
.ns-wrongrow span { flex: 1; }
.ns-wrongrow b { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ns-wrongrow svg { width: 14px; height: 14px; color: var(--muted); }
.ns-wrongrow:hover { background: var(--surface-2); }
.ns-primary { height: 50px; padding: 0 22px; border-radius: 12px; background: var(--text) !important; color: var(--bg) !important; font-weight: 600 !important; }
.ns-primary.small { height: 38px; padding: 0 16px; }
.ns-ghost { height: 46px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line) !important; align-self: flex-start; }
.ns-ghost.small { height: 38px; margin-top: 18px; }
.ns-ghost:hover { background: var(--surface-2); }
.ns-back { display: inline-flex; align-items: center; gap: 2px; align-self: flex-start; height: 36px; padding: 0 8px 0 0; color: var(--text); margin-bottom: -14px; }
.ns-back svg { width: 18px; height: 18px; }
.ns-title { margin: 0; font-size: 1.5em; }
.ns-h3 { margin-bottom: -14px !important; }
.ns-group { display: flex; flex-direction: column; gap: 10px; }
.ns-field { display: flex; align-items: center; gap: 12px; }
.ns-field span { width: 40px; color: var(--muted); font-size: 0.9em; }
.ns-field input { flex: 1; }
.ns-subedit { display: flex; flex-direction: column; gap: 8px; }
.ns-subrow { display: grid; grid-template-columns: 1fr 140px 1.4fr 1fr 36px; gap: 6px; align-items: center; }
.ns-subrow input, .ns-subrow select { min-width: 0; height: 40px; padding: 0 8px; }
:root.in-phone .ns-subrow { grid-template-columns: 1fr 1fr; }
.ns-making { margin-top: 20vh; display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--muted); }
.ns-spin { width: 28px; height: 28px; border-radius: 50%; border: 2.5px solid var(--line); border-top-color: var(--text); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.ns-solvehead { display: flex; align-items: center; gap: 12px; }
.ns-pos, .ns-clock { color: var(--muted); font-variant-numeric: tabular-nums; }
.ns-sp { flex: 1; }
.ns-q { min-height: 300px; display: flex; flex-direction: column; gap: 16px; }
.ns-qtext { margin: 0; font-size: 1.2em; line-height: 1.75; white-space: pre-wrap; }
.ns-choices { display: flex; flex-direction: column; gap: 8px; }
.ns-choices.ox { flex-direction: row; }
.ns-choice { min-height: 52px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line) !important; text-align: left; line-height: 1.5; }
.ns-choices.ox .ns-choice { flex: 1; height: 80px; font-size: 1.8em; text-align: center; }
.ns-choice:hover { background: var(--surface-2); }
.ns-choice.on { background: var(--text); color: var(--bg) !important; border-color: var(--text) !important; }
.ns-answer { height: 52px; font-size: 1.1em; }
.ns-nav { display: flex; align-items: center; gap: 10px; }
.ns-dots { flex: 1; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.ns-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3) !important; padding: 0; }
.ns-dot.done { background: var(--text) !important; }
.ns-dot.cur { background: transparent !important; box-shadow: inset 0 0 0 2px var(--text); }
.ns-score { display: flex; align-items: baseline; gap: 4px; }
.ns-score b { font-size: 3.4em; font-weight: 650; letter-spacing: -2px; }
.ns-score span { font-size: 1.4em; color: var(--muted); }
.ns-score em { margin-left: auto; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.ns-results { display: flex; flex-direction: column; }
.ns-res { border-bottom: 1px solid var(--line); padding: 12px 0; }
.ns-res-line { display: flex; align-items: center; gap: 12px; }
.ns-res-line .n { width: 20px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ns-res-line .mark { font-weight: 700; width: 16px; }
.ns-res-line .mark.o { color: var(--ok); }
.ns-res-line .mark.x { color: var(--warn); }
.ns-res-line .q { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-res-line .s { color: var(--muted); font-size: 0.85em; font-variant-numeric: tabular-nums; }
.ns-res-more { margin: 8px 0 0 48px; display: flex; flex-direction: column; gap: 4px; font-size: 0.95em; }
.ns-res-more .ex, .ns-wex { color: var(--muted); }
.ns-row { display: flex; gap: 8px; flex-wrap: wrap; }
.ns-wrong { border-bottom: 1px solid var(--line); padding-bottom: 18px; display: flex; flex-direction: column; gap: 8px; }
.ns-wmeta { display: flex; align-items: center; color: var(--muted); font-size: 0.85em; }
.ns-wmeta .ns-x { margin-left: auto; }
.ns-wans { font-size: 0.95em; }
.ns-empty { color: var(--muted); }
:root.in-phone .ns { margin-top: 2vh; }

/* 내신: 과목 목록 · 과목 화면 */
.ns-sub { width: 100%; text-align: left; }
.ns-sub:hover { background: var(--surface-2); }
.ns-sub-right { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.85em; flex: none; }
.ns-sub-right svg { width: 14px; height: 14px; }
.ns-subtop { display: flex; flex-direction: column; gap: 4px; }
.ns-submeta { color: var(--muted); }
.ns-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ns-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 96px; padding: 16px; border-radius: 14px; border: 1px solid var(--line) !important; text-align: left; }
.ns-kind:hover { background: var(--surface-2); }
.ns-kind b { font-size: 1.2em; }
.ns-kind span { color: var(--muted); font-size: 0.85em; }
:root.in-phone .ns-kinds { grid-template-columns: 1fr; }
:root.in-phone .ns-kind { min-height: 64px; }

/* 프로젝트 자료: 추가 사항 */
.pj-note { width: 100%; box-sizing: border-box; margin: -2px 0 10px; height: 36px; padding: 0 12px; border-radius: 10px; border: 1px dashed var(--line); background: transparent; color: var(--text); font: inherit; font-size: 0.9em; }
.pj-note:focus { border-style: solid; border-color: color-mix(in srgb, var(--text) 35%, transparent); outline: none; }
/* 홈·내신·프로젝트 같은 화면: 위 막대엔 로고만 (대화를 열면 다시 보인다) */
#main.page-on #topbar > :not(#homeBtn):not(.tb-space) { visibility: hidden; }

/* 내신: 기출 설정 · 출처 · 시험 시간 */
.ns-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ns-optrow { display: flex; align-items: center; gap: 14px; min-height: 52px; border-bottom: 1px solid var(--line); }
.ns-optl { width: 64px; color: var(--muted); font-size: 0.9em; flex: none; }
.ns-seg { display: flex; gap: 4px; flex-wrap: wrap; }
.ns-segb { height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--line) !important; }
.ns-segb.on { background: var(--text); color: var(--bg) !important; border-color: var(--text) !important; }
.ns-optin { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; padding: 0 12px; }
.ns-src { display: block; width: 100%; text-align: left; min-height: 44px; padding: 0 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: underline; text-underline-offset: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-clock.warn { color: var(--warn); font-weight: 600; }

/* 내신: 출처 표시 · 서술형 */
.ns-from { color: var(--muted); font-size: 0.85em; margin-bottom: -8px; }
.ns-essay { width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 1.05em; line-height: 1.7; padding: 12px 14px; resize: vertical; }
.ns-res-more .fb { color: var(--text); font-weight: 500; }
.ns-primary:disabled { opacity: 0.6; }

/* 내신 · 시험 일정 (과목 탭) — 폰에서도 한 줄에 하나씩 */
.ns-in { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 44px; min-width: 0; width: 100%; box-sizing: border-box; }
textarea.ns-in { height: auto; padding: 10px 12px; line-height: 1.6; resize: vertical; }
.ns-setup .ns-field { display: grid; grid-template-columns: 64px minmax(0, 1fr); align-items: center; gap: 10px; }
.ns-setup .ns-field span { width: auto; }
.ns-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: -10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ns-tabs::-webkit-scrollbar { display: none; }
.ns-tab { flex: none; height: 38px; padding: 0 16px; border-radius: 19px; border: 1px solid var(--line) !important; }
.ns-tab.on { background: var(--text); color: var(--bg) !important; border-color: var(--text) !important; font-weight: 600; }
.ns-tab.add { width: 38px; padding: 0; }
.ns-panel { display: flex; flex-direction: column; gap: 12px; }
.ns-rowhead { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; }
.ns-rowhead h3 { margin: 0; }
.ns-doc { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 4px; border-bottom: 1px solid var(--line); text-align: left; }
.ns-doc .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-doc .st { color: var(--muted); font-size: 0.85em; flex: none; }
.ns-doc:hover { background: var(--surface-2); }
.ns-partdoc { margin-top: 8px; color: var(--muted); font-size: 0.85em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-part { display: flex; align-items: center; gap: 12px; min-height: 46px; border-bottom: 1px solid var(--line); }
.ns-part input { width: 20px; height: 20px; accent-color: var(--text); flex: none; }
.ns-part .t { flex: 1; min-width: 0; }
.ns-part .pg { color: var(--muted); font-size: 0.85em; flex: none; }
.ns-chip:disabled { opacity: 0.45; }
:root.in-phone .ns { gap: 20px; padding: 0 2px; }
:root.in-phone .ns-title { font-size: 1.3em; }
.ns-tabin { flex: none; width: 110px; height: 38px; border-radius: 19px; }

/* 시험 일정: 과목 세로 목록 */
.ns-setlist { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.ns-setrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 0 6px; border-bottom: 1px solid var(--line); text-align: left; }
.ns-setrow:hover { background: var(--surface-2); }
.ns-setrow b { font-weight: 600; }
.ns-setrow .m { flex: 1; text-align: right; color: var(--muted); font-size: 0.85em; }
.ns-setrow > svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.ns-setrow.add { color: var(--muted) !important; }
.ns-setrow.add svg { width: 16px; height: 16px; }
.ns-setrow.add b { font-weight: 500; }
.ns-setlist .ns-in { margin: 6px 0; }

/* 대화 줄 이름 바꾸기 · 메뉴 (폰은 꾹 누르기) */
.sw-rename { flex: 1; min-width: 0; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.ctx-menu { z-index: 200 !important; }
:root.in-phone .ctx-menu button { min-height: 44px; }

/* 맥에서만 되는 설정은 폰에서 숨김 */
:root.in-phone .mac-only { display: none !important; }

/* 날짜 칸: 글자 위에 투명한 날짜 고르기 (아이폰 기본 날짜 칸 대신) */
.ns-date { position: relative; display: flex; align-items: center; height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); min-width: 0; }
.ns-date .dt { pointer-events: none; }
.ns-date.is-empty .dt { color: var(--muted); }
.ns-date-in { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; margin: 0; padding: 0; -webkit-appearance: none; appearance: none; font-size: 16px; cursor: pointer; }

/* 범위 목록 고치기 */
.ns-parts { display: flex; flex-direction: column; }
.ns-part { gap: 8px; }
.ns-parttext { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 44px; text-align: left; padding: 0; }
.ns-parttext .t { flex: 1; min-width: 0; }
.ns-part.edit { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 6px; padding: 6px 0; }
.ns-part.edit .ns-in { height: 40px; }
.ns-partadd { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 38px; padding: 0 4px; color: var(--muted) !important; font-size: 0.9em; }
.ns-partadd svg { width: 14px; height: 14px; }

/* 과목 화면: 체크한 범위 미리 보기 */
.ns-rangelist { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; margin-top: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line) !important; text-align: left; font-size: 0.9em; width: 100%; }
.ns-rangelist span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ns-rangelist .more { color: var(--muted); }
.ns-rangelist:hover { background: var(--surface-2); }

/* ---------- 내신 퀴즈 단계 · 출제 범위 · 문제 그림 ---------- */
.ns-levels { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ns-level { display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; border-radius: 0 !important; }
.ns-level + .ns-level { border-top: 1px solid var(--line) !important; }
.ns-level:hover { background: var(--surface-2); }
.ns-level.locked { opacity: 0.45; }
.ns-level .ns-sub-right svg { width: 18px; height: 18px; }
.ns-level.done .ns-sub-right { color: #34c759; }
.ns-lvdot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.ns-lvdot.l0 { background: #34c759; }
.ns-lvdot.l1 { background: #ff9f0a; }
.ns-lvdot.l2 { background: #ff3b30; }
.ns-hint { color: var(--muted); font-size: 0.85em; margin-top: -6px; }
.ns-pass { align-self: flex-start; padding: 5px 12px; border-radius: 999px; background: rgba(255, 59, 48, 0.12); color: #ff3b30; font-weight: 600; font-size: 0.9em; }
.ns-pass.ok { background: rgba(52, 199, 89, 0.14); color: #248a3d; }
.ns-fig { margin: 4px 0 0; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ns-fig img { max-width: 100%; max-height: 340px; border-radius: 12px; background: #fff; border: 1px solid var(--line); object-fit: contain; }
.ns-fig figcaption { color: var(--muted); font-size: 0.82em; }
.ns-recscore { font-variant-numeric: tabular-nums; font-weight: 600; margin-right: 4px; }
.ns-recscore.ok { color: #248a3d; }
.ns-recscore.bad { color: #ff3b30; }
.ns-recsum { display: flex; gap: 18px; color: var(--muted); font-size: 0.92em; }

.set-row.set-logout { justify-content: center; }
.set-row.set-logout .t { color: #ff3b30; flex: none; font-weight: 600; }

/* ---------- 내신 정리: 칠판 ---------- */
.ns-focus { width: 100%; }
.ns-board { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 22px 20px; border-radius: 18px; background: #fff; color: #1d1d1f; border: 1px solid var(--line); box-shadow: 0 1px 0 rgba(0,0,0,0.02); min-height: 300px; }
:root[data-theme="simple"] .ns-board, :root.dark .ns-board { background: #1c1c1e; color: #f2f2f7; }
.ns-board.trap { border-color: #ff3b30; box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.12); }
.ns-traptag { align-self: flex-start; padding: 3px 10px; border-radius: 999px; background: #ff3b30; color: #fff; font-size: 0.78em; font-weight: 700; }
.ns-bt { margin: 0; font-size: 1.35em; font-weight: 700; letter-spacing: -0.3px; }
.ns-blines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ns-blines li { position: relative; padding-left: 16px; font-size: 1.05em; line-height: 1.45; opacity: 0; animation: ns-write 0.45s ease forwards; }
.ns-blines li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: #0a84ff; }
.ns-board.trap .ns-blines li::before { background: #ff3b30; }
.ns-say { color: var(--muted); font-size: 0.92em; line-height: 1.55; margin: 0; opacity: 0; animation: ns-write 0.45s ease forwards; }
.ns-bquiz .ns-say { opacity: 1; animation: none; }
.ns-again { margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(10, 132, 255, 0.08); line-height: 1.6; white-space: pre-wrap; }
.ns-fig.drawing img { animation: ns-draw 1s ease-out both; }
@keyframes ns-write { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes ns-draw { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.ns-bquiz { display: flex; flex-direction: column; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.ns-choice.ok { border-color: #34c759 !important; background: rgba(52, 199, 89, 0.12); }
.ns-choice.bad { border-color: #ff3b30 !important; background: rgba(255, 59, 48, 0.1); }
.ns-dot.trap { box-shadow: 0 0 0 1.5px #ff3b30; }

/* ---------- 정리 보기: 노트 · 보드 ---------- */
.ns-notehead { flex-wrap: wrap; row-gap: 8px; }
.ns-modeseg .ns-segb { height: 30px; padding: 0 12px; font-size: 0.88em; }
:root.in-phone .ns-notehead .ns-modeseg { width: 100%; justify-content: center; order: 9; }
.ns.ns-wide { max-width: min(1180px, 96vw); }

/* 노트: 줄 공책 (흰 종이 · 파란 줄 · 빨간 여백선) */
.ns-notebook { --line-h: 30px; position: relative; padding: 28px 24px 34px 58px; border-radius: 14px; color: #1d1d1f; border: 1px solid var(--line);
  background: linear-gradient(90deg, transparent 42px, rgba(229, 57, 53, 0.35) 42px, rgba(229, 57, 53, 0.35) 44px, transparent 44px),
    repeating-linear-gradient(#fffdf7 0, #fffdf7 calc(var(--line-h) - 1px), rgba(30, 136, 229, 0.16) calc(var(--line-h) - 1px), rgba(30, 136, 229, 0.16) var(--line-h)); }
.ns-nbtitle { margin: 0; font-size: 1.5em; letter-spacing: -0.4px; color: #0d47a1; }
.ns-nbmeta { color: #8a8a8e; font-size: 0.85em; margin: 2px 0 14px; }
.ns-nbsec { padding: 10px 0 14px; }
.ns-nbsec h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 1.12em; color: #1565c0; }
.ns-nbsec.trap h3 { color: #c62828; }
.ns-nbsec.trap { margin-left: -14px; padding-left: 14px; border-left: 3px solid #e53935; }
.ns-nbnum { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #1e88e5; color: #fff; font-size: 0.75em; flex: none; }
.ns-nbsec ul { margin: 0; padding-left: 18px; line-height: var(--line-h); }
.ns-nbsec li::marker { color: #1e88e5; }
.ns-nbsec.trap li::marker { color: #e53935; }
.ns-notebook mark, .ns-wbcard mark { background: linear-gradient(transparent 45%, rgba(255, 213, 0, 0.55) 45%); color: inherit; padding: 0 1px; font-weight: 600; }
.ns-nbsay { margin: 4px 0 0; color: #5f6368; font-size: 0.9em; line-height: var(--line-h); }
.ns-notebook .ns-fig { align-items: flex-start; margin: 6px 0; }
.ns-notebook .ns-fig img { max-height: 240px; }
.ns-nbq p { margin: 0; line-height: var(--line-h); }
.ns-nbans { margin: 2px 0 8px; padding: 2px 12px; border-radius: 10px; border: 1px dashed #1e88e5 !important; color: #1565c0; font-size: 0.9em; text-align: left; }
.ns-nbans.open { border-style: solid !important; background: rgba(30, 136, 229, 0.08); }

/* 보드: 화이트보드 한 판 (점 격자 · 색 마커 상자) */
.ns-wbwrap { overflow: auto; border-radius: 16px; border: 1px solid var(--line); background: #fff; max-height: 74vh; -webkit-overflow-scrolling: touch; }
.ns-wb { padding: 26px; min-width: 100%; box-sizing: border-box; color: #1d1d1f; background-color: #fff; background-image: radial-gradient(rgba(0, 0, 0, 0.09) 1px, transparent 1px); background-size: 20px 20px; }
.ns-wbtitle { margin: 0 0 18px; text-align: center; font-size: 1.6em; letter-spacing: -0.4px; color: #0d47a1; }
.ns-wbgrid { column-width: 260px; column-gap: 18px; }
.ns-wbcard { break-inside: avoid; margin: 0 0 18px; padding: 14px 16px 12px; border: 2.5px solid var(--ink); border-radius: 14px 18px 12px 16px; background: rgba(255, 255, 255, 0.92); box-shadow: 2px 3px 0 color-mix(in srgb, var(--ink) 22%, transparent); }
.ns-wbcard h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--ink); font-size: 1.05em; }
.ns-wbcard ul { margin: 0; padding-left: 16px; line-height: 1.55; font-size: 0.93em; }
.ns-wbcard li::marker { color: var(--ink); }
.ns-wbcard .ns-fig { margin: 0 0 8px; }
.ns-wbcard .ns-fig img { max-height: 170px; border: 0; }
.ns-wbcard .ns-fig figcaption { display: none; }
.ns-wbzoom { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ns-wbzl { min-width: 60px; font-variant-numeric: tabular-nums; color: var(--muted); }
:root.in-phone .ns-wbwrap { max-height: 68vh; }
:root.in-phone .ns-wb { padding: 16px; }
/* 정리 제목: .ns h3(작은 회색)보다 앞서게 */
.ns .ns-bt { font-size: 1.35em; font-weight: 700; color: inherit; margin: 0; }
.ns .ns-nbsec h3 { font-weight: 700; }
.ns .ns-wbcard h3 { font-weight: 700; font-size: 1.05em; }
.ns .ns-wbcard.trap h3, .ns .ns-nbsec.trap h3 { color: #c62828; }
.ns .ns-focus { flex: none; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface, transparent); font-size: 1em; }
/* 노트: 줄 배경 뺌 (글 줄과 안 맞아서) → 깨끗한 흰 종이 */
.ns .ns-notebook { background: #fff; padding: 28px 26px 32px; }
.ns .ns-nbsec ul { line-height: 1.75; }
.ns .ns-nbsec li { margin: 2px 0; }
.ns .ns-nbsay { line-height: 1.65; margin-top: 8px; }
.ns .ns-nbq p { line-height: 1.6; margin: 6px 0 4px; }
.ns .ns-nbsec + .ns-nbsec { border-top: 1px solid #ececf0; }
.ns .ns-nbsec.trap { margin-left: 0; padding-left: 14px; }
/* 정리 범위 고르기 */
.ns .ns-rangehd { display: flex; align-items: center; gap: 6px; }
.ns .ns-rangehd .ns-sp { flex: 1; }
.ns-pick { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.ns-pick .ns-part { cursor: pointer; }
.ns-pick .ns-part:last-child { border-bottom: 0; }
.ns-pick .ns-parttext { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: center; }
.ns .ns-focus { height: auto; min-height: 60px; padding: 10px 14px; resize: vertical; line-height: 1.5; }

/* 모델 v3 고정: 고르는 칸 대신 이름만 */
.mp-fixed { font-weight: 600; font-size: 0.95em; }

/* 설명형 대답: 큰 소제목 + 문단 + 출처 칩 */
.msg.assistant .bubble h2 { font-size: 1.45em; font-weight: 700; letter-spacing: -0.2px; margin: 1.1em 0 0.35em; }
.msg.assistant .bubble h3 { font-size: 1.15em; font-weight: 700; margin: 0.9em 0 0.3em; }
.msg.assistant .bubble p.src { display: flex; flex-wrap: wrap; gap: 6px; margin: 0.4em 0 1em; font-size: 0; }
.msg.assistant .bubble p.src a { font-size: 12.5px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--text) 9%, transparent); color: var(--muted); text-decoration: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg.assistant .bubble p.src a:hover { color: var(--text); }

/* ================= 새 화면 (2026-11-30): 맥 왼쪽 목록 · 폰 목록 첫 화면 · 유리 버튼 ================= */
:root { --glass-1: rgba(255, 255, 255, 0.13); --glass-2: rgba(255, 255, 255, 0.07); --glass-hi: rgba(255, 255, 255, 0.14); --side-bg: #1f1e24; }
:root[data-theme="simple-light"] { --glass-1: rgba(0, 0, 0, 0.05); --glass-2: rgba(0, 0, 0, 0.035); --glass-hi: rgba(255, 255, 255, 0.7); --side-bg: #f4f3f0; }
:root[data-theme="simple"] { --bg: #151517; }
:root.in-phone[data-theme="simple"] { --bg: #000000; }
.vb2-glass, .tb-glass, :root.in-phone #topbar #homeBtn, :root.in-phone #topbar #modelBtn, :root.in-phone #topbar #toolsBtn {
  background: linear-gradient(180deg, var(--glass-1), var(--glass-2)) !important;
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--line);
  border: none; color: var(--text) !important;
}

/* 맥: 왼쪽 목록 다시 보이기 (새 모양만) */
:root:not(.in-panel) #app { grid-template-columns: var(--side-w, 290px) 1fr auto !important; }
:root:not(.in-panel) #sidebar { display: flex !important; background: var(--side-bg); border-right: 1px solid var(--line); padding: 0; height: 100vh; }
:root:not(.in-panel) #sidebar > :not(#side2):not(.side-resizer) { display: none !important; }
:root:not(.in-panel) #topbar { padding-left: 16px; }
:root:not(.in-panel) #homeBtn, :root:not(.in-panel) #tbNew { display: none; }
:root.in-panel #tbSearch, :root.in-panel #tbEye, :root.in-panel #tbCtl { display: none; }
.tb-glass { width: 32px; height: 32px; border-radius: 16px; }
.tb-glass svg { width: 16px; height: 16px; }
.tb-glass.on { color: var(--bg) !important; background: var(--text) !important; }

.vb2 { display: flex; flex-direction: column; min-height: 0; flex: 1; width: 100%; }
#side2 { padding: 10px 10px 14px; -webkit-app-region: drag; }
#side2 > * { -webkit-app-region: no-drag; }
.vb2-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#side2 .vb2-head { padding-left: 70px; height: 32px; }
.vb2-filter { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 12px; border-radius: 14px; font: inherit; font-size: 0.86em; font-weight: 600; max-width: 170px; }
.vb2-filter span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb2-filter svg { width: 11px; height: 11px; transform: rotate(90deg); opacity: 0.7; flex: none; }
.vb2-search { width: 30px; height: 30px; border-radius: 15px; display: grid; place-items: center; }
.vb2-search svg { width: 15px; height: 15px; }
.vb2-feats { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 2px; padding: 16px 0 6px; }
.vb2-feat { display: flex; flex-direction: column; align-items: center; gap: 5px; border: none; background: none; color: var(--muted); font: inherit; font-size: 0.7em; padding: 2px 0; border-radius: 10px; min-width: 0; }
.vb2-feat .fl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb2-feat .fi { width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center; color: var(--text); background: linear-gradient(180deg, var(--glass-1), var(--glass-2)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--line); }
.vb2-feat.main .fi { background: #0a84ff; color: #fff; box-shadow: none; }
.vb2-feat .fi svg { width: 17px; height: 17px; }
.vb2-feat:hover { color: var(--text); }
.vb2-list { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 6px; overscroll-behavior: contain; }
.vb2-sec { font-size: 0.74em; font-weight: 600; color: var(--muted); padding: 12px 10px 4px; opacity: 0.85; }
.vb2-row { display: flex; align-items: flex-start; gap: 9px; width: 100%; padding: 8px 10px; border: none; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; flex: none; }
.vb2-row:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.vb2-row.on { background: color-mix(in srgb, var(--text) 10%, transparent); }
.vb2-row > i { width: 7px; height: 7px; border-radius: 4px; margin-top: 6px; flex: none; }
.vb2-row .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vb2-row b { font-size: 0.92em; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vb2-row .sn { font-size: 0.82em; line-height: 1.4; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.vb2-row .tm { font-size: 0.72em; color: var(--muted); padding-top: 2px; flex: none; font-variant-numeric: tabular-nums; }
.vb2-empty { color: var(--muted); font-size: 0.85em; padding: 20px 10px; }
.vb2-new { align-self: center; border: none; background: none; color: var(--text); padding: 4px; margin-top: 6px; border-radius: 50%; cursor: pointer; flex: none; }
.vb2-new:hover { transform: scale(1.06); }
.vb2-new { transition: transform 0.2s var(--ease); }
.vb2-moon { transform-origin: 28px 28px; animation: vb2orb 8s linear infinite; }
@keyframes vb2orb { to { transform: rotate(360deg); } }

/* 폰: 첫 화면 = 대화 목록 */
:root.in-phone #main.home-on #topbar { display: none; }
:root.in-phone #main.home-on #pageView { padding: 0; }
:root.in-phone .home2 { height: 100%; box-sizing: border-box; padding: calc(env(safe-area-inset-top) + 8px) 18px calc(env(safe-area-inset-bottom) + 10px); font-size: 1.12em; }
:root.in-phone .home2 .vb2-filter { height: 36px; padding: 0 14px; border-radius: 18px; }
:root.in-phone .home2 .vb2-search { width: 44px; height: 44px; border-radius: 22px; }
:root.in-phone .home2 .vb2-search svg { width: 20px; height: 20px; }
:root.in-phone .home2 .vb2-feats { padding: 20px 0 6px; }
:root.in-phone .home2 .vb2-feat .fi { width: 46px; height: 46px; border-radius: 23px; }
:root.in-phone .home2 .vb2-feat .fi svg { width: 21px; height: 21px; }
:root.in-phone .home2 .vb2-feat { font-size: 0.62em; }
:root.in-phone .home2 .vb2-row { padding: 10px 2px; }
:root.in-phone .home2 .vb2-row .sn { -webkit-line-clamp: 1; }
:root.in-phone .home2 .vb2-row:hover { background: none; }
:root.in-phone #pageView:has(.home2) { overflow: hidden; }

/* 폰 위 막대: 뒤로 · 대화 이름(아래 프로젝트) · v3 · ⋯ */
:root.in-phone #topbar { gap: 8px; padding: calc(env(safe-area-inset-top) + 6px) 14px 8px; }
:root.in-phone #topbar #homeBtn { width: 44px; height: 44px; border-radius: 22px; }
:root.in-phone #topbar #homeBtn svg { width: 20px; height: 20px; }
:root.in-phone #crumbProj, :root.in-phone .tb-sep, :root.in-phone #tbNew, :root.in-phone .tb-space { display: none !important; }
:root.in-phone #crumbConv { flex: 1; max-width: none; justify-content: center; flex-wrap: wrap; row-gap: 0; height: auto; min-height: 44px; padding: 2px 4px; }
:root.in-phone #crumbConv .t { font-weight: 600; max-width: 100%; }
:root.in-phone #crumbConv > svg { display: none; }
:root.in-phone #crumbConv .sub { flex-basis: 100%; display: flex; align-items: center; justify-content: center; gap: 4px; font-size: 0.72em; color: var(--muted); }
#crumbConv .sub { display: none; }
#crumbConv .sub i { width: 6px; height: 6px; border-radius: 3px; }
:root.in-phone #topbar #modelBtn { height: 44px; padding: 0 14px; border-radius: 22px; }
:root.in-phone #topbar #modelBtn b { color: var(--text); font-weight: 700; }
:root.in-phone #topbar #modelBtn svg { display: none; }
:root.in-phone #topbar #toolsBtn { width: 44px; height: 44px; border-radius: 22px; }

/* 입력줄: [+] [메시지] [마이크] — 글을 쓰면 마이크 대신 보내기 */
#composer { background: transparent !important; border: none !important; box-shadow: none !important; padding: 0 !important; gap: 8px; align-items: flex-end; }
#composer textarea { border-radius: 22px; min-height: 44px; box-sizing: border-box; padding: 11px 16px !important; background: linear-gradient(180deg, var(--glass-1), var(--glass-2)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--line); }
#composer .icon-btn, #composer .send { width: 44px !important; height: 44px !important; border-radius: 22px !important; flex: none; display: grid; place-items: center; background: linear-gradient(180deg, var(--glass-1), var(--glass-2)); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--line); color: var(--text); }
#composer .send { background: var(--text); color: var(--bg); box-shadow: none; }
#composer .icon-btn.hidden { display: none !important; }
#composer:not(.typed) #micBtn:not(.hidden) ~ #sendBtn:not(.busy) { display: none; }
#attachBtn svg { width: 20px; height: 20px; }
:root.in-phone #camBtn { display: none !important; }
#composer textarea::placeholder { color: var(--muted); }

/* 폰: 작은 창은 아래에서 올라오는 시트로 */
:root.in-phone .top-pop, :root.in-phone .ctx-menu, :root.in-phone .conv-menu {
  position: fixed !important; left: 8px !important; right: 8px !important; top: auto !important; bottom: calc(env(safe-area-inset-bottom) + 8px) !important;
  width: auto !important; max-width: none !important; max-height: 80vh; overflow-y: auto; border-radius: 28px !important; padding: 12px !important; font-size: 1.05em;
}
:root.in-phone .ctx-menu button, :root.in-phone .conv-menu button { min-height: 48px; }
.vb2-row .sn { white-space: normal; word-break: break-all; }
.vb2-row b { white-space: nowrap; }
:root:not(.phone-app) #camBtn { display: none !important; }

/* 2026-11-30 수정: 위 막대는 화면 보기 · ⋯ 만 (대화 이름·모델·검색·맥 조작 없음) · 목록 색 점·아래 새 대화 없음 */
#crumbProj, #crumbConv, .tb-sep, #modelBtn, #tbSearch, #tbCtl, #tbNew { display: none !important; }
#topbar .tb-space { display: block !important; flex: 1; }
.vb2-gap { flex: 1; }
.vb2-head { justify-content: flex-start; }
.vb2-row { gap: 0; }
:root.in-phone #topbar #toolsBtn { margin-left: auto; }

/* 폰 아래 탭 막대: 가운데 유리 알약(탭 4개) · 안 쓰면 작게 줄고 양옆에 찾기 · 새 대화 · 대화 안에선 숨김 */
.tabbar, .tb-side { display: none; }
:root.in-phone .tabbar {
  position: fixed; z-index: 60; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 8px); transform: translateX(-50%);
  display: flex; align-items: center; padding: 5px; border-radius: 31px; width: 266px; height: 62px; box-sizing: border-box;
  background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--line), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: width 0.45s cubic-bezier(.32,.72,0,1), height 0.45s cubic-bezier(.32,.72,0,1), bottom 0.45s cubic-bezier(.32,.72,0,1), padding 0.45s, border-radius 0.45s, opacity 0.25s, transform 0.35s cubic-bezier(.32,.72,0,1);
}
:root.in-phone .tabbar .tab { flex: 1; height: 100%; border: none; border-radius: 26px; background: transparent; color: var(--text); display: grid; place-items: center; transition: background 0.25s; padding: 0; }
:root.in-phone .tabbar .tab svg { width: 25px; height: 25px; transition: width 0.45s cubic-bezier(.32,.72,0,1), height 0.45s cubic-bezier(.32,.72,0,1); }
:root.in-phone .tabbar .tab { position: relative; z-index: 1; }
:root.in-phone .tabbar.tb-mini { width: 176px; height: 48px; padding: 4px; border-radius: 24px; bottom: calc(env(safe-area-inset-bottom) + 15px); }
:root.in-phone .tabbar.tb-mini .tab svg { width: 19px; height: 19px; }
:root.in-phone .tb-side {
  position: fixed; z-index: 60; bottom: calc(env(safe-area-inset-bottom) + 13px); width: 52px; height: 52px; border-radius: 26px; border: none; color: var(--text);
  display: grid; place-items: center; opacity: 0; pointer-events: none;
  background: color-mix(in srgb, var(--bg) 62%, transparent); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 0.5px var(--line), 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: opacity 0.3s, transform 0.45s cubic-bezier(.32,.72,0,1);
}
:root.in-phone .tb-side svg { width: 21px; height: 21px; }
:root.in-phone .tb-side.l { left: 20px; transform: translateX(-30px) scale(0.7); }
:root.in-phone .tb-side.r { right: 20px; transform: translateX(30px) scale(0.7); }
:root.in-phone body.tab-mini .tb-side { opacity: 1; pointer-events: auto; transform: none; }
:root.in-phone body.tab-off .tabbar { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(24px); }
:root.in-phone body.tab-off .tb-side { opacity: 0 !important; pointer-events: none !important; }
/* 폰 목록 위 찾기 · 새 대화 줄은 아래 버튼으로 대신 */
:root.in-phone .home2 .vb2-head { display: none; }
/* 목록 위 기능 줄은 폰에선 탭 막대로 대신 · 내용이 막대에 안 가리게 */
:root.in-phone .home2 .vb2-feats { display: none; }
:root.in-phone .home2 { padding-bottom: calc(env(safe-area-inset-bottom) + 84px); }
:root.in-phone #pageView { padding-bottom: calc(env(safe-area-inset-bottom) + 84px); }
:root.in-phone #settingsBody { padding-bottom: calc(env(safe-area-inset-bottom) + 96px) !important; }

/* 폰 목록 제목: 큰 "대화"(왼쪽 위) → 내리면 위 가운데 작은 "대화" */
.vb2-big { display: none; }
:root.in-phone .home2 { position: relative; padding-top: 0; }
:root.in-phone .home2 .vb2-list { padding-top: calc(env(safe-area-inset-top) + 18px); }
:root.in-phone .vb2-big { display: block; margin: 0 0 6px; font-size: 34px; font-weight: 700; letter-spacing: -0.5px; line-height: 1.15; flex: none; }
:root.in-phone .vb2-small {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5; height: calc(env(safe-area-inset-top) + 44px); box-sizing: border-box;
  padding-top: env(safe-area-inset-top); display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 600; pointer-events: none; opacity: 0; transition: opacity 0.2s;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid transparent;
}
:root.in-phone .vb2-small.on { opacity: 1; border-bottom-color: var(--line); }

/* 탭 막대: 지금 탭 칸이 미끄러져 움직임 · 밀 때는 손가락 따라 */
:root.in-phone .tabbar { animation: none; flex-direction: row; touch-action: none; }
:root.in-phone .tb-ind { position: absolute; left: 0; top: 5px; bottom: 5px; border-radius: 26px; background: color-mix(in srgb, var(--text) 16%, transparent); opacity: 0; transition: transform 0.42s cubic-bezier(.32,.72,0,1), width 0.42s cubic-bezier(.32,.72,0,1), opacity 0.2s, top 0.45s, bottom 0.45s; pointer-events: none; }
:root.in-phone .tb-ind.show { opacity: 1; }
:root.in-phone .tabbar.tb-mini .tb-ind { top: 4px; bottom: 4px; }
:root.in-phone .tabbar.dragging .tb-ind { transition: width 0.2s, opacity 0.2s; transform-origin: center; background: color-mix(in srgb, var(--text) 24%, transparent); }
:root.in-phone .tabbar.dragging { transform: translateX(-50%) scale(1.04); }

/* 대화·화면 열 때 애니메이션 */
@keyframes vxEnter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes vxEnterPhone { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: none; } }
#messages.enter, #pageView.enter { animation: vxEnter 0.38s cubic-bezier(.32,.72,0,1); }
:root.in-phone #messages.enter, :root.in-phone #pageView.enter { animation: vxEnterPhone 0.38s cubic-bezier(.32,.72,0,1); }
@keyframes vxSheet { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
:root.in-phone .top-pop, :root.in-phone .ctx-menu, :root.in-phone .conv-menu { animation: vxSheet 0.34s cubic-bezier(.32,.72,0,1) !important; }
@keyframes vxPop { from { transform: scale(0.96); opacity: 0; } to { transform: none; opacity: 1; } }
:root:not(.in-phone) .ctx-menu, :root:not(.in-phone) .conv-menu { animation: vxPop 0.18s cubic-bezier(.32,.72,0,1); }
:root.in-phone .home2 .vb2-sec { padding-left: 2px; padding-right: 2px; }
:root.in-phone .home2 .vb2-list { padding-top: calc(env(safe-area-inset-top) + 52px); }
:root.in-phone .vb2-big { margin-bottom: 10px; }

/* 대화 화면 빈 곳: 흑백 별과 궤도 */
:root { --mono-star: #3a3a3c; --mono-orbit: #636366; --mono-planet: #aeaeb2; }
:root[data-theme="simple-light"] { --mono-star: #d1d1d6; --mono-orbit: #aeaeb2; --mono-planet: #636366; }
.empty-mark .mono-mark { display: block; }
.mono-planet { transform-origin: 90px 87px; }

/* 폰: 대화 열기(오른쪽에서 밀려 들어옴) · 뒤로(왼쪽에서) · 옆에서 당기는 중 */
@keyframes vxPushIn { from { transform: translateX(100%); } to { transform: none; } }
@keyframes vxPopIn { from { transform: translateX(-28%); opacity: 0.6; } to { transform: none; opacity: 1; } }
:root.in-phone #main.push-in { animation: vxPushIn 0.36s cubic-bezier(.32,.72,0,1); }
:root.in-phone #main.pop-in { animation: vxPopIn 0.34s cubic-bezier(.32,.72,0,1); }
:root.in-phone #main.swiping { box-shadow: -12px 0 30px rgba(0, 0, 0, 0.45); }
:root.in-phone #main.push-in #messages.enter, :root.in-phone #main.push-in #pageView.enter { animation: none; }
/* 맥: 대화를 열면 내용이 아래에서 부드럽게 */
:root:not(.in-phone) #messages.enter { animation: vxEnter 0.4s cubic-bezier(.32,.72,0,1); }

/* ===== 폰: 위 막대·목록 제목은 네모 대신 흐린 유리 (아래 내용이 비쳐 보이게) ===== */
:root.in-phone #topbar { position: absolute; top: 0; left: 0; right: 0; z-index: 20; background: transparent; }
:root.in-phone #topbar::before, :root.in-phone .vb2-small::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: -24px; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 78%, transparent) 0%, color-mix(in srgb, var(--bg) 40%, transparent) 65%, transparent 100%);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%); mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
:root.in-phone #messages { padding-top: calc(env(safe-area-inset-top) + 66px); }
:root.in-phone #main.page-on:not(.home-on) #pageView { padding-top: calc(env(safe-area-inset-top) + 62px); }
:root.in-phone .vb2-small { background: transparent !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; border-bottom: none !important; }
:root.in-phone .vb2-small::before { opacity: 0; transition: opacity 0.2s; }
:root.in-phone .vb2-small.on::before { opacity: 1; }
/* 목록 끝까지 아래 탭 막대 밑으로 지나가게 */
:root.in-phone .home2 { padding-bottom: 0 !important; }
:root.in-phone .home2 .vb2-list { padding-bottom: calc(env(safe-area-inset-bottom) + 110px); }

/* ===== 대화 줄: 프로젝트 대화면 오른쪽 아래 그 프로젝트 색 점 ===== */
.vb2-row { position: relative; }
.vb2-row .pdot { position: absolute; right: 10px; bottom: 11px; width: 8px; height: 8px; border-radius: 4px; }
:root.in-phone .home2 .vb2-row .pdot { right: 4px; bottom: 13px; }

/* ===== 꾹 눌렀을 때 메뉴 (폰) ===== */
.cm-dim { position: fixed; inset: 0; z-index: 29; background: rgba(0, 0, 0, 0.35); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: cmDimIn 0.22s ease; }
.cm-dim.out { animation: cmDimIn 0.2s ease reverse forwards; }
@keyframes cmDimIn { from { opacity: 0; } to { opacity: 1; } }
:root.in-phone .conv-menu { z-index: 30 !important; background: color-mix(in srgb, var(--surface-2) 92%, transparent) !important; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: none !important; padding: 8px 10px 12px !important; }
:root.in-phone .conv-menu.out { animation: cmSheetOut 0.2s ease forwards !important; }
@keyframes cmSheetOut { to { transform: translateY(40px); opacity: 0; } }
.cm-head { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 12px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.cm-head::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 25%, transparent); margin-bottom: 8px; }
.cm-head b { font-size: 1em; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-head span { display: flex; align-items: center; gap: 5px; font-size: 0.8em; color: var(--muted); }
.cm-head span i { width: 7px; height: 7px; border-radius: 4px; }
:root.in-phone .conv-menu button { min-height: 50px !important; font-size: 1.02em !important; padding: 0 14px !important; gap: 12px !important; border-radius: 14px !important; animation: cmItemIn 0.3s cubic-bezier(.32,.72,0,1) both; }
:root.in-phone .conv-menu button:nth-of-type(2) { animation-delay: 0.03s; }
:root.in-phone .conv-menu button:nth-of-type(3) { animation-delay: 0.06s; }
:root.in-phone .conv-menu button:nth-of-type(4) { animation-delay: 0.09s; }
:root.in-phone .conv-menu button:nth-of-type(5) { animation-delay: 0.12s; }
:root.in-phone .conv-menu button:nth-of-type(6) { animation-delay: 0.15s; }
@keyframes cmItemIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
:root.in-phone .conv-menu button svg { width: 19px !important; height: 19px !important; }
:root.in-phone .conv-menu button:active { background: var(--surface-3); transform: scale(0.98); }
/* 누른 대화 줄은 살짝 떠오름 */
.vb2-row { transition: transform 0.25s cubic-bezier(.32,.72,0,1), background 0.2s; }
.vb2-row.lifted { transform: scale(1.03); background: color-mix(in srgb, var(--text) 8%, transparent) !important; border-radius: 14px; z-index: 31; }
.vb2-row:active { transform: scale(0.985); }

/* ===== 그 밖의 부드러운 움직임 ===== */
.vb2-row { animation: rowIn 0.35s cubic-bezier(.32,.72,0,1) both; }
@keyframes rowIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.vb2-feat .fi, .vb2-search, .tb-glass, #composer .icon-btn, #composer .send { transition: transform 0.18s cubic-bezier(.32,.72,0,1), background 0.2s; }
.vb2-feat:active .fi, .vb2-search:active, .tb-glass:active, #composer .icon-btn:active, #composer .send:active { transform: scale(0.9); }
.msg { animation: rise 0.35s cubic-bezier(.32,.72,0,1); }

/* 대답 복사 버튼 (시간 줄 오른쪽) */
.msg .meta { display: flex; align-items: center; gap: 8px; }
.copy-btn { width: 26px; height: 26px; border-radius: 8px; display: inline-grid; place-items: center; color: var(--muted); opacity: 0; transition: opacity 0.2s, background 0.2s, transform 0.15s; }
.copy-btn svg { width: 14px; height: 14px; }
.msg.assistant:hover .copy-btn, :root.in-phone .copy-btn { opacity: 1; }
.copy-btn:hover { background: var(--surface-2); color: var(--text); }
.copy-btn:active { transform: scale(0.88); }
.copy-btn.done { color: var(--ok); opacity: 1; }

/* 폰: 꾹 눌러 글자 고르기는 대화 내용·파일·입력칸에서만 (목록·버튼·막대에선 안 됨) */
:root.in-phone body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
:root.in-phone .msg .bubble, :root.in-phone .msg .bubble *, :root.in-phone input, :root.in-phone textarea, :root.in-phone [contenteditable], :root.in-phone #artifactBody, :root.in-phone #artifactBody *, :root.in-phone .ns-card, :root.in-phone .ns-card * {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
/* 메뉴 시트는 아래 탭 막대보다 위에 */
.cm-dim { z-index: 65 !important; }
:root.in-phone .conv-menu { z-index: 70 !important; }
.vb2-row.lifted { z-index: 66; }

/* ===== 스크롤 막대 숨기기 ===== */
*::-webkit-scrollbar { width: 0 !important; height: 0 !important; display: none; }
* { scrollbar-width: none; }

/* ===== 큰 "대화" 제목 = 날짜별/프로젝트별 고르기 ===== */
.vb2-big { display: flex !important; align-items: baseline; gap: 6px; border: none; background: none; color: var(--text); font: inherit; text-align: left; padding: 0; cursor: pointer; flex: none; }
.vb2-big > span { font-size: 1.25em; font-weight: 700; }
.vb2-big svg { width: 12px; height: 12px; transform: rotate(90deg); color: var(--muted); align-self: center; transition: transform 0.2s; }
.vb2-big em { font-style: normal; font-size: 0.72em; color: var(--muted); font-weight: 500; }
#side2 .vb2-big { margin: 8px 10px 2px; }
:root.in-phone .vb2-big { margin: 0 0 6px !important; }
:root.in-phone .vb2-big > span { font-size: 34px; letter-spacing: -0.5px; line-height: 1.15; }
:root.in-phone .vb2-big svg { width: 16px; height: 16px; }
:root.in-phone .vb2-big em { font-size: 13px; }
.vb2-big:active { opacity: 0.6; }

/* ===== 대답 중 로고: 크고 조금 밝게 ===== */
.orbit-loader { height: 64px !important; margin: 0 0 6px !important; }
.orbit-loader .mono-mark { --mono-star: #48484a; --mono-orbit: #8e8e93; --mono-planet: #e5e5ea; }
:root[data-theme="simple-light"] .orbit-loader .mono-mark { --mono-star: #c7c7cc; --mono-orbit: #8e8e93; --mono-planet: #48484a; }
:root { --mono-star: #48484a; --mono-orbit: #7c7c80; --mono-planet: #c7c7cc; }

/* ===== 폰 아래쪽도 흐린 유리: 목록 끝 · 대화 입력줄 뒤 ===== */
:root.in-phone .home2::after {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; height: calc(env(safe-area-inset-bottom) + 96px); z-index: 50; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 70%, transparent) 0%, color-mix(in srgb, var(--bg) 30%, transparent) 55%, transparent 100%);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  -webkit-mask-image: linear-gradient(to top, #000 45%, transparent 100%); mask-image: linear-gradient(to top, #000 45%, transparent 100%);
}
:root.in-phone #island { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; }
:root.in-phone #island::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; top: -28px; z-index: -1; pointer-events: none;
  background: linear-gradient(to top, color-mix(in srgb, var(--bg) 78%, transparent) 0%, color-mix(in srgb, var(--bg) 40%, transparent) 60%, transparent 100%);
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  -webkit-mask-image: linear-gradient(to top, #000 55%, transparent 100%); mask-image: linear-gradient(to top, #000 55%, transparent 100%);
}
:root.in-phone #messages { padding-bottom: calc(env(safe-area-inset-bottom) + 120px) !important; }
/* 폰: 작은 고르기 창(날짜별/프로젝트별 등)도 탭 막대 위 · 불투명한 유리 */
:root.in-phone .ctx-menu { z-index: 70 !important; background: color-mix(in srgb, var(--surface-2) 94%, transparent) !important; backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); border: 1px solid var(--line); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); animation: vxSheet 0.3s cubic-bezier(.32,.72,0,1); }
:root.in-phone .ctx-menu button { min-height: 50px; font-size: 1.02em; border-radius: 14px; }

/* 위 막대 가운데 흑백 로고 */
.tb-mark { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; display: grid; place-items: center; opacity: 0.95; }
#topbar { position: relative; }
:root.in-phone #topbar { position: absolute; }
:root.in-phone .tb-mark { top: calc(env(safe-area-inset-top) + 6px + 22px); }
.tb-mark .mono-mark { --mono-star: #48484a; --mono-orbit: #8e8e93; --mono-planet: #e5e5ea; display: block; }
:root[data-theme="simple-light"] .tb-mark .mono-mark { --mono-star: #c7c7cc; --mono-orbit: #8e8e93; --mono-planet: #48484a; }
#main.page-on .tb-mark { display: none; }

/* 설정은 위·아래 흐린 막대보다 위에 (폰) — 탭 막대만 그 위 */
:root.in-phone #settings { z-index: 55 !important; }

/* 탭 막대 끌기: 칸이 손가락을 바로 따라오게 */
:root.in-phone .tb-ind { will-change: transform, width; }
:root.in-phone .tabbar.dragging .tb-ind { transition: transform 0.06s linear, width 0.15s ease, opacity 0.2s !important; }
:root.in-phone .tabbar.dragging { transition: transform 0.25s cubic-bezier(.32,.72,0,1); }

/* 대화 화면 가운데 흑백 로고 (늘 뒤에 깔림) — 위 막대 로고는 없앰 */
.tb-mark { display: none !important; }
#main { position: relative; }
.chat-mark { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); pointer-events: none; z-index: 0; display: grid; place-items: center; }
.chat-mark .mono-mark { display: block; }
#messages { position: relative; z-index: 1; }
#main.page-on .chat-mark { display: none; }
.empty-mark { display: none !important; }

/* 탭 막대 끌기: 손가락을 그대로 따라오게 (끄는 동안 막대 크기·칸 움직임 효과 없음) */
:root.in-phone .tabbar, :root.in-phone .tabbar * { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
:root.in-phone .tabbar.dragging { transform: translateX(-50%) !important; }
:root.in-phone .tabbar.dragging .tb-ind { transition: none !important; }
:root.in-phone .tabbar:not(.dragging) .tb-ind { transition: transform 0.38s cubic-bezier(.32,.72,0,1), width 0.38s cubic-bezier(.32,.72,0,1), opacity 0.2s, top 0.45s, bottom 0.45s; }
:root.in-phone .tabbar .tab { -webkit-tap-highlight-color: transparent; }
:root.in-phone * { -webkit-tap-highlight-color: transparent; }

/* 폰: 설정 열고 닫을 때 튀는 효과 없음 (탭 막대로 오갈 때 깜빡임 없게) */
:root.in-phone #settings, :root.in-phone #settings.closing { animation: none !important; }
:root.in-phone #pageView .page, :root.in-phone #pageView > * { animation: none; }

/* Liquid Glass: 설정 위 제목 띠는 바탕과 같은 유리로 (검게 뜨던 것), 맥 왼쪽 목록은 창 유리가 그대로 비치게 */
:root.glass #setHead { background: transparent !important; -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
:root.glass { --side-bg: transparent; }
:root.glass:not(.in-panel) #sidebar { background: transparent !important; border-right: 1px solid var(--glass-edge); }
:root.glass .vb2-row.on { background: color-mix(in srgb, var(--text) 12%, transparent); }
:root.glass .vb2-row:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
:root[data-theme="glass-light"] .vb2-feat .fi { background: rgba(255, 255, 255, 0.6); box-shadow: inset 0 1px 0 #fff, 0 0 0 0.5px rgba(20, 30, 60, 0.12); }
:root.glass .chat-mark .mono-mark { --mono-star: rgba(255, 255, 255, 0.16); --mono-orbit: rgba(255, 255, 255, 0.32); --mono-planet: rgba(255, 255, 255, 0.6); }
:root[data-theme="glass-light"] .chat-mark .mono-mark { --mono-star: rgba(20, 30, 60, 0.12); --mono-orbit: rgba(20, 30, 60, 0.28); --mono-planet: rgba(20, 30, 60, 0.5); }

/* ===== 폰 대화 줄 밀기: 왼쪽 → 옮기기·삭제, 오른쪽 → 고정 ===== */
.sw { position: relative; overflow: hidden; border-radius: 14px; flex: none; animation: rowIn 0.35s cubic-bezier(.32,.72,0,1) both; }
.sw > .vb2-row { animation: none !important; position: relative; z-index: 1; background: var(--bg); touch-action: pan-y; will-change: transform; }
:root.glass .sw > .vb2-row { background: transparent; }
.sw-acts { position: absolute; top: 0; bottom: 0; display: flex; z-index: 0; opacity: 0; transition: opacity 0.15s; }
.sw.open-r .sw-acts.r, .sw.open-l .sw-acts.l { opacity: 1; }
.sw-acts.r { right: 0; }
.sw-acts.l { left: 0; }
.sw-btn { width: 74px; height: 100%; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font: inherit; font-size: 12px; font-weight: 600; color: #fff; }
.sw-btn svg { width: 20px; height: 20px; }
.sw-btn.pin { background: #ff9f0a; width: 78px; }
.sw-btn.move { background: #5e5ce6; }
.sw-btn.del { background: #ff3b30; }
.sw-btn.del.armed { background: #d70015; }
.sw-btn:active { filter: brightness(0.9); }
.sw.leaving { animation: swOut 0.28s ease forwards; }
@keyframes swOut { to { opacity: 0; transform: translateX(-40%); height: 0; } }
:root.in-phone .home2 .sw .vb2-row { padding-left: 2px; padding-right: 2px; }

/* 폰: 꾹 누르면 뜨는 말풍선 메뉴 (아이폰 복사하기 모양) */
.callout { position: fixed; z-index: 120; filter: drop-shadow(0 6px 18px rgba(0,0,0,.35)); animation: coIn .18s cubic-bezier(.32,.72,0,1); transform-origin: 50% 100%; }
.callout.below { transform-origin: 50% 0; }
.callout.out { animation: coOut .15s ease forwards; }
.co-bar { display: flex; max-width: calc(100vw - 16px); overflow-x: auto; scrollbar-width: none; border-radius: 10px; background: rgba(44,44,46,.96); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.co-bar::-webkit-scrollbar { display: none; }
.co-bar button { flex: none; padding: 10px 14px; background: none; border: 0; color: #fff; font-size: 14px; white-space: nowrap; }
.co-bar button + button { border-left: 1px solid rgba(255,255,255,.18); }
.co-bar button:active { background: rgba(255,255,255,.14); }
.co-arrow { position: absolute; top: 100%; width: 0; height: 0; margin-left: -8px; border: 8px solid transparent; border-top-color: rgba(44,44,46,.96); border-bottom: 0; }
.callout.below .co-arrow { top: auto; bottom: 100%; border-top: 0; border-bottom: 8px solid rgba(44,44,46,.96); }
.vb2-row.co-on { background: var(--surface-2, rgba(127,127,127,.15)) !important; }
.vb2-row input { font: inherit; font-weight: 600; width: 100%; background: transparent; border: 0; border-bottom: 1px solid var(--line); color: var(--text); outline: none; padding: 0; }
@keyframes coIn { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@keyframes coOut { to { opacity: 0; transform: scale(.92); } }

/* 폰 Liquid Glass 설정: 위 머리말이 네모로 진하게 보이던 것 → 흐림 겹침 없이 부드럽게 사라지는 그라데이션 */
:root.glass.in-phone #setHead { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: linear-gradient(to bottom, var(--glass-sheet) 0%, var(--glass-sheet) 45%, transparent 100%) !important; box-shadow: none !important; border: 0 !important; }

/* 폰 Liquid Glass (실제 폰에서 보인 네모 두 개)
   ① 설정 머리말: 카드 폭 네모 → 화면 끝까지 넓히고, 위→아래로 사라지는 그라데이션만
   ② 입력창 뒤: #composer 자체 흐림이 네모 띠로 보임 → 흐림 없음 (버튼·입력칸은 각자 유리) */
:root.glass.in-phone #setHead { margin-left: -24px; margin-right: -24px; padding-left: 24px; padding-right: 24px; background: linear-gradient(to bottom, var(--glass-sheet) 0%, var(--glass-sheet) 55%, transparent 100%) !important; }
:root.glass.in-phone #composer { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
:root.glass.in-phone #composer::before { display: none !important; }
:root.glass.in-phone #composer:focus-within { box-shadow: none !important; border-color: transparent !important; }

/* 탭 표시 칸: 막대 크기의 비율로 → 막대가 커지고 줄 때 정확히 같이 움직인다 (예전엔 px로 뒤쫓아서 느렸음) */
:root.in-phone .tabbar:not(.dragging) .tb-ind { left: 5px; width: calc((100% - 10px) / var(--n, 4)); transition: transform 0.38s cubic-bezier(.32,.72,0,1), opacity 0.2s, left 0.45s cubic-bezier(.32,.72,0,1), width 0.45s cubic-bezier(.32,.72,0,1), top 0.45s cubic-bezier(.32,.72,0,1), bottom 0.45s cubic-bezier(.32,.72,0,1) !important; }
:root.in-phone .tabbar.tb-mini:not(.dragging) .tb-ind { left: 4px; width: calc((100% - 8px) / var(--n, 4)); }
:root.in-phone .tabbar { transition: width 0.45s cubic-bezier(.32,.72,0,1), height 0.45s cubic-bezier(.32,.72,0,1), bottom 0.45s cubic-bezier(.32,.72,0,1), padding 0.45s cubic-bezier(.32,.72,0,1), border-radius 0.45s cubic-bezier(.32,.72,0,1), opacity 0.25s, transform 0.35s cubic-bezier(.32,.72,0,1); }
/* 맥 Liquid Glass도 같은 네모 띠: 입력창 묶음(#composer) 자체 유리 없앰 — +·입력칸·마이크가 각자 유리 */
:root.glass #composer { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; background: transparent !important; box-shadow: none !important; border-color: transparent !important; }
:root.glass #composer::before { display: none !important; }
:root.glass #composer:focus-within { box-shadow: none !important; border-color: transparent !important; }
:root.glass #composer:focus-within textarea { box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
