*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #fafbfe; --surface: #ffffff; --surface2: #f0f2f8; --border: #e2e6f0;
  --text: #1e2a3a; --text-dim: #6b7b8d;
  --primary: #6c5ce7; --primary-light: #a29bfe; --primary-bg: #f0eeff;
  --accent: #00b894; --accent-bg: #e8faf5;
  --danger: #e17055; --warning: #fdcb6e; --success: #00b894;
  --radius: 16px; --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06); --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
}
body { font-family: 'Inter', -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; height: 100vh; overflow: hidden; }
a { color: var(--primary); text-decoration: none; }
html { height: 100%; overflow: hidden; }
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.page { display: none; flex: 1; }
.page.active { display: flex; }

/* Auth */
.auth-page { justify-content: center; align-items: center; padding: 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.auth-card { background: var(--surface); border-radius: 24px; padding: 48px 40px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 28px; font-weight: 800; text-align: center; }
.auth-card .subtitle { color: var(--text-dim); text-align: center; margin-bottom: 32px; font-size: 14px; }
.logo { text-align: center; margin-bottom: 16px; font-size: 48px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; }
.form-group input { width: 100%; padding: 12px 16px; background: var(--surface2); border: 2px solid transparent; border-radius: var(--radius-sm); color: var(--text); font-size: 15px; outline: none; transition: all 0.2s; }
.form-group input:focus { border-color: var(--primary); background: white; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 700; cursor: pointer; transition: all 0.2s; width: 100%; }
.btn-primary { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; box-shadow: 0 4px 15px rgba(108,92,231,0.3); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(108,92,231,0.4); }
.btn-primary:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--text); border: 2px solid var(--border); padding: 8px 16px; font-size: 13px; width: auto; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost { background: var(--primary-bg); color: var(--primary); border: none; padding: 8px 16px; font-size: 13px; width: auto; border-radius: 20px; cursor: pointer; transition: all 0.15s; font-weight: 600; }
.btn-ghost:hover { background: var(--primary); color: white; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 8px; text-align: center; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-dim); }
.auth-switch a { cursor: pointer; font-weight: 600; }

/* Dashboard layout */
.dashboard-page { flex-direction: column; height: 100vh; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); z-index: 10; }
.topbar-left { font-size: 18px; font-weight: 800; background: linear-gradient(135deg, #6c5ce7, #a29bfe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-name { color: var(--text-dim); font-size: 13px; }
.main-layout { display: flex; flex: 1; overflow: hidden; }

/* Session Panel (왼쪽) */
.session-panel { width: 260px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden; flex-shrink: 0; }
.session-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 8px; }
.session-header h3 { font-size: 13px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.btn-new-session { background: var(--primary); color: white; border: none; padding: 5px 12px; border-radius: 16px; font-size: 12px; font-weight: 700; cursor: pointer; transition: all 0.15s; }
.btn-new-session:hover { background: var(--primary-light); }
.session-list { flex: 1; overflow-y: auto; padding: 4px 8px; }
.session-divider { border-top: 1px solid var(--border); margin: 8px 16px; }
.mvp-list-mini { overflow-y: auto; padding: 4px 8px; max-height: 200px; }

.session-item { padding: 10px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 2px; transition: all 0.15s; display: flex; align-items: center; gap: 8px; }
.session-item:hover { background: var(--surface2); }
.session-item.active { background: var(--primary-bg); color: var(--primary); }
.session-item .session-icon { font-size: 14px; flex-shrink: 0; }
.session-delete { background: none; border: none; color: var(--text-dim); font-size: 12px; cursor: pointer; opacity: 0; transition: opacity 0.15s; padding: 4px; border-radius: 4px; flex-shrink: 0; }
.session-item:hover .session-delete { opacity: 1; }
.session-delete:hover { color: var(--danger); background: rgba(225,112,85,0.1); }
.session-item .session-info { min-width: 0; flex: 1; }
.session-item .session-title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-item .session-meta { font-size: 11px; color: var(--text-dim); }

.mvp-mini-item { padding: 8px 12px; border-radius: 8px; cursor: pointer; margin-bottom: 2px; transition: all 0.15s; }
.mvp-mini-item:hover { background: var(--surface2); }
.mvp-mini-item .mvp-mini-title { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mvp-mini-item .mvp-mini-meta { font-size: 11px; color: var(--text-dim); display: flex; align-items: center; gap: 4px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.status-dot.done { background: var(--success); }
.status-dot.draft { background: var(--text-dim); }
.status-dot.generating { background: var(--primary); animation: pulse 1.5s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

/* Chat Panel */
.chat-panel { flex: 1; display: flex; flex-direction: column; background: var(--bg); min-width: 0; }
.chat-messages { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.chat-welcome { text-align: center; padding: 80px 20px 40px; }
.chat-welcome .welcome-icon { font-size: 56px; margin-bottom: 12px; }
.chat-welcome h2 { font-size: 24px; font-weight: 800; background: linear-gradient(135deg, #6c5ce7, #a29bfe); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.chat-welcome p { color: var(--text-dim); margin: 8px 0 24px; font-size: 15px; }
.welcome-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.msg { max-width: 75%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.msg-user { align-self: flex-end; background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; border-bottom-right-radius: 4px; }
.msg-bot { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,0.03); }
.msg-bot strong { color: var(--primary); }
.msg-bot h3, .msg-bot h4 { margin: 10px 0 4px; color: var(--text); font-size: 14px; }
.msg-bot hr { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.msg-system { align-self: center; background: var(--primary-bg); color: var(--primary); font-size: 12px; padding: 6px 16px; border-radius: 16px; max-width: none; font-weight: 600; }
.msg-typing { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); padding: 12px 20px; border-radius: 16px; }
.typing-dots { display: flex; gap: 4px; }
.typing-dots span { width: 7px; height: 7px; background: var(--primary-light); border-radius: 50%; animation: bounce 1.4s ease-in-out infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce { 0%,80%,100%{transform:scale(0)} 40%{transform:scale(1)} }

/* MVP 양식 카드 (채팅 내) */
.msg-bot .mvp-card-inline { background: var(--surface2); border-radius: 12px; padding: 16px; margin: 8px 0; border-left: 4px solid var(--primary); }
.msg-bot .mvp-card-inline h4 { color: var(--primary); margin: 0 0 8px; font-size: 15px; }
.msg-bot .mvp-field { margin-bottom: 6px; }
.msg-bot .mvp-field-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.3px; }
.msg-bot .mvp-field-value { font-size: 13px; }
.msg-bot .mvp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.msg-bot .mvp-tag { background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; }
.msg-bot .mvp-score-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.mvp-score-badge.high { background: var(--accent-bg); color: var(--accent); }
.mvp-score-badge.mid { background: #fef9e7; color: #f39c12; }
.mvp-score-badge.low { background: #fdecea; color: var(--danger); }

/* 아키텍처 시각화 */
.arch-diagram { background: linear-gradient(135deg, #1a1d2e, #252a3a); border-radius: 12px; padding: 20px; margin: 12px 0; color: #e4e6f0; }
.arch-diagram.biz { background: linear-gradient(135deg, #1a2a1e, #1e3025); }
.arch-diagram.sys { background: linear-gradient(135deg, #1a1e2e, #1e2535); }
.arch-section-title { font-size: 14px; font-weight: 800; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.arch-icon { font-size: 18px; }

/* 기술 아키텍처 — 레이어 */
.arch-layer { padding: 8px 12px; margin-bottom: 4px; border-radius: 6px; background: rgba(255,255,255,0.03); }
.arch-layer-name { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.arch-layer-items { display: flex; gap: 6px; flex-wrap: wrap; }
.arch-chip { padding: 3px 10px; border: 1px solid; border-radius: 14px; font-size: 11px; font-weight: 600; background: rgba(255,255,255,0.04); }
.arch-connector-v { text-align: center; color: rgba(255,255,255,0.3); font-size: 14px; padding: 2px 0; }

/* 비즈니스 아키텍처 */
.biz-flow { display: flex; align-items: stretch; gap: 4px; margin-bottom: 16px; }
.biz-node { flex: 1; background: rgba(255,255,255,0.05); border-radius: 8px; padding: 12px; text-align: center; min-width: 0; }
.biz-node-icon { font-size: 24px; margin-bottom: 4px; }
.biz-node-label { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.biz-node-desc { font-size: 10px; color: rgba(255,255,255,0.6); line-height: 1.4; word-break: break-word; }
.biz-arrow { display: flex; align-items: center; color: rgba(255,255,255,0.3); font-size: 18px; flex-shrink: 0; }
.biz-features { margin-top: 8px; }
.biz-features-title { font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.5); margin-bottom: 8px; text-transform: uppercase; }
.biz-feature-item { padding: 6px 10px; margin-bottom: 4px; background: rgba(255,255,255,0.04); border-radius: 6px; font-size: 12px; display: flex; align-items: center; gap: 8px; }
.biz-feature-num { background: rgba(255,255,255,0.1); width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0; }

/* 시스템 아키텍처 */
.sys-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.sys-zone { border: 1px solid; border-radius: 8px; overflow: hidden; background: rgba(255,255,255,0.02); }
.sys-zone-title { padding: 5px 10px; font-size: 11px; font-weight: 700; color: white; text-align: center; }
.sys-zone-body { padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.sys-component { padding: 4px 8px; background: rgba(255,255,255,0.05); border-radius: 4px; font-size: 11px; }
.sys-flow { margin-top: 4px; }
.sys-flow-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 6px; }
.sys-flow-steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.sys-flow-step { padding: 4px 8px; background: rgba(108,92,231,0.15); border-radius: 4px; font-size: 10px; color: var(--primary-light); }
.sys-flow-arrow { color: rgba(255,255,255,0.25); font-size: 12px; }

/* 비즈니스 모델 캔버스 */
.arch-diagram.bmc { background: linear-gradient(135deg, #1e1a2e, #2a2535); }
.bmc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: auto auto auto;
  gap: 4px;
}
.bmc-cell {
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  padding: 10px;
  min-height: 60px;
}
.bmc-cell-title {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
  color: rgba(255,255,255,0.7);
}
.bmc-cell-body {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
}
.bmc-item {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.bmc-item:last-child { border-bottom: none; }

/* 캔버스 그리드 배치 (Business Model Canvas 레이아웃) */
.bmc-kp { grid-column: 1; grid-row: 1 / 3; border-left: 3px solid #e17055; }
.bmc-ka { grid-column: 2; grid-row: 1; border-left: 3px solid #a29bfe; }
.bmc-kr { grid-column: 2; grid-row: 2; border-left: 3px solid #74b9ff; }
.bmc-vp { grid-column: 3; grid-row: 1 / 3; border-left: 3px solid #00b894; background: rgba(0,184,148,0.08); }
.bmc-cr { grid-column: 4; grid-row: 1; border-left: 3px solid #fd79a8; }
.bmc-ch { grid-column: 4; grid-row: 2; border-left: 3px solid #fdcb6e; }
.bmc-cs { grid-column: 5; grid-row: 1 / 3; border-left: 3px solid #74b9ff; }
.bmc-cost { grid-column: 1 / 3; grid-row: 3; border-left: 3px solid #e17055; }
.bmc-rev { grid-column: 3 / 6; grid-row: 3; border-left: 3px solid #00b894; background: rgba(0,184,148,0.05); }

@media (max-width: 600px) {
  .bmc-grid { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .bmc-kp, .bmc-ka, .bmc-kr, .bmc-vp, .bmc-cr, .bmc-ch, .bmc-cs, .bmc-cost, .bmc-rev {
    grid-column: auto; grid-row: auto;
  }
}

/* 도메인 모델 */
.arch-diagram.domain { background: linear-gradient(135deg, #1a1e28, #222838); }
.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; }
.domain-obj { background: rgba(255,255,255,0.04); border: 1px solid; border-radius: 8px; padding: 10px; }
.domain-obj-header { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.domain-type-badge { font-size: 9px; font-weight: 800; color: white; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; }
.domain-obj-name { font-size: 13px; font-weight: 700; }
.domain-resp { font-size: 11px; color: rgba(255,255,255,0.6); padding: 2px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.domain-resp:last-of-type { border-bottom: none; }
.domain-feature { font-size: 10px; color: rgba(255,255,255,0.4); margin-top: 6px; }

/* 기술 아키텍처 — 도메인 기반 컴포넌트 */
.comp-card { background: rgba(255,255,255,0.04); border-radius: 6px; padding: 8px 10px; margin: 4px 0; }
.comp-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.comp-desc { font-size: 10px; color: rgba(255,255,255,0.55); }
.comp-domains { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.comp-domain-tag { font-size: 9px; background: rgba(255,255,255,0.08); padding: 1px 6px; border-radius: 8px; color: rgba(255,255,255,0.7); }

.data-flows { margin-top: 12px; }
.data-flows-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 6px; }
.data-flow-row { display: flex; align-items: center; gap: 6px; padding: 4px 8px; margin-bottom: 3px; background: rgba(255,255,255,0.03); border-radius: 5px; font-size: 11px; flex-wrap: wrap; }
.df-from, .df-to { font-weight: 700; white-space: nowrap; }
.df-arrow { font-size: 14px; flex-shrink: 0; }
.df-data { color: rgba(255,255,255,0.5); font-size: 10px; margin-left: auto; }

/* 비즈니스 아키텍처 — 가치 흐름 */
.vchain { display: flex; align-items: stretch; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.vchain-step { flex: 1; background: rgba(255,255,255,0.04); border-radius: 8px; padding: 10px; min-width: 100px; text-align: center; }
.vchain-num { width: 22px; height: 22px; border-radius: 50%; color: white; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; margin: 0 auto 6px; }
.vchain-activity { font-size: 12px; font-weight: 700; margin-bottom: 4px; }
.vchain-io { font-size: 10px; color: rgba(255,255,255,0.5); }
.vchain-input { color: rgba(116,185,255,0.8); }
.vchain-output { color: rgba(0,184,148,0.8); }
.vchain-arrow { display: flex; align-items: center; color: rgba(255,255,255,0.2); font-size: 16px; flex-shrink: 0; }

.rev-flows { margin-top: 4px; }
.rev-flows-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); margin-bottom: 6px; }
.rev-flow-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; margin-bottom: 3px; background: rgba(255,255,255,0.03); border-radius: 5px; font-size: 11px; flex-wrap: wrap; }
.rf-from, .rf-to { font-weight: 700; white-space: nowrap; }
.rf-arrow { font-size: 14px; }
.rf-desc { color: rgba(255,255,255,0.5); font-size: 10px; margin-left: auto; }

/* 참여 객체(Actor) 관계도 */
.arch-diagram.actor { background: linear-gradient(135deg, #1e252e, #252e38); }
.actor-grid { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.actor-node { background: rgba(255,255,255,0.04); border: 1px solid; border-radius: 10px; padding: 10px; text-align: center; min-width: 90px; flex: 1; }
.actor-icon { width: 36px; height: 36px; border-radius: 50%; margin: 0 auto 6px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: white; }
.actor-name { font-size: 12px; font-weight: 700; margin-bottom: 2px; }
.actor-role { font-size: 10px; color: rgba(255,255,255,0.5); line-height: 1.3; }

.interaction-flows { margin-top: 4px; }
.interaction-title { font-size: 10px; font-weight: 700; color: rgba(255,255,255,0.4); text-transform: uppercase; margin-bottom: 8px; }
.interaction-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; margin-bottom: 3px; background: rgba(255,255,255,0.03); border-radius: 6px; font-size: 11px; flex-wrap: wrap; }
.ix-actor { font-weight: 700; white-space: nowrap; }
.ix-arrow { font-size: 14px; flex-shrink: 0; }
.ix-action { color: rgba(255,255,255,0.6); font-size: 10px; margin-left: auto; }

/* Value Elements (가치 요소) */
.arch-diagram.value { background: linear-gradient(135deg, #1a2025, #202830); }
.value-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.value-col { background: rgba(255,255,255,0.03); border-radius: 8px; padding: 12px; }
.value-col-title { font-size: 11px; font-weight: 700; margin-bottom: 8px; color: rgba(255,255,255,0.7); }
.value-item { display: flex; align-items: baseline; gap: 8px; padding: 4px 0; font-size: 12px; line-height: 1.5; border-bottom: 1px solid rgba(255,255,255,0.04); }
.value-item:last-child { border-bottom: none; }
.value-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }

/* KSF (핵심 성공 요인) */
.arch-diagram.ksf { background: linear-gradient(135deg, #25201a, #302a20); }
.ksf-list { display: flex; flex-direction: column; gap: 6px; }
.ksf-card { background: rgba(255,255,255,0.04); border-radius: 8px; padding: 12px; }
.ksf-factor { font-size: 14px; font-weight: 800; margin-bottom: 6px; }
.ksf-label { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; background: rgba(255,255,255,0.08); margin-right: 6px; }
.ksf-why { font-size: 12px; color: rgba(255,255,255,0.7); margin-bottom: 4px; line-height: 1.5; }
.ksf-how { font-size: 12px; color: rgba(0,184,148,0.85); margin-bottom: 6px; line-height: 1.5; }
.ksf-metric { font-size: 11px; color: var(--accent); font-weight: 600; background: rgba(0,184,148,0.1); padding: 4px 10px; border-radius: 12px; display: inline-block; }

/* 시스템 아키텍처 다이어그램 */
.arch-diagram.sysarch { background: linear-gradient(135deg, #1a1e2e, #1e2535); }
.sysarch-diagram { display: flex; flex-direction: column; gap: 0; }
.sysarch-layer { border-radius: 10px; padding: 14px; margin: 0; }
.sysarch-layer-header { font-size: 13px; font-weight: 800; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.sysarch-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.sysarch-feature { background: rgba(255,255,255,0.06); border-radius: 6px; padding: 8px 10px; }
.sysarch-fname { font-size: 12px; font-weight: 700; color: #e4e6f0; }
.sysarch-fdesc { font-size: 10px; color: rgba(255,255,255,0.5); margin-top: 2px; line-height: 1.4; }
.sysarch-connector { text-align: center; padding: 4px 0; font-size: 14px; line-height: 1; color: var(--text-dim); }

/* 데이터 흐름 프로토콜 뱃지 */
.df-proto { font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 8px; background: rgba(108,92,231,0.2); color: #a29bfe; margin: 0 4px; }

/* 도메인 용어 사전 */
.domain-terms { margin-bottom: 14px; }
.domain-terms-title { font-size: 12px; font-weight: 700; color: var(--primary-light); margin-bottom: 8px; }
.domain-terms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 6px; }
.domain-term { background: rgba(255,255,255,0.05); border-radius: 6px; padding: 8px 10px; }
.dt-word { font-size: 12px; font-weight: 800; color: #fdcb6e; display: block; margin-bottom: 2px; }
.dt-def { font-size: 10px; color: rgba(255,255,255,0.55); line-height: 1.4; }

/* GitHub 참고 소스 */
.arch-diagram.github { background: linear-gradient(135deg, #1a1e22, #222830); }
.gh-repo-list { display: flex; flex-direction: column; gap: 8px; }
.gh-repo-card { background: rgba(255,255,255,0.05); border-radius: 8px; padding: 12px; border-left: 3px solid #6c5ce7; }
.gh-repo-header { margin-bottom: 4px; }
.gh-repo-link { color: #74b9ff; font-size: 13px; font-weight: 700; text-decoration: none; }
.gh-repo-link:hover { text-decoration: underline; color: #a29bfe; }
.gh-repo-desc { font-size: 11px; color: rgba(255,255,255,0.6); margin-bottom: 4px; line-height: 1.4; }
.gh-repo-relevance { font-size: 11px; color: #00b894; font-weight: 600; }

@media (max-width: 600px) {
  .actor-grid { flex-direction: column; }
  .value-columns { grid-template-columns: 1fr; }
  .sysarch-features { grid-template-columns: 1fr; }
  .domain-terms-grid { grid-template-columns: 1fr; }
}

/* Retry Button */
.retry-btn { background: linear-gradient(135deg, #e17055, #d63031); color: white; border: none; padding: 12px 24px; border-radius: 24px; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; }
.retry-btn:hover { transform: scale(1.03); box-shadow: 0 4px 16px rgba(214,48,49,0.3); }

/* Chat Input */
.chat-input-area { padding: 12px 24px 16px; background: var(--surface); border-top: 1px solid var(--border); }
.chat-input-wrap { display: flex; gap: 10px; max-width: 720px; margin: 0 auto; }
.chat-input-wrap input { flex: 1; padding: 12px 18px; background: var(--surface2); border: 2px solid transparent; border-radius: 24px; font-size: 14px; color: var(--text); outline: none; transition: all 0.2s; }
.chat-input-wrap input:focus { border-color: var(--primary); background: white; }
.chat-input-wrap input::placeholder { color: var(--text-dim); }
.chat-send { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; border: none; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: transform 0.15s; flex-shrink: 0; }
.chat-send:hover { transform: scale(1.05); }
.chat-send:disabled { opacity: 0.4; transform: none; }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); z-index: 100; justify-content: center; align-items: flex-start; padding: 40px 20px; overflow-y: auto; }
.modal-overlay.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius); width: 100%; max-width: 720px; padding: 32px; box-shadow: var(--shadow-lg); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.modal-header h2 { font-size: 20px; font-weight: 800; }
.modal-close { background: var(--surface2); border: none; color: var(--text-dim); font-size: 18px; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.modal-actions { margin-top: 24px; display: flex; gap: 12px; justify-content: flex-end; }
.detail-section { margin-bottom: 20px; }
.detail-section h4 { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.detail-section p { font-size: 14px; line-height: 1.7; }
.detail-section pre { background: var(--surface2); padding: 16px; border-radius: var(--radius-sm); overflow-x: auto; white-space: pre-wrap; font-family: monospace; font-size: 13px; }
.score-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.score-bar .label { width: 100px; font-size: 13px; color: var(--text-dim); }
.score-track { flex: 1; height: 8px; background: var(--surface2); border-radius: 4px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 4px; transition: width 0.5s; }
.score-val { width: 30px; text-align: right; font-size: 13px; font-weight: 700; }

.proposal-card { background: var(--surface2); border-radius: var(--radius-sm); padding: 20px; margin-bottom: 16px; }
.proposal-card h3 { font-size: 17px; margin-bottom: 12px; color: var(--primary); }
.proposal-field { margin-bottom: 10px; }
.proposal-field .field-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.proposal-field .field-value { font-size: 14px; line-height: 1.6; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-block; padding: 3px 10px; background: var(--primary-bg); color: var(--primary); border-radius: 12px; font-size: 12px; font-weight: 600; }
.idea-card { background: var(--surface2); border-radius: var(--radius-sm); padding: 20px; margin-bottom: 12px; }
.idea-card h4 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.idea-card h4 .idea-num { background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; flex-shrink: 0; }
.idea-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 8px; }
.mvp-features-list { list-style: none; padding: 0; }
.mvp-features-list li { padding: 3px 0; font-size: 13px; display: flex; align-items: baseline; gap: 6px; }
.mvp-features-list li::before { content: '\2713'; color: var(--success); font-weight: 700; }

@media (max-width: 768px) {
  .session-panel { display: none; }
  .msg { max-width: 90%; }
  .auth-card { padding: 32px 24px; }
}
