:root {
  color-scheme: dark;
  --bg: #080b11;
  --surface: #0f141f;
  --surface-2: #161d2b;
  --border: rgba(255, 255, 255, 0.075);
  --gold: #7dd3fc;
  --mint: #34d399;
  --coral: #f87171;
  --blue: #60a5fa;
  --indigo: #818cf8;
  --text: #f1f5f9;
  --muted: #8b9bb0;
  --font: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", "Pretendard Variable", ui-monospace, SFMono-Regular, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  height: 100%;
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  font-synthesis: none;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

strong,
b {
  font-weight: 560;
  font-synthesis: none;
}

.hidden {
  display: none !important;
}

.chat-app-shell {
  max-width: min(1540px, 100vw);
  width: 100%;
  min-width: 0;
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  box-sizing: border-box;
  background:
    radial-gradient(1100px 420px at 50% -12%, rgba(56, 189, 248, 0.08), transparent 60%),
    radial-gradient(800px 380px at 88% 8%, rgba(99, 102, 241, 0.055), transparent 60%),
    var(--bg);
  border-left: 1px solid rgba(255, 255, 255, 0.065);
  border-right: 1px solid rgba(255, 255, 255, 0.065);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.65);
}

body[data-main-tab="observe"] .chat-app-shell,
body[data-main-tab="infra"] .chat-app-shell {
  max-width: min(1540px, 100vw);
}

.chat-panel-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.dashboard-panel-wrap {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px;
  overflow-y: auto;
  overflow-x: hidden;
}

body[data-main-tab="chat"] #tab-panel-dashboard {
  display: none !important;
}

body[data-main-tab="observe"] #tab-panel-chat,
body[data-main-tab="infra"] #tab-panel-chat {
  display: none !important;
}

body[data-main-tab="observe"] #dash-subview-observe {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  padding-bottom: 24px;
}

body[data-main-tab="observe"] #dash-subview-infra {
  display: none !important;
}

body[data-main-tab="infra"] #dash-subview-infra {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex-shrink: 0;
  padding-bottom: 24px;
}

body[data-main-tab="infra"] #dash-subview-observe {
  display: none !important;
}

.menu-dropdown-wrap {
  position: relative;
}

.back-home-pill {
  border-color: rgba(52, 211, 153, 0.45);
  background: rgba(16, 185, 129, 0.14);
  color: #a7f3d0;
  font-weight: 600;
}

body[data-main-tab="observe"] .back-home-pill,
body[data-main-tab="infra"] .back-home-pill {
  border-color: rgba(52, 211, 153, 0.65);
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.24), rgba(59, 130, 246, 0.2));
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(16, 185, 129, 0.22);
}

.action-pill.active-main-tab {
  border-color: rgba(96, 165, 250, 0.5);
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.22), rgba(99, 102, 241, 0.18));
  color: #f8fafc;
  font-weight: 600;
  box-shadow: 0 2px 12px rgba(59, 130, 246, 0.18);
}

body[data-main-tab="observe"] .chat-only-pill,
body[data-main-tab="infra"] .chat-only-pill {
  display: none !important;
}

.top-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 316px;
  background: rgba(15, 20, 32, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(18px);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  z-index: 300;
}

.menu-popover-item {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.menu-popover-item:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.14);
}

.menu-popover-item strong {
  font-size: 0.86rem;
  color: #f8fafc;
}

.menu-popover-item span {
  font-size: 0.74rem;
  color: var(--muted);
}

.topbar {
  position: relative;
  z-index: 150;
}

/* ==================== 상단 바 ==================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  width: 100%;
  box-sizing: border-box;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 18px 10px;
  background: rgba(10, 14, 22, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-shrink: 0;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.brand-emblem {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #f8fafc;
  border: 1px solid rgba(125, 211, 252, 0.55);
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-name {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: #f8fafc;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 8px var(--mint);
  flex-shrink: 0;
}

.ver-badge {
  font-family: var(--mono);
  font-size: 0.67rem;
  font-weight: 500;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.22);
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.brand-sub {
  font-size: 0.73rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.action-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 0.79rem;
  font-weight: 560;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: #dbe4f0;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.16s cubic-bezier(0.22, 1, 0.36, 1);
}

.action-pill:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transform: translateY(-0.5px);
}

.call-pill {
  border-color: rgba(56, 217, 169, 0.45);
  background: rgba(56, 217, 169, 0.14);
  color: #bbf7d0;
}

.call-pill.active-call {
  border-color: var(--coral);
  background: rgba(255, 107, 107, 0.22);
  color: #fecaca;
  animation: pulseBorder 1.5s infinite;
}

.dash-link-pill {
  border-color: rgba(148, 163, 184, 0.35);
  background: rgba(30, 41, 59, 0.85);
  color: #e2e8f0;
}

.pending-badge {
  background: var(--coral);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
}

/* ==================== 실시간 음성 통화 스테이지 ==================== */
.argos-stage {
  background: linear-gradient(180deg, rgba(18, 25, 40, 0.96), rgba(10, 14, 23, 0.96));
  border-bottom: 1px solid rgba(96, 165, 250, 0.25);
  padding: 16px;
  flex-shrink: 0;
}

.stage-inner {
  display: flex;
  align-items: center;
  gap: 18px;
}

.argos-orb {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.orb-visualizer {
  position: absolute;
  inset: -12px;
  width: 120px;
  height: 120px;
  pointer-events: none;
}

.orb-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(96, 165, 250, 0.5);
  animation: spinSlow 10s linear infinite;
}

.argos-orb[data-mode="LISTENING"] .orb-ring {
  border-color: var(--mint);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.45);
}

.argos-orb[data-mode="SPEAKING"] .orb-ring {
  border-color: var(--gold);
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.5);
}

.orb-core {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #f8fafc;
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 2;
}

.orb-logo-img {
  width: 84%;
  height: 84%;
  object-fit: contain;
}

.stage-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.stage-badge-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.orb-state-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(56, 217, 169, 0.16);
  color: var(--mint);
  border: 1px solid rgba(56, 217, 169, 0.35);
}

.voice-approval-hint {
  font-size: 0.75rem;
  font-weight: 600;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 3px 10px;
  border-radius: 999px;
}

.live-caption-box {
  background: rgba(9, 12, 20, 0.65);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
}

.caption-speaker {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--gold);
}

.caption-text {
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text);
  margin-top: 2px;
}

.stage-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.stage-btn {
  padding: 6px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.stage-btn.active {
  color: var(--text);
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.15);
}

.stage-btn.danger {
  color: #fecaca;
  border-color: rgba(255, 107, 107, 0.45);
  background: rgba(255, 107, 107, 0.16);
}

/* ==================== 메인 채팅 영역 ==================== */
.chat-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}

.chat-stream {
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}

.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  gap: 6px;
}

.msg-row.user {
  align-self: flex-end;
  align-items: flex-end;
}

.msg-row.argos {
  align-self: flex-start;
  align-items: flex-start;
  max-width: 94%;
  width: 100%;
}

.msg-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.76rem;
  color: var(--muted);
  padding: 0 4px;
}

.msg-meta strong {
  color: #e2e8f0;
  font-weight: 560;
  font-size: 0.81rem;
}

.msg-tag {
  font-size: 0.7rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.25);
  color: #93c5fd;
}

.msg-action-btn {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.msg-action-btn:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: #e0f2fe;
  background: rgba(59, 130, 246, 0.16);
}

.msg-quote-box {
  background: rgba(9, 12, 20, 0.45);
  border-left: 3px solid var(--blue);
  border-radius: 6px;
  padding: 6px 10px;
  margin-bottom: 6px;
  font-size: 0.78rem;
  color: #cbd5e1;
  line-height: 1.45;
  white-space: normal;
}

.msg-quote-box strong {
  color: #93c5fd;
  font-weight: 560;
  display: block;
  margin-bottom: 2px;
}

.msg-prev-diff {
  font-size: 0.75rem;
  color: #94a3b8;
  background: rgba(9, 12, 20, 0.38);
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 5px 10px;
  margin-bottom: 6px;
  white-space: pre-wrap;
}

.msg-edit-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: min(520px, 76vw);
}

.msg-edit-textarea {
  width: 100%;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(96, 165, 250, 0.5);
  background: #0b0f18;
  color: #f1f5f9;
  font-family: var(--font);
  font-size: 0.87rem;
  font-weight: 400;
  line-height: 1.55;
  resize: vertical;
}

.msg-edit-textarea:focus {
  outline: none;
  border-color: var(--gold);
}

.msg-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn-save-edit {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(56, 217, 169, 0.5);
  background: rgba(56, 217, 169, 0.22);
  color: #a7f3d0;
  font-size: 0.78rem;
  font-weight: 560;
  cursor: pointer;
}

.btn-cancel-edit {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
}

.reply-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(18, 26, 42, 0.95);
  border: 1px solid rgba(96, 165, 250, 0.4);
}

.reply-context-info {
  min-width: 0;
  flex: 1;
}

.reply-context-label {
  font-size: 0.73rem;
  font-weight: 560;
  color: #93c5fd;
  display: block;
}

.reply-context-preview {
  font-size: 0.8rem;
  color: #dce4ee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.reply-cancel-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-size: 0.78rem;
  cursor: pointer;
  flex-shrink: 0;
}

.msg-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 0.89rem;
  font-weight: 400;
  line-height: 1.66;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.msg-row.user .msg-bubble {
  white-space: pre-wrap;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #f8fafc;
  border-bottom-right-radius: 6px;
  border: 1px solid rgba(147, 197, 253, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 8px 24px rgba(15, 23, 42, 0.45);
  padding: 11px 16px;
  font-size: 0.88rem;
  font-weight: 400;
  line-height: 1.6;
}

.msg-row.argos .msg-bubble {
  white-space: normal;
  background: linear-gradient(180deg, rgba(19, 26, 40, 0.88), rgba(14, 19, 30, 0.92));
  color: #e2e8f0;
  border-top-left-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.32);
  padding: 18px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

/* ==================== 아르고스 리치 마크다운 · 다이어그램 · 표 스타일 ==================== */
.md-sec-title {
  font-size: 1.01rem;
  font-weight: 600;
  color: #f8fafc;
  margin: 6px 0 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  letter-spacing: -0.015em;
  line-height: 1.44;
}

.md-sec-title:first-child {
  margin-top: 0;
}

.md-para {
  margin: 0;
  color: #dce4ee;
  font-size: 0.89rem;
  font-weight: 400;
  line-height: 1.68;
}

.md-para strong,
.md-num-body strong,
.md-sub-item strong,
.md-rich-table strong {
  color: #f1f5f9;
  font-weight: 560;
}

.md-inline-code {
  font-family: var(--mono);
  font-size: 0.81rem;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(148, 163, 184, 0.14);
  border: 1px solid rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
}

/* 사진과 동일한 둥근 다크 다이어그램 박스 */
.md-diagram-card {
  background: #07090e;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px 20px;
  margin: 4px 0;
  overflow-x: auto;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 22px rgba(0, 0, 0, 0.45);
}

.md-diagram-card pre {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 400;
  line-height: 1.66;
  color: #dce4ee;
  white-space: pre;
  letter-spacing: -0.005em;
}

.md-diagram-card .diag-stage {
  color: #f8fafc;
  font-weight: 580;
}

.md-diagram-card .diag-arrow {
  color: #4ade80;
  font-weight: 500;
}

/* 번호별 + 부가 대답(○) 계층형 리스트 */
.md-num-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-top: 4px;
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.65;
}

.md-num-badge {
  font-weight: 580;
  color: #f1f5f9;
  min-width: 20px;
  flex-shrink: 0;
}

.md-num-body {
  flex: 1;
  min-width: 0;
  color: #e2e8f0;
}

.md-sub-list {
  list-style: none;
  padding-left: 28px;
  margin: 2px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.md-sub-item {
  position: relative;
  padding-left: 18px;
  color: #cbd5e1;
  font-size: 0.86rem;
  font-weight: 400;
  line-height: 1.64;
}

.md-sub-item::before {
  content: "○";
  position: absolute;
  left: 0;
  top: 1px;
  color: #94a3b8;
  font-size: 0.74rem;
}

/* 깔끔한 비교·현황 표 */
.md-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  margin: 4px 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.md-rich-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  font-weight: 400;
  background: #0c1018;
}

.md-rich-table th {
  background: rgba(51, 65, 85, 0.48);
  color: #e2e8f0;
  font-weight: 600;
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.md-rich-table td {
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  color: #dce4ee;
  font-weight: 400;
  vertical-align: top;
  line-height: 1.55;
}

.md-rich-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.md-rich-table tr:last-child td {
  border-bottom: none;
}

/* ==================== 인라인 결재 카드 (채팅 하단 고정 배너) ==================== */
.inline-approval-bar {
  margin: 0 14px 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(20, 29, 48, 0.98), rgba(14, 20, 34, 0.98));
  border: 1px solid rgba(96, 165, 250, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.approval-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.approval-badge {
  font-size: 0.74rem;
  font-weight: 580;
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.16);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: 999px;
}

.approval-voice-tip {
  font-size: 0.74rem;
  color: var(--mint);
  font-weight: 550;
}

.approval-card-title {
  font-size: 0.88rem;
  font-weight: 580;
  color: var(--text);
}

.approval-card-meta {
  font-family: var(--mono);
  font-size: 0.73rem;
  color: var(--muted);
}

.approval-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.btn-approve-inline {
  padding: 8px 14px;
  border-radius: 9px;
  border: 1px solid rgba(56, 217, 169, 0.5);
  background: rgba(56, 217, 169, 0.2);
  color: #a7f3d0;
  font-weight: 580;
  font-size: 0.82rem;
  cursor: pointer;
}

.btn-hold-inline {
  padding: 8px 12px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 550;
  font-size: 0.8rem;
  cursor: pointer;
}

.btn-dash-inline {
  margin-left: auto;
  font-size: 0.78rem;
  color: #93c5fd;
  text-decoration: none;
  font-weight: 550;
}

/* ==================== 하단 입력 바 (플로팅 필 디자인) ==================== */
.composer {
  padding: 10px 24px calc(16px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(8, 11, 17, 0.4), rgba(8, 11, 17, 0.96));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex-shrink: 0;
}

.quick-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.quick-row::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(20, 27, 40, 0.85);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.quick-chip:hover {
  border-color: rgba(96, 165, 250, 0.45);
  color: #ffffff;
  background: rgba(59, 130, 246, 0.14);
}

.composer-form {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #111723;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 16px;
  padding: 8px 12px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.42);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.composer-form:focus-within {
  border-color: rgba(96, 165, 250, 0.58);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.55), 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 1.02rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(96, 165, 250, 0.36);
}

.icon-btn.listening {
  border-color: var(--coral);
  background: rgba(255, 107, 107, 0.22);
  animation: pulseBorder 1.2s infinite;
}

#chat-input {
  flex: 1;
  min-width: 0;
  min-height: 52px !important;
  height: 52px;
  max-height: 180px;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.96rem;
  line-height: 1.5;
  resize: none;
  overflow-y: auto;
}

#chat-input::placeholder {
  color: transparent !important;
  opacity: 0 !important;
}

#chat-input:focus {
  outline: none;
}

.send-btn {
  height: 42px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1px solid rgba(56, 189, 248, 0.48);
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #f8fafc;
  font-weight: 700;
  font-size: 0.93rem;
  cursor: pointer;
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .composer-form {
    padding: 7px 10px;
    border-radius: 14px;
    gap: 8px;
  }
  .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }
  #chat-input {
    min-height: 46px !important;
    height: 46px;
    max-height: 150px;
    font-size: 0.91rem;
    padding: 6px 8px;
  }
  .send-btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 10px;
  }
}

/* ==================== 채팅 말풍선 내 인라인 이미지 프리뷰 카드 ==================== */
.md-inline-image-card {
  display: block;
  margin: 10px 0 12px 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(11, 17, 30, 0.88);
  border: 1px solid rgba(96, 165, 250, 0.28);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  max-width: 660px;
}

.md-inline-image-link {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  background: #070b14;
}

.md-inline-image {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 10px;
  transition: transform 0.18s ease;
}

.md-inline-image-link:hover .md-inline-image {
  transform: scale(1.012);
}

.md-inline-image-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  padding: 0 4px;
  font-size: 0.8rem;
  color: #cbd5e1;
  font-weight: 600;
}

.md-inline-image-hint {
  font-size: 0.73rem;
  color: #60a5fa;
  font-weight: 500;
}

/* ==================== 모달 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 200;
}

.modal-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-desc {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.5;
}

.pin-form {
  display: flex;
  gap: 8px;
}

.pin-form input {
  flex: 1;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
}

.auth-error {
  font-size: 0.8rem;
  color: var(--coral);
}

@keyframes spinSlow {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulseBorder {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.45);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(255, 107, 107, 0);
  }
}

/* ==================== Antigravity 스타일 Task Running 실시간 추론 상태 위젯 ==================== */
.agy-task-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, rgba(16, 24, 42, 0.96), rgba(12, 18, 32, 0.98));
  border: 1px solid rgba(56, 217, 169, 0.38);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  margin-bottom: 4px;
}

.agy-task-card.streaming-compact {
  padding: 8px 12px;
  margin-bottom: 10px;
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(15, 23, 42, 0.9);
}

.agy-task-card.interrupted {
  border-color: rgba(245, 158, 11, 0.48);
  background: linear-gradient(135deg, rgba(34, 26, 16, 0.95), rgba(22, 18, 13, 0.98));
}

.agy-task-header {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

.agy-task-spinner {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2.3px solid rgba(56, 217, 169, 0.2);
  border-top-color: #38d9a9;
  border-right-color: #60a5fa;
  animation: agySpin360 0.72s linear infinite;
  will-change: transform;
  flex-shrink: 0;
}

@keyframes agySpin360 {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.agy-task-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 0.69rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #38d9a9;
  background: rgba(56, 217, 169, 0.14);
  border: 1px solid rgba(56, 217, 169, 0.35);
  white-space: nowrap;
  flex-shrink: 0;
}

.agy-task-badge.streaming {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.16);
  border-color: rgba(96, 165, 250, 0.4);
}

.agy-task-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: agyDotPulse 1.1s ease-in-out infinite;
}

.agy-task-title {
  font-size: 0.83rem;
  font-weight: 540;
  color: #e2e8f0;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agy-task-timer {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.28);
  padding: 2px 7px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.agy-task-sub {
  font-size: 0.75rem;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.agy-task-progress-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.agy-task-progress-fill {
  height: 100%;
  width: 10%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38d9a9 0%, #60a5fa 60%, #818cf8 100%);
  box-shadow: 0 0 10px rgba(56, 217, 169, 0.45);
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.agy-task-pct {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: #38d9a9;
  white-space: nowrap;
  flex-shrink: 0;
}

.agy-stream-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  margin-left: 3px;
  vertical-align: middle;
  background: #38d9a9;
  border-radius: 2px;
  animation: agyDotPulse 0.8s step-end infinite;
}

.agy-retry-btn {
  padding: 5px 11px;
  border-radius: 7px;
  border: 1px solid rgba(56, 217, 169, 0.45);
  background: rgba(56, 217, 169, 0.16);
  color: #a7f3d0;
  font-size: 0.76rem;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
}

.agy-retry-btn:hover {
  background: rgba(56, 217, 169, 0.26);
}

@keyframes agyIndeterminateBar {
  0% {
    left: -45%;
  }
  100% {
    left: 105%;
  }
}

@keyframes agyDotPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.25;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    gap: 6px;
  }

  .brand-group {
    gap: 8px;
    flex: 1;
    min-width: 0;
  }

  .brand-emblem {
    width: 34px;
    height: 34px;
    border-radius: 10px;
  }

  .brand-name {
    font-size: 0.94rem;
  }

  .ver-badge {
    display: none !important;
  }

  .brand-sub {
    font-size: 0.68rem;
  }

  .topbar-actions {
    gap: 5px;
    flex-wrap: wrap;
  }

  .action-pill {
    padding: 6px 9px;
    font-size: 0.75rem;
    gap: 4px;
  }

  .top-menu-popover {
    width: min(300px, calc(100vw - 20px));
    right: 0;
  }

  .stage-inner {
    flex-direction: column;
    text-align: center;
  }

  .stage-badge-row,
  .stage-controls {
    justify-content: center;
  }

  .chat-stream {
    padding: 12px 12px;
    gap: 14px;
  }

  .msg-row {
    max-width: 94%;
    gap: 4px;
  }

  .msg-row.argos {
    max-width: 98%;
  }

  .msg-meta {
    gap: 4px;
    font-size: 0.72rem;
  }

  .msg-meta strong {
    font-size: 0.77rem;
  }

  .msg-tag,
  .msg-action-btn {
    font-size: 0.67rem;
    padding: 2px 6px;
  }

  .msg-bubble {
    padding: 11px 13px;
    font-size: 0.87rem;
    line-height: 1.54;
    border-radius: 14px;
  }

  .agy-task-card {
    padding: 10px 11px;
    gap: 6px;
  }

  .agy-task-header {
    flex-wrap: wrap;
    gap: 6px;
  }

  .agy-task-title {
    flex-basis: 100%;
    order: 5;
    white-space: normal;
    font-size: 0.79rem;
    line-height: 1.38;
  }

  .agy-task-pct {
    margin-left: auto;
  }

  .composer {
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 7px;
  }

  .quick-row {
    gap: 6px;
  }

  .quick-chip {
    padding: 5px 10px;
    font-size: 0.73rem;
  }

  .composer-form {
    padding: 5px 6px 5px 8px;
    gap: 5px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    font-size: 0.95rem;
  }

  #chat-input {
    min-height: 46px !important;
    height: 46px;
    padding: 6px 8px;
    font-size: 0.9rem;
  }

  .send-btn {
    height: 38px;
    padding: 0 15px;
    border-radius: 10px;
    font-size: 0.86rem;
  }

  .dashboard-panel-wrap {
    padding: 8px 10px;
    gap: 10px;
  }
}

/* ==================== Antigravity 스타일 프로젝트별 · 세션별 분리 워크스페이스 ==================== */
.chat-workspace-layout {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: row;
  position: relative;
  overflow: hidden;
}

.anti-session-sidebar {
  width: 288px;
  flex-shrink: 0;
  background: rgba(13, 18, 28, 0.96);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: width 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  z-index: 40;
}

.anti-session-sidebar.collapsed {
  width: 0;
  border-right: none;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.anti-sidebar-header {
  padding: 10px 12px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.anti-sidebar-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.anti-sidebar-title-row strong {
  font-size: 0.85rem;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.anti-sidebar-hdr-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.anti-new-grp-btn {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.4);
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anti-new-grp-btn:hover {
  background: rgba(59, 130, 246, 0.25);
  border-color: var(--blue);
}

.anti-new-sess-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 217, 169, 0.45);
  background: rgba(56, 217, 169, 0.15);
  color: #a7f3d0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.anti-new-sess-btn:hover {
  background: rgba(56, 217, 169, 0.28);
  border-color: var(--mint);
}

.anti-sidebar-hint {
  font-size: 0.67rem;
  color: #94a3b8;
  line-height: 1.3;
}

.anti-project-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.anti-sidebar-search-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}

.anti-session-search-input {
  flex: 1;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(9, 12, 20, 0.72);
  color: #f8fafc;
  font-size: 0.74rem;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.12s ease;
}

.anti-session-search-input:focus {
  border-color: var(--mint);
}

.anti-toggle-groups-btn {
  padding: 5px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  font-size: 0.69rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.12s ease;
}

.anti-toggle-groups-btn:hover {
  border-color: rgba(96, 165, 250, 0.5);
  color: #e0f2fe;
  background: rgba(59, 130, 246, 0.14);
}

.anti-proj-chip {
  padding: 3px 7px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 0.69rem;
  cursor: pointer;
  transition: all 0.12s ease;
}

.anti-proj-chip:hover {
  color: #f8fafc;
  border-color: rgba(96, 165, 250, 0.4);
}

.anti-proj-chip.active {
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(96, 165, 250, 0.5);
  color: #dbeafe;
  font-weight: 600;
}

/* 새 세션 인라인 생성 폼 */
.anti-new-session-form {
  margin: 8px 10px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(24, 34, 52, 0.95);
  border: 1px solid rgba(56, 217, 169, 0.35);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.anti-form-label {
  font-size: 0.71rem;
  color: #cbd5e1;
  font-weight: 560;
}

.anti-form-select,
.anti-form-input {
  width: 100%;
  padding: 6px 8px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #0f1623;
  color: #f8fafc;
  font-size: 0.78rem;
  font-family: var(--font);
  outline: none;
}

.anti-form-select:focus,
.anti-form-input:focus {
  border-color: var(--mint);
}

.anti-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 2px;
}

.anti-btn-cancel {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--muted);
  font-size: 0.74rem;
  cursor: pointer;
}

.anti-btn-create {
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(56, 217, 169, 0.5);
  background: rgba(56, 217, 169, 0.2);
  color: #a7f3d0;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

/* 프로젝트별 세션 트리 */
.anti-session-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.anti-proj-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid transparent;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.anti-proj-group.anti-unbundled-zone {
  background: rgba(255, 255, 255, 0.015);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 5px 4px 6px;
  margin-bottom: 2px;
}

.anti-proj-group.drag-over {
  border-color: rgba(56, 217, 169, 0.75) !important;
  background: rgba(56, 217, 169, 0.1) !important;
}

.anti-proj-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.01em;
  border-radius: 6px;
  user-select: none;
}

.anti-proj-group-header:hover {
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
}

.anti-proj-group-header.unbundled-header {
  color: #cbd5e1;
}

.anti-grp-title-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  min-width: 0;
  flex: 1;
}

.anti-grp-chevron {
  font-size: 0.7rem;
  width: 11px;
  display: inline-block;
  color: #64748b;
}

.anti-grp-title-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anti-grp-cnt {
  font-size: 0.67rem;
  color: #64748b;
  font-weight: 500;
}

.anti-grp-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.anti-proj-group-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.anti-empty-drop-hint {
  padding: 6px 8px;
  font-size: 0.7rem;
  color: var(--muted);
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.08);
  text-align: center;
}

.anti-proj-quick-add,
.anti-grp-menu-btn,
.anti-sess-menu-btn {
  padding: 1px 6px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.12s ease;
  line-height: 1.3;
}

.anti-proj-quick-add:hover,
.anti-grp-menu-btn:hover,
.anti-sess-menu-btn:hover {
  border-color: var(--mint);
  color: #a7f3d0;
  background: rgba(56, 217, 169, 0.16);
}

.anti-sess-item.dragging {
  opacity: 0.45;
  border-color: var(--mint);
}

.anti-sess-spinner {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 2px solid rgba(56, 189, 248, 0.24);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spinSlow 0.75s linear infinite;
  flex-shrink: 0;
}

.anti-sess-unread-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.5);
  color: #34d399;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.anti-sess-pin {
  font-size: 0.66rem;
  flex-shrink: 0;
}

.anti-inline-rename-input {
  width: 100%;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--mint);
  background: #0b111d;
  color: #f8fafc;
  font-size: 0.78rem;
  font-family: var(--font);
  outline: none;
}

/* Antigravity 스타일 플로팅 우클릭/좌클릭(⋯) 컨텍스트 메뉴 */
.anti-context-menu {
  position: fixed;
  z-index: 9999;
  min-width: 248px;
  max-width: 300px;
  background: rgba(14, 19, 30, 0.98);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 2px;
  backdrop-filter: blur(16px);
}

.anti-ctx-header {
  padding: 5px 8px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #93c5fd;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anti-ctx-sec-label {
  padding: 4px 8px 2px;
  font-size: 0.66rem;
  font-weight: 600;
  color: #94a3b8;
  text-transform: uppercase;
}

.anti-ctx-item {
  width: 100%;
  text-align: left;
  padding: 6px 8px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #e2e8f0;
  font-size: 0.75rem;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.1s ease, color 0.1s ease;
}

.anti-ctx-item:hover {
  background: rgba(56, 217, 169, 0.16);
  color: #a7f3d0;
}

.anti-ctx-item.current {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  font-weight: 600;
}

.anti-ctx-item.highlight-unbundle {
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.12);
  font-weight: 600;
}

.anti-ctx-item.highlight-unbundle:hover {
  background: rgba(59, 130, 246, 0.24);
  color: #dbeafe;
}

.anti-ctx-item.danger {
  color: #fca5a5;
}

.anti-ctx-item.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.anti-ctx-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 3px 0;
}

.anti-ctx-proj-select-row {
  padding: 2px 6px 4px;
}

.anti-ctx-scroll-list {
  max-height: 150px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.anti-sess-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.14s ease;
}

.anti-sess-item:hover {
  background: rgba(255, 255, 255, 0.045);
  color: #f1f5f9;
}

.anti-sess-item.active {
  background: linear-gradient(90deg, rgba(59, 130, 246, 0.16) 0%, rgba(59, 130, 246, 0.05) 100%);
  border-color: rgba(96, 165, 250, 0.32);
  box-shadow: inset 2px 0 0 #60a5fa;
  color: #f8fafc;
}

.anti-sess-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.anti-sess-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.45);
  flex-shrink: 0;
}

.anti-sess-item.active .anti-sess-dot {
  background: #60a5fa;
  box-shadow: 0 0 6px rgba(96, 165, 250, 0.55);
}

.anti-sess-title {
  font-size: 0.79rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anti-sess-item.active .anti-sess-title {
  font-weight: 600;
}

.anti-sess-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.anti-sess-count {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--muted);
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.anti-sess-del-btn {
  padding: 1px 5px;
  border-radius: 4px;
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.7rem;
  cursor: pointer;
  opacity: 0.65;
}

.anti-sess-del-btn:hover {
  opacity: 1;
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.18);
}

/* 우측 대화 워크스페이스 메인 */
.chat-workspace-main {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.chat-session-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 6px 14px;
  background: rgba(14, 19, 30, 0.92);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(12px);
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.chat-ctx-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.chat-ctx-sidebar-btn {
  padding: 4px 9px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: rgba(255, 255, 255, 0.04);
  color: #e2e8f0;
  font-size: 0.74rem;
  font-weight: 550;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.14s ease;
}

.chat-ctx-sidebar-btn:hover {
  border-color: rgba(96, 165, 250, 0.45);
  color: #f8fafc;
  background: rgba(59, 130, 246, 0.12);
}

.chat-ctx-proj-badge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: #93c5fd;
  white-space: nowrap;
  flex-shrink: 0;
}

.chat-ctx-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #f8fafc;
  white-space: nowrap !important;
  text-wrap: nowrap !important;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}

.chat-ctx-path-badge {
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(52, 211, 153, 0.09);
  border: 1px solid rgba(52, 211, 153, 0.24);
  color: #6ee7b7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  flex-shrink: 2;
}

@media (max-width: 1480px) {
  .chat-ctx-path-badge {
    display: none;
  }
}

.chat-ctx-right {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.chat-ctx-act-btn {
  padding: 4px 7px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.035);
  color: #cbd5e1;
  font-size: 0.71rem;
  font-weight: 540;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.14s ease;
}

.chat-ctx-act-btn:hover {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(59, 130, 246, 0.12);
  color: #f8fafc;
}

.chat-ctx-act-btn.primary {
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(16, 185, 129, 0.14);
  color: #a7f3d0;
  font-weight: 600;
}

.chat-ctx-act-btn.primary:hover {
  background: rgba(16, 185, 129, 0.24);
  border-color: rgba(52, 211, 153, 0.6);
}

@media (max-width: 820px) {
  .topbar {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px;
    gap: 6px;
  }
  .brand-emblem {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }
  .brand-name {
    font-size: 0.95rem;
  }
  .brand-sub {
    font-size: 0.68rem;
  }
  .topbar-actions {
    width: 100%;
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .topbar-actions::-webkit-scrollbar {
    display: none;
  }
  .action-pill {
    flex: 1 1 auto;
    justify-content: center;
    padding: 6px 7px;
    font-size: 0.72rem;
    border-radius: 9px;
    gap: 3px;
  }
  .anti-session-sidebar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 276px;
    box-shadow: 12px 0 32px rgba(0, 0, 0, 0.65);
  }
  .chat-session-context-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 7px 10px;
  }
  .chat-ctx-left {
    width: 100%;
  }
  .chat-ctx-title {
    max-width: none;
    flex: 1;
  }
  .chat-ctx-right {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 5px;
  }
  .chat-ctx-right::-webkit-scrollbar {
    display: none;
  }
}

/* UI/UX Pro Max — 한국어 어절 보존(word-break: keep-all) & 타이포 균형(text-wrap) & 접근성 포커스 링 (v5.9.9.5) */
.msg-bubble,
.msg-content,
.modal-desc,
.menu-popover-item span {
  word-break: keep-all;
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

h1,
h2,
h3,
.brand-name {
  text-wrap: balance;
}

.ver-badge,
.pending-badge,
.agy-task-timer,
.agy-task-pct,
.anti-sess-count,
.anti-sess-unread-num,
.stat-pill {
  font-variant-numeric: tabular-nums;
}

.chat-ctx-act-btn.codex-jump-pill {
  border-color: rgba(129, 140, 248, 0.45);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(59, 130, 246, 0.14));
  color: #e0e7ff;
  font-weight: 600;
}

.chat-ctx-act-btn.codex-jump-pill:hover {
  border-color: rgba(165, 180, 252, 0.7);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.3), rgba(59, 130, 246, 0.24));
  color: #ffffff;
}

/* 슬림 다크 스크롤바 표준화 */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: rgba(8, 11, 17, 0.4);
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.22);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.4);
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(96, 165, 250, 0.85);
  outline-offset: 2px;
}
