/* JAIXLAB AW — Dark/Light Theme */
:root, [data-theme="dark"] {
  --bg: #0a0a0a; --surface: #141414; --surface2: #1e1e1e;
  --border: #2a2a2a; --text: #e0e0e0; --dim: #888;
  --accent: #3b82f6; --accent-hover: #2563eb;
  --success: #22c55e; --warn: #f59e0b; --error: #ef4444;
  --radius: 8px;
  --font: 'Noto Sans CJK KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --mono: 'SF Mono', 'Fira Code', monospace;
  --font-size: 14px;
  --user-bg: #1a2744; --assistant-bg: #1a1a1a;
}
[data-theme="light"] {
  --bg: #f5f5f5; --surface: #fff; --surface2: #eee;
  --border: #ddd; --text: #222; --dim: #666;
  --user-bg: #e8f0fe; --assistant-bg: #f9f9f9;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font); font-size: var(--font-size); background: var(--bg); color: var(--text); min-height: 100vh; }

/* Mobile view */
[data-view="mobile"] .chat-sidebar { display: none; }
[data-view="mobile"] .chat-layout { grid-template-columns: 1fr; }
[data-view="mobile"] header { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
[data-view="mobile"] .header-nav { order: 3; width: 100%; }
[data-view="mobile"] .toolbar { gap: 2px; }

/* Login */
.login-card {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 48px 40px; text-align: center; width: 360px; max-width: 90vw;
}
.login-card h1 { font-size: 24px; letter-spacing: 4px; margin-bottom: 4px; }
.login-card .subtitle { color: var(--dim); font-size: 13px; margin-bottom: 32px; }
.login-card input {
  width: 100%; padding: 12px 16px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: 14px; margin-bottom: 12px; outline: none;
}
.login-card input:focus { border-color: var(--accent); }
.login-card button[type="submit"] {
  width: 100%; padding: 12px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); font-size: 14px; cursor: pointer;
}
.login-card button[type="submit"]:hover { background: var(--accent-hover); }
.error { color: var(--error); font-size: 12px; margin-top: 8px; }
.auth-question { font-size: 14px; color: var(--text); margin-bottom: 12px; line-height: 1.5; text-align: left; }

/* Header */
header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--border); background: var(--surface);
  gap: 12px; position: sticky; top: 0; z-index: 10;
}
header h1 { font-size: 14px; letter-spacing: 3px; white-space: nowrap; }
.header-left { display: flex; align-items: center; gap: 10px; }
.header-nav { display: flex; gap: 4px; }
.header-right { display: flex; align-items: center; gap: 8px; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--surface2); border: 1px solid var(--border); color: var(--dim); }

.nav-btn {
  padding: 6px 14px; background: none; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--dim); cursor: pointer; font-size: 12px; transition: all 0.15s;
}
.nav-btn:hover { color: var(--text); }
.nav-btn.active { color: var(--text); background: var(--surface2); border-color: var(--border); }
.nav-sep { display: inline-block; width: 1px; height: 16px; background: var(--border); margin: 0 6px; vertical-align: middle; }

/* Toolbar */
.toolbar { display: flex; gap: 4px; }
.tool-btn {
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 6px;
  color: var(--dim); cursor: pointer; font-size: 13px; transition: all 0.15s;
}
.tool-btn:hover { color: var(--text); border-color: var(--accent); }

/* Buttons */
.btn-text { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 12px; }
.btn-text:hover { color: var(--text); }
.btn-icon { background: none; border: none; color: var(--text); cursor: pointer; font-size: 18px; padding: 4px 8px; }
.btn-outline { padding: 8px 20px; background: transparent; border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-size: 13px; }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { padding: 10px 20px; background: var(--accent); color: #fff; border: none; border-radius: var(--radius); cursor: pointer; font-size: 13px; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

/* Chat Layout */
#app-view { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
#app-view header { flex-shrink: 0; }
#app-view .tab-panel { flex: 1; overflow: hidden; }
.chat-layout { display: grid; grid-template-columns: 220px 1fr; height: 100%; }
.chat-sidebar {
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.chat-new-btn {
  margin: 10px; padding: 10px; background: var(--surface2); border: 1px dashed var(--border);
  border-radius: var(--radius); color: var(--dim); cursor: pointer; font-size: 12px;
}
.chat-new-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-history { flex: 1; overflow-y: auto; padding: 0 6px; }
.chat-history-item {
  padding: 8px 10px; margin: 2px 0; border-radius: 6px; cursor: pointer;
  font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-history-item { display: flex; align-items: center; gap: 4px; }
.chat-hist-title { flex: 1; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.chat-hist-meta { font-size: 9px; opacity: 0.5; white-space: nowrap; }
.chat-hist-actions { display: none; gap: 2px; flex-shrink: 0; }
.chat-hist-actions button { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 15px; padding: 4px 6px; line-height: 1; min-width: 24px; min-height: 24px; }
.chat-hist-actions button:hover { color: var(--text); background: var(--bg); border-radius: 4px; }
.chat-history-item:hover .chat-hist-actions, .chat-history-item.active .chat-hist-actions { display: flex; }
.chat-history-item:hover .chat-hist-meta, .chat-history-item.active .chat-hist-meta { display: none; }
.chat-history-item:hover { background: var(--surface2); color: var(--text); }
.chat-history-item.active { background: var(--surface2); color: var(--text); border-left: 2px solid var(--accent); }

.chat-main { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.chat-toolbar {
  display: flex; gap: 4px; padding: 4px 12px; border-bottom: 1px solid var(--border); background: var(--surface); flex-shrink: 0;
}
.chat-toolbar-btn {
  background: none; border: 1px solid var(--border); color: var(--dim); padding: 4px 10px;
  border-radius: 4px; font-size: 11px; cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.chat-toolbar-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-toolbar-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px 20px; min-height: 0; }
.chat-welcome { text-align: center; padding: 80px 20px; color: var(--dim); }
.chat-welcome h2 { font-size: 20px; font-weight: 300; margin-bottom: 8px; color: var(--text); }
.chat-welcome p { font-size: 13px; }

.msg { padding: 10px 14px; margin: 4px 0; border-radius: var(--radius); line-height: 1.4; white-space: pre-wrap; word-break: keep-all; overflow-wrap: break-word; font-size: var(--font-size); }
.msg-user { background: var(--user-bg); margin-left: 40px; }
.msg-assistant { background: var(--assistant-bg); border: 1px solid var(--border); margin-right: 40px; }
.msg-label { font-size: 10px; color: var(--dim); margin-bottom: 4px; letter-spacing: 1px; text-transform: uppercase; }
.msg-streaming { border-left: 2px solid var(--accent); }
.msg-queued { opacity: 0.5; border-left: 2px dashed var(--dim); }
.chat-history-item.processing { border-left: 2px solid var(--accent); }
.chat-history-item.processing .chat-hist-title::after { content: ' ...'; color: var(--accent); animation: pulse-dot 1.5s infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }
.chat-processing-banner { padding: 8px 12px; background: var(--surface2); border-radius: 6px; margin-bottom: 8px; font-size: 12px; display: flex; align-items: center; justify-content: space-between; }
.chat-progress-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; padding: 4px 0; }
.chat-progress-bar { flex: 1; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.chat-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 2px; transition: width 0.5s ease; }
.chat-progress-text { font-size: 11px; color: var(--dim); white-space: nowrap; min-width: 100px; text-align: right; }
.msg-assistant .msg-body { white-space: normal; }
.msg-assistant .msg-body h1, .msg-assistant .msg-body h2, .msg-assistant .msg-body h3 { margin: 8px 0 4px; font-size: 1em; }
.msg-assistant .msg-body h2 { font-size: 1.05em; border-bottom: 1px solid var(--border); padding-bottom: 2px; }
.msg-assistant .msg-body table { border-collapse: collapse; width: 100%; margin: 6px 0; font-size: 0.9em; }
.msg-assistant .msg-body th, .msg-assistant .msg-body td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; }
.msg-assistant .msg-body th { background: var(--surface2); }
.msg-assistant .msg-body ul, .msg-assistant .msg-body ol { padding-left: 18px; margin: 4px 0; }
.msg-assistant .msg-body p { margin: 4px 0; }
.msg-assistant .msg-body code { background: var(--surface2); padding: 1px 4px; border-radius: 3px; font-size: 0.9em; }
.msg-assistant .msg-body pre { background: var(--bg); padding: 8px; border-radius: 6px; overflow-x: auto; margin: 6px 0; }

.chat-form {
  display: flex; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; align-items: flex-end;
}
.chat-form textarea {
  flex: 1; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--text); font-size: var(--font-size); font-family: var(--font);
  resize: none; outline: none; max-height: 120px;
}
.chat-form textarea:focus { border-color: var(--accent); }
.chat-form button {
  padding: 10px 20px; background: var(--accent); color: #fff; border: none;
  border-radius: var(--radius); cursor: pointer; font-size: 13px; white-space: nowrap;
}
.chat-form button:hover { background: var(--accent-hover); }
.chat-form button:disabled { opacity: 0.4; cursor: not-allowed; }
.chat-mic-btn {
  padding: 10px 12px; background: var(--surface2); color: var(--dim); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font-size: 16px; line-height: 1; flex-shrink: 0; transition: all 0.15s;
}
.chat-mic-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-mic-btn.listening { background: var(--error); color: #fff; border-color: var(--error); animation: mic-pulse 1.5s ease-in-out infinite; }
.chat-mic-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.msg-tts-btn {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 4px 10px;
  background: var(--surface2); border: 1px solid var(--border); border-radius: 4px;
  color: var(--dim); font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.msg-tts-btn:hover { border-color: var(--accent); color: var(--accent); }
.msg-tts-btn.playing { color: var(--accent); border-color: var(--accent); }
.msg-actions { display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap; }

/* Tab panels */
.tab-panel { display: block; font-size: var(--font-size); }

/* Sessions/Reports */
.sessions-panel { max-width: 960px; margin: 0 auto; padding: 24px; }
.panel-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-header h2 { font-size: 16px; font-weight: 500; }
.sessions-list { display: flex; flex-direction: column; gap: 8px; }
.session-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
}
.session-card:hover { border-color: var(--accent); }
.session-topic { font-size: 14px; font-weight: 500; }
.session-meta { font-size: 11px; color: var(--dim); margin-top: 4px; }
.status-done { background: rgba(34,197,94,0.15); color: var(--success); }
.status-pending { background: rgba(245,158,11,0.15); color: var(--warn); }
.status-approved { background: rgba(59,130,246,0.15); color: var(--accent); }

.report-panel { max-width: 960px; margin: 0 auto; padding: 0 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.version-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.version-tab { padding: 6px 12px; background: none; border: 1px solid transparent; border-radius: 4px; color: var(--dim); cursor: pointer; font-size: 12px; }
.version-tab.active { color: var(--text); background: var(--surface2); border-color: var(--border); }
.report-content { font-size: var(--font-size); line-height: 1.5; max-height: 60vh; overflow-y: auto; padding: 16px; background: var(--bg); border-radius: var(--radius); word-break: keep-all; overflow-wrap: break-word; }
.report-content h1 { font-size: 20px; margin: 16px 0 8px; }
.report-content h2 { font-size: 16px; margin: 14px 0 6px; color: var(--accent); }
.report-content table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.report-content th, .report-content td { padding: 6px 10px; border: 1px solid var(--border); text-align: left; }
.report-content th { background: var(--surface2); }
.report-content code { font-family: var(--mono); background: var(--surface2); padding: 1px 4px; border-radius: 3px; font-size: 13px; }
.report-content blockquote { border-left: 3px solid var(--border); padding-left: 12px; color: var(--dim); margin: 8px 0; }
.placeholder { color: var(--dim); text-align: center; padding: 40px; }

.feedback-area { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.feedback-buttons { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.fb-btn { padding: 8px 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); cursor: pointer; font-size: 12px; }
.fb-btn:hover { border-color: var(--accent); }
.fb-btn.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.fb-approve.selected { background: var(--success); border-color: var(--success); }
.feedback-area textarea { width: 100%; padding: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 13px; resize: vertical; outline: none; margin-bottom: 8px; }

/* Landing */
.landing { min-height: 100vh; display: flex; flex-direction: column; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; padding: 20px 40px; border-bottom: 1px solid var(--border); }
.logo { font-size: 16px; letter-spacing: 4px; font-weight: 600; }
.hero { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 960px; margin: 0 auto; padding: 80px 40px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); font-weight: 300; line-height: 1.1; letter-spacing: -1px; margin-bottom: 20px; }
.hero-sub { font-size: 16px; color: var(--dim); max-width: 480px; line-height: 1.6; margin-bottom: 60px; }
.hero-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.feature { padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); }
.feature:hover { border-color: var(--accent); }
.feature-num { font-size: 11px; color: var(--accent); letter-spacing: 2px; margin-bottom: 12px; }
.feature h3 { font-size: 15px; font-weight: 500; margin-bottom: 8px; }
.feature p { font-size: 13px; color: var(--dim); line-height: 1.5; }
.landing-footer { padding: 20px 40px; border-top: 1px solid var(--border); font-size: 12px; color: var(--dim); text-align: center; }

/* Legal Comparison */
.legal-panel { max-width: 960px; margin: 0 auto; padding: 24px; }
.legal-upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.upload-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.upload-label { font-size: 12px; color: var(--dim); margin-bottom: 8px; letter-spacing: 1px; text-transform: uppercase; }
.upload-dropzone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 32px 16px;
  text-align: center; transition: all 0.2s; cursor: pointer;
}
.upload-dropzone:hover, .upload-dropzone.dragover { border-color: var(--accent); background: rgba(59,130,246,0.05); }
.upload-hint { font-size: 13px; color: var(--dim); margin-bottom: 4px; }
.upload-formats { font-size: 11px; color: var(--dim); opacity: 0.6; }
.upload-browse { color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 13px; background: none; border: none; }
.upload-file-info {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; background: var(--surface2); border-radius: var(--radius); font-size: 13px;
}
.upload-file-info button { font-size: 18px; color: var(--dim); }
.upload-file-info button:hover { color: var(--error); }

.legal-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.legal-status { font-size: 12px; color: var(--dim); }
.legal-notice { font-size: 11px; color: var(--dim); opacity: 0.6; margin-top: 8px; }

.legal-result { margin-top: 20px; }
.legal-result-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.legal-result-header h3 { font-size: 14px; font-weight: 500; }
.legal-result-actions { display: flex; gap: 8px; }

.legal-history { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.legal-history h3 { font-size: 13px; color: var(--dim); margin-bottom: 12px; }
.legal-history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; margin-bottom: 6px; font-size: 13px;
}
.legal-history-item:hover { border-color: var(--accent); }
.legal-history-docs { font-weight: 500; }
.legal-history-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--dim); }
.status-done { background: rgba(34,197,94,0.15); color: var(--success); }
.status-processing { background: rgba(59,130,246,0.15); color: var(--accent); }
.status-error { background: rgba(239,68,68,0.15); color: var(--error); }

@media (max-width: 640px) {
  .legal-upload-grid { grid-template-columns: 1fr; }
}

/* ── Voice Mode ── */
.voice-container {
  display: flex; flex-direction: column; height: 100%;
  background: var(--bg); position: relative;
}
.voice-messages {
  flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px;
}
.voice-welcome { text-align: center; padding: 40px 20px; color: var(--dim); font-size: 14px; margin-top: auto; }
.voice-msg {
  max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  word-break: keep-all; overflow-wrap: break-word; white-space: pre-wrap;
}
.voice-msg-user {
  align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px;
}
.voice-msg-assistant {
  align-self: flex-start; background: var(--surface2); border: 1px solid var(--border); border-bottom-left-radius: 4px;
}
.voice-msg-assistant.streaming { border-left: 2px solid var(--accent); }

.voice-center {
  display: flex; flex-direction: column; align-items: center; padding: 16px 20px 8px; gap: 12px;
}
.voice-status {
  font-size: 12px; color: var(--dim); min-height: 18px; text-align: center;
}
.voice-mic-btn {
  width: 96px; height: 96px; border-radius: 50%; border: none;
  background: var(--accent); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; box-shadow: 0 4px 24px rgba(59,130,246,0.3);
}
.voice-mic-btn:hover { transform: scale(1.05); box-shadow: 0 6px 32px rgba(59,130,246,0.4); }
.voice-mic-btn:active { transform: scale(0.95); }
.voice-mic-btn.listening {
  background: var(--error); animation: mic-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 4px 24px rgba(239,68,68,0.4);
}
.voice-mic-btn.processing {
  background: var(--warn); animation: none; opacity: 0.8; cursor: wait;
}
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 20px rgba(239,68,68,0); }
}

.voice-transcript {
  font-size: 13px; color: var(--dim); text-align: center; min-height: 20px; max-width: 80%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.voice-bottom-bar {
  display: flex; align-items: center; gap: 8px; padding: 8px 20px 16px;
  justify-content: center; flex-wrap: wrap;
}
.voice-input-toggle {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.voice-input-toggle:hover { border-color: var(--accent); color: var(--accent); }
.voice-text-input {
  display: flex; gap: 8px; flex: 1; max-width: 400px;
}
.voice-text-input input {
  flex: 1; padding: 8px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text); font-size: 13px; outline: none;
}
.voice-text-input input:focus { border-color: var(--accent); }
.voice-text-input button {
  padding: 8px 16px; background: var(--accent); color: #fff; border: none;
  border-radius: 20px; cursor: pointer; font-size: 13px;
}
.voice-settings {
  display: flex; gap: 12px; flex-wrap: wrap; padding: 10px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  width: 100%; max-width: 400px; animation: fadeIn 0.2s ease;
}
.voice-settings label {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--dim); white-space: nowrap;
}
.voice-settings select {
  padding: 4px 8px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12px;
}
.voice-settings input[type="range"] { width: 80px; accent-color: var(--accent); }
.voice-settings span { font-size: 11px; color: var(--accent); min-width: 32px; }

.voice-privacy-notice {
  width: 100%; text-align: center; font-size: 10px; color: var(--dim); opacity: 0.5; margin-top: 4px;
}

/* Clarify Options */
.voice-clarify-options {
  display: flex; flex-direction: column; gap: 6px; padding: 8px 16px; max-width: 90%;
  align-self: flex-start; animation: fadeIn 0.2s ease;
}
.voice-clarify-btn {
  padding: 10px 16px; background: rgba(59,130,246,0.12); border: 1px solid rgba(59,130,246,0.3);
  border-radius: 12px; color: var(--text); cursor: pointer; font-size: 13px;
  text-align: left; transition: all 0.15s; backdrop-filter: blur(4px);
}
.voice-clarify-btn:hover { background: rgba(59,130,246,0.25); border-color: var(--accent); }
.voice-clarify-btn:active { transform: scale(0.98); }
.voice-clarify-all {
  background: rgba(34,197,94,0.12); border-color: rgba(34,197,94,0.3);
  font-weight: 500;
}
.voice-clarify-all:hover { background: rgba(34,197,94,0.25); border-color: var(--success); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* HR Tab */
.hr-panel { max-width: 960px; margin: 0 auto; padding: 24px; }
.hr-upload-row { display: flex; gap: 16px; margin-bottom: 12px; align-items: flex-start; }
.hr-dropzone { flex: 1; }
.hr-options { display: flex; flex-direction: column; gap: 8px; min-width: 140px; }
.hr-options label { font-size: 12px; color: var(--dim); display: flex; flex-direction: column; gap: 4px; }
.hr-options select { padding: 8px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-size: 13px; }
.hr-file-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.hr-file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; background: var(--surface2); border-radius: 6px; font-size: 13px;
}
.hr-file-item button { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 16px; }
.hr-file-item button:hover { color: var(--error); }
.hr-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.hr-notice { font-size: 11px; color: var(--dim); margin-top: 8px; }
.hr-notice label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.hr-notice input[type="checkbox"] { accent-color: var(--accent); }

.hr-progress-bar { height: 6px; background: var(--surface2); border-radius: 3px; margin-bottom: 8px; overflow: hidden; }
.hr-progress-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; width: 0%; }

.hr-result-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.hr-grade {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px; font-weight: 700;
}
.hr-grade-S { background: rgba(139,92,246,0.2); color: #a78bfa; border: 2px solid #a78bfa; }
.hr-grade-A { background: rgba(34,197,94,0.2); color: var(--success); border: 2px solid var(--success); }
.hr-grade-B { background: rgba(59,130,246,0.2); color: var(--accent); border: 2px solid var(--accent); }
.hr-grade-C { background: rgba(245,158,11,0.2); color: var(--warn); border: 2px solid var(--warn); }
.hr-grade-D { background: rgba(239,68,68,0.2); color: var(--error); border: 2px solid var(--error); }

.hr-dimensions { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin-bottom: 16px; }
.hr-dim-card {
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 13px;
}
.hr-dim-card .dim-name { font-weight: 500; margin-bottom: 4px; display: flex; justify-content: space-between; }
.hr-dim-card .dim-grade { font-weight: 700; }
.hr-dim-card .dim-comment { color: var(--dim); font-size: 12px; line-height: 1.4; }

.hr-history { margin-top: 24px; border-top: 1px solid var(--border); padding-top: 16px; }
.hr-history h3 { font-size: 13px; color: var(--dim); margin-bottom: 12px; }
.hr-resume-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; margin-bottom: 6px; font-size: 13px;
}
.hr-resume-item:hover { border-color: var(--accent); }
.hr-card-processing { border-color: var(--accent); border-left: 3px solid var(--accent); animation: fadeIn 0.2s ease; }
.hr-compare-card-wrap { border-color: var(--accent); border-width: 2px; margin-bottom: 8px; }
.hr-compare-card-wrap.complete { cursor: pointer; }
.hr-compare-progress { display: flex; align-items: center; gap: 8px; margin: 6px 0 4px; }
.hr-compare-bar { flex: 1; height: 6px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.hr-compare-bar-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.3s; width: 0%; }
#hr-compare-panel { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; animation: fadeIn 0.3s ease; }
#hr-compare-content { font-size: 12px; line-height: 1.35; }
#hr-compare-content h1 { font-size: 15px; margin: 8px 0 4px; }
#hr-compare-content h2 { font-size: 13px; margin: 6px 0 2px; }
#hr-compare-content h3 { font-size: 12px; margin: 4px 0 1px; }
#hr-compare-content p, #hr-compare-content li { margin: 1px 0; }
#hr-compare-content ul, #hr-compare-content ol { padding-left: 16px; margin: 2px 0; }
#hr-compare-content br + br { display: none; }
.hr-weight-display { font-size: 11px; color: var(--dim); line-height: 1.6; padding: 8px; background: var(--bg); border-radius: 6px; margin-top: 4px; }
.hr-weight-display span { display: inline-block; margin: 1px 4px 1px 0; padding: 1px 6px; background: var(--surface2); border-radius: 4px; font-family: var(--mono); }

/* Custom settings screen */
#hr-custom-screen { padding: 4px 0; }
#hr-custom-screen select, #hr-custom-screen input[type="text"] { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); }
.hr-gl-label { font-size: 12px; color: var(--dim); display: flex; flex-direction: column; gap: 3px; }
.hr-gl-label textarea { width: 100%; padding: 8px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; resize: vertical; font-family: inherit; line-height: 1.5; }
.hr-gl-label textarea:focus { border-color: var(--accent); outline: none; }
.hr-gl-hint { opacity: 0.5; font-size: 10px; }

/* Preset cards */
.hr-preset-card { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.hr-preset-card .preset-name { font-weight: 600; font-size: 12px; flex: 1; }
.hr-preset-card .preset-meta { font-size: 10px; color: var(--dim); }
.hr-preset-card .preset-actions { display: flex; gap: 4px; }
.hr-preset-card .preset-actions button { padding: 2px 8px; font-size: 11px; }

/* Presets section */
.hr-presets-section { border-top: 1px solid var(--border); padding-top: 12px; }

/* Support / Tickets */
.ticket-card { padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; word-break: keep-all; overflow-wrap: break-word; }
.ticket-type { font-size: 10px; padding: 2px 6px; background: var(--surface2); border-radius: 4px; text-transform: uppercase; }
.ticket-ai-memo { margin-top: 6px; padding: 6px 8px; background: var(--bg); border-radius: 6px; font-size: 11px; color: var(--dim); border-left: 2px solid orange; white-space: pre-wrap; }
.ticket-reply { margin-top: 6px; padding: 6px 8px; background: var(--bg); border-radius: 6px; font-size: 12px; border-left: 2px solid var(--accent); }
.nav-badge { background: var(--accent); color: #fff; border-radius: 50%; font-size: 10px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; display: inline-block; margin-left: 4px; }

/* Admin */
.admin-panel { max-width: 960px; margin: 0 auto; padding: 24px; }
.admin-section { margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.admin-section h3 { margin: 0 0 8px; font-size: 14px; }
.admin-section input { padding: 7px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; }
.admin-user-card { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 6px; }
.admin-user-card code { background: var(--bg); padding: 1px 4px; border-radius: 3px; font-size: 10px; }

@media (max-width: 640px) {
  .hr-upload-row { flex-direction: column; }
  .hr-dimensions { grid-template-columns: 1fr; }
}

/* Responsive */
@media (max-width: 640px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar { display: none; }
  header { padding: 10px 12px; flex-wrap: wrap; }
  .header-nav { order: 3; width: 100%; }
  .hero { padding: 40px 20px; }
  .msg-user { margin-left: 10px; }
  .msg-assistant { margin-right: 10px; }
  .voice-mic-btn { width: 80px; height: 80px; }
  .voice-mic-btn svg { width: 40px; height: 40px; }
}

/* ── Utility Classes (인라인 스타일 대체) ── */
.form-input { width: 100%; padding: 7px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 13px; }
.form-input:focus { border-color: var(--accent); outline: none; }
.form-select { padding: 6px 10px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-size: 12px; }
.text-dim-sm { font-size: 11px; color: var(--dim); }
.text-dim-xs { font-size: 10px; color: var(--dim); }
.flex-row { display: flex; gap: 8px; align-items: center; }
.flex-col { display: flex; flex-direction: column; gap: 8px; }
.flex-wrap { flex-wrap: wrap; }
.ml-auto { margin-left: auto; }
.section-title { margin: 0; font-size: 14px; font-weight: 600; }
.card { padding: 10px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.btn-danger { color: var(--error); border-color: var(--error); }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-xs { padding: 3px 10px; font-size: 11px; }
.mb-sm { margin-bottom: 8px; }
.mb-md { margin-bottom: 12px; }
.mt-sm { margin-top: 8px; }
.gap-sm { gap: 6px; }
.gap-md { gap: 8px; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.text-accent-sm { font-size: 11px; color: var(--accent); }
.hr-custom-btn { padding: 12px 20px; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: 10px; font-weight: 600; }
.hr-custom-badge { display: none; background: var(--accent); color: #fff; border-radius: 50%; width: 18px; height: 18px; font-size: 10px; line-height: 18px; text-align: center; }
.admin-create-result { display: none; margin-top: 8px; padding: 10px; background: var(--surface2); border-radius: 8px; font-size: 12px; }
.scroll-y-400 { max-height: 400px; overflow-y: auto; }
.tool-btn-sm { width: 22px; height: 22px; font-size: 10px; }
.hr-card-title { font-weight: 500; }
.hr-card-meta { font-size: 11px; color: var(--dim); }
.hr-card-log { font-size: 10px; color: var(--dim); max-height: 80px; overflow-y: auto; margin-top: 4px; font-family: var(--mono); }
.hr-grade-pending { opacity: 0.3; }
.hr-list-del-btn { background: none; border: none; color: var(--dim); cursor: pointer; font-size: 16px; }
.hr-list-del-btn:hover { color: var(--error); }
.eval-section-title { font-size: 12px; margin-top: 12px; }
.eval-detail { font-size: 12px; }
.eval-risk-row { font-size: 11px; padding: 4px 0; border-bottom: 1px solid var(--border); }
.eval-skill-tag { display: inline-block; padding: 1px 6px; background: var(--surface2); border-radius: 3px; margin: 1px; font-size: 10px; }
.decision-box { padding: 10px; background: var(--surface2); border-radius: 8px; margin-bottom: 12px; }
.new-badge { color: var(--accent); font-weight: 700; }
.ticket-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
/* Collapsible user messages */
.msg-user .msg-body { max-height: 1.4em; overflow: hidden; cursor: pointer; position: relative; }
.msg-user .msg-body::after { content: '...'; position: absolute; right: 0; bottom: 0; background: var(--user-bg); padding-left: 4px; }
.msg-user.expanded .msg-body { max-height: none; }
.msg-user.expanded .msg-body::after { display: none; }
.msg-user .msg-body.single-line::after { display: none; }

.export-dropdown { position: absolute; right: 0; top: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px; z-index: 20; display: flex; flex-direction: column; gap: 2px; min-width: 140px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
.export-opt { padding: 6px 10px; background: none; border: none; color: var(--text); cursor: pointer; font-size: 12px; text-align: left; border-radius: 4px; }
.export-opt:hover { background: var(--surface2); }
.chat-hist-actions { position: relative; }
