/* ===== ONSITE — INTERVIEW PREP ENGINE ===== */

/* ===== ONBOARDING ===== */
.onboard-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9000;
  animation: onboard-fade 300ms ease;
}
@keyframes onboard-fade { from { opacity: 0; } to { opacity: 1; } }

.onboard-welcome {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9001;
  text-align: center;
  padding: 48px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  animation: onboard-pop 400ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes onboard-pop {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.onboard-welcome h2 {
  font-size: 24px; font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.onboard-welcome p {
  font-size: 14px; color: var(--text-dim);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto 24px;
}
.onboard-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: #1C1C1E;
  border: none; border-radius: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}
.onboard-cta:hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
}

.onboard-tag {
  position: fixed;
  z-index: 9002;
  background: var(--accent);
  color: #1C1C1E;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13px; font-weight: 600;
  line-height: 1.5;
  max-width: 300px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: onboard-tag-in 300ms cubic-bezier(0.16,1,0.3,1);
}
@keyframes onboard-tag-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.onboard-tag[data-arrow="up"]::before {
  content: '';
  position: absolute; top: -7px; left: 20px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid var(--accent);
}
.onboard-tag[data-arrow="down"]::after {
  content: '';
  position: absolute; bottom: -7px; left: 20px;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 7px solid var(--accent);
}
.onboard-tag .onboard-continue {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 8px;
  padding: 6px 14px;
  background: rgba(0,0,0,0.15);
  border: none; border-radius: 6px;
  color: #1C1C1E;
  font-size: 12px; font-weight: 700;
  cursor: pointer;
}
.onboard-tag .onboard-continue:hover {
  background: rgba(0,0,0,0.25);
}

.onboard-spotlight {
  position: relative;
  z-index: 9001;
}
.onboard-pulse {
  animation: onboard-pulse 2s ease-in-out infinite;
}
@keyframes onboard-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,201,104,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(0,201,104,0); }
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  min-width: 280px;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  pointer-events: auto;
  opacity: 0;
  transform: translateX(20px);
}
.toast-in {
  animation: toast-slide-in 250ms ease forwards;
}
.toast-out {
  animation: toast-slide-out 200ms ease forwards;
}
@keyframes toast-slide-in {
  to { opacity: 1; transform: translateX(0); }
}
@keyframes toast-slide-out {
  to { opacity: 0; transform: translateX(20px); }
}
.toast-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-error .toast-icon { color: var(--red); }
.toast-error { border-color: rgba(232,69,60,0.3); }
.toast-success .toast-icon { color: var(--green); }
.toast-success { border-color: rgba(0,201,104,0.3); }
.toast-warning .toast-icon { color: var(--orange); }
.toast-warning { border-color: rgba(245,166,35,0.3); }
.toast-msg {
  flex: 1;
  word-break: break-word;
}
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  cursor: pointer;
  padding: 0 0 0 4px;
  line-height: 1;
}
.toast-close:hover { color: var(--text); }

:root {
  --bg: #1C1C1E;
  --surface: #2C2C2E;
  --surface2: #3A3A3C;
  --border: #3A3A3C;
  --text: #E8E4DD;
  --text-dim: #8A8A8E;
  --accent: #00C968;
  --accent-glow: #00E87B;
  --green: #00C968;
  --orange: #F5A623;
  --red: #E8453C;
  --blue: #3D8BC2;
  --sidebar-w: 280px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'General Sans', 'Satoshi', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  overflow-y: auto;
}
.sidebar-header {
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-header h1 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}
.sidebar-header h1 span { color: var(--accent-glow); }
.sidebar-header .sidebar-sub {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
}
.sidebar-back {
  display: block;
  padding: 10px 22px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  transition: all 0.15s;
}
.sidebar-back:hover { color: var(--accent-glow); background: rgba(0,201,104,0.06); }

/* ===== SIDEBAR DOCUMENTS ===== */
.sidebar-docs {
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--border);
}
.doc-slot {
  margin-bottom: 8px;
}
.doc-drop {
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}
.doc-drop:hover { border-color: rgba(0,201,104,0.4); background: rgba(0,201,104,0.03); }
.doc-drop.drag-over { border-color: var(--accent-glow); background: rgba(0,201,104,0.06); }
.doc-drop.has-file { border-style: solid; border-color: rgba(0,201,104,0.25); background: rgba(0,201,104,0.04); }
.doc-drop-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}
.doc-drop-label { font-size: 12px; font-weight: 600; color: var(--text); }
.doc-drop-hint { font-size: 10px; color: var(--text-dim); margin-left: auto; }
.doc-file-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
}
.doc-file-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-file-size {
  font-size: 10px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.doc-file-remove {
  width: 20px; height: 20px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}
.doc-file-remove:hover { color: var(--red); background: rgba(232,69,60,0.1); }
.docs-generate-btn {
  width: 100%;
  padding: 10px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: not-allowed;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}
.docs-generate-btn:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
  color: #1C1C1E;
  cursor: pointer;
}
.docs-generate-btn:not(:disabled):hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,201,104,0.3);
}
.docs-generate-hint {
  text-align: center;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  opacity: 0.6;
}

/* Top-level tabs in sidebar */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}
.sidebar-tab {
  flex: 1;
  padding: 12px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.sidebar-tab:hover { color: var(--text); }
.sidebar-tab.active { color: var(--accent-glow); border-bottom-color: var(--accent-glow); }

/* Section nav in sidebar */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}
.sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s;
  border-left: 2px solid transparent;
}
.sidebar-nav a:hover { color: var(--text); background: rgba(255,255,255,0.02); }
.sidebar-nav a.active { color: var(--accent-glow); background: rgba(0,201,104,0.06); border-left-color: var(--accent-glow); }
.sidebar-nav .nav-num {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,201,104,0.12);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-glow);
  flex-shrink: 0;
}


/* ===== MAIN CONTENT ===== */
.main-wrap {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
}

/* Tab pages */
.tab-page { display: none; }
.tab-page.active { display: block; }

/* General Prep page */
.page-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 36px 120px;
}

/* Prep Sheet — Notion-style editor */
.prep-sheet {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 200px;
  padding-left: 40px;
  counter-reset: ps-card;
}
.prep-sheet-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
  outline: none;
  border: none;
}
.prep-sheet-subtitle {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 40px;
}
.ps-section {
  margin-bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 24px 24px 24px;
  position: relative;
  transition: border-color 0.2s;
  counter-increment: ps-card;
}
.ps-section::before {
  content: counter(ps-card);
  position: absolute;
  top: 24px; left: -36px;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,201,104,0.15);
  border: 1px solid rgba(0,201,104,0.3);
  border-radius: 8px;
  font-size: 12px; font-weight: 700;
  color: var(--accent-glow);
}
.ps-section:hover {
  border-color: rgba(0,201,104,0.25);
}
/* Add card button between cards */
.ps-add-card {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  margin: 0;
  position: relative;
  cursor: pointer;
}
.ps-add-card::before {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 1px;
  background: transparent;
  transition: background 0.2s;
}
.ps-add-card:hover::before {
  background: rgba(0,201,104,0.25);
}
.ps-add-btn {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  opacity: 0;
  position: relative;
  z-index: 1;
}
.ps-add-card:hover .ps-add-btn {
  opacity: 1;
}
.ps-add-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: scale(1.15);
}
/* Sidebar reorder nav */
.sheet-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 8px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  border-left: 2px solid transparent;
  border-radius: 6px;
  margin: 0 8px;
  text-decoration: none;
  user-select: none;
}
.sheet-nav-item:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.sheet-nav-item.dragging {
  opacity: 0.4;
}
.sheet-nav-item.drag-over {
  border-top: 2px solid var(--accent-glow);
  border-radius: 0;
}
.sn-drag {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  cursor: grab;
  color: var(--text-dim);
  transition: color 0.15s;
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0;
}
.sn-drag:active { cursor: grabbing; }
.sheet-nav-item:hover .sn-drag { color: var(--text); }
.sheet-nav-item .sn-num {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,201,104,0.12);
  border-radius: 5px;
  font-size: 10px; font-weight: 700;
  color: var(--accent-glow);
  flex-shrink: 0;
}
.sheet-nav-item .sn-title {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ps-section-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 4px;
}
.ps-section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  padding: 0;
  outline: none;
  flex: 1;
}
.ps-delete-btn {
  width: 28px; height: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: all 0.15s;
  flex-shrink: 0;
  opacity: 0;
}
.ps-section:hover .ps-delete-btn {
  opacity: 1;
}
.ps-delete-btn:hover {
  background: rgba(232,69,60,0.1);
  border-color: rgba(232,69,60,0.3);
  color: var(--red);
}
.ps-section-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-style: italic;
}
.ps-editor {
  min-height: 80px;
  padding: 12px 16px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  white-space: pre-wrap;
}
.ps-editor:focus {
  border-color: rgba(0,201,104,0.5);
}
.ps-editor-bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 768px) { .ps-editor-bilingual { grid-template-columns: 1fr; } }
.ps-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-dim);
  opacity: 0.5;
  pointer-events: none;
}
.ps-editor h1 { font-size: 24px; font-weight: 700; margin: 12px 0 6px; color: var(--text); }
.ps-editor h2 { font-size: 20px; font-weight: 700; margin: 10px 0 4px; color: var(--text); }
.ps-editor h3 { font-size: 16px; font-weight: 700; margin: 8px 0 4px; color: var(--text); }
.ps-editor ul, .ps-editor ol { padding-left: 24px; margin: 4px 0; }
.ps-editor li { margin-bottom: 2px; }
.ps-editor blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 14px;
  margin: 8px 0;
  color: var(--text-dim);
  font-style: italic;
}
.ps-editor hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}
.ps-editor code {
  background: var(--surface2);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
}
.ps-divider {
  display: none;
}
/* Slash command menu */
.slash-menu {
  display: none;
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  z-index: 400;
  min-width: 220px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  max-height: 280px;
  overflow-y: auto;
}
.slash-menu.active { display: block; }
.slash-menu-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--text-dim);
  transition: all 0.1s;
}
.slash-menu-item:hover, .slash-menu-item.selected {
  background: rgba(0,201,104,0.12);
  color: var(--text);
}
.slash-menu-item .sm-icon {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: 6px;
  font-size: 14px;
  flex-shrink: 0;
}
.slash-menu-item .sm-label { font-weight: 500; }
.slash-menu-item .sm-desc { font-size: 11px; color: var(--text-dim); }
/* Floating toolbar */
.format-bar {
  display: none;
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  z-index: 400;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  gap: 2px;
}
.format-bar.active { display: flex; }
.format-bar button {
  width: 30px; height: 30px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.1s;
}
.format-bar button:hover { background: rgba(0,201,104,0.15); color: var(--text); }

/* ===== SECTIONS ===== */
section {
  margin-bottom: 56px;
  scroll-margin-top: 32px;
}
.section-header {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 24px;
}
.section-num {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,201,104,0.15);
  border: 1px solid rgba(0,201,104,0.3);
  border-radius: 9px;
  font-size: 14px; font-weight: 700;
  color: var(--accent-glow);
  flex-shrink: 0;
}
.section-header h2 { font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }

/* Bilingual columns */
.bilingual {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 1100px) { .bilingual { grid-template-columns: 1fr; } }
.lang-label {
  display: inline-block;
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 3px 10px;
  border-radius: 6px;
  margin-bottom: 12px;
  font-weight: 600;
}
.lang-en .lang-label { background: rgba(61,139,194,0.12); color: var(--blue); }
.lang-zh { order: -1; }
.lang-zh .lang-label { background: rgba(0,201,104,0.12); color: var(--accent-glow); }

/* Monolingual — single column, hide language label */
.monolingual .lang-en { max-width: 100%; }
.monolingual .lang-label { display: none; }

/* Pitch card */
.pitch-card {
  background: linear-gradient(135deg, rgba(0,201,104,0.1), rgba(0,201,104,0.03));
  border: 1px solid rgba(0,201,104,0.25);
  border-radius: 12px;
  padding: 24px;
  position: relative; overflow: hidden;
}
.pitch-card::before {
  content: '\201C';
  position: absolute; top: -10px; left: 14px;
  font-size: 90px;
  color: rgba(0,201,104,0.1);
  font-family: Georgia, serif; line-height: 1;
}
.pitch-card p { font-size: 14px; line-height: 1.85; position: relative; }
.pitch-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-glow);
  margin-bottom: 12px; display: block;
}

/* Strength table */
.strength-grid { display: flex; flex-direction: column; gap: 8px; }
.strength-row {
  display: grid; grid-template-columns: 1fr 1.5fr;
  gap: 1px; background: var(--border);
  border-radius: 9px; overflow: hidden;
}
.strength-row > div { padding: 12px 14px; background: var(--surface); font-size: 12.5px; }
.strength-row > div:first-child { font-weight: 600; color: var(--blue); background: var(--surface2); }
.strength-row strong { color: var(--green); }

/* Gap cards */
.gap-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.gap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  border-left: 3px solid var(--orange);
}
.gap-card h4 { font-size: 12px; color: var(--orange); margin-bottom: 4px; }
.gap-card p { font-size: 12px; color: var(--text-dim); line-height: 1.6; }

/* Q&A */
.qa-category { margin-bottom: 24px; }
.qa-category-label {
  font-size: 11px; text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-glow);
  margin-bottom: 12px; padding-left: 4px;
}
.qa-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.qa-item:hover { border-color: rgba(0,201,104,0.4); }
.qa-question {
  padding: 14px 16px;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; user-select: none;
}
.qa-question h3 { font-size: 13px; font-weight: 600; line-height: 1.5; }
.qa-toggle {
  width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface2);
  border-radius: 6px; flex-shrink: 0;
  transition: transform 0.3s, background 0.2s;
  font-size: 13px; color: var(--text-dim);
}
.qa-item.open .qa-toggle { transform: rotate(45deg); background: rgba(0,201,104,0.2); color: var(--accent-glow); }
.qa-answer { max-height: 0; overflow: hidden; transition: max-height 0.4s ease; }
.qa-answer-inner {
  padding: 0 16px 16px;
  font-size: 12.5px; line-height: 1.8; color: var(--text-dim);
}
.qa-answer-inner ul { padding-left: 16px; margin: 4px 0; }
.qa-answer-inner li { margin-bottom: 4px; }
.qa-answer-inner strong { color: var(--text); }
.qa-answer-inner .tip {
  display: inline-block;
  background: rgba(0,201,104,0.1);
  border: 1px solid rgba(0,201,104,0.2);
  color: var(--green);
  padding: 1px 7px; border-radius: 4px;
  font-size: 10px; font-weight: 600; margin-right: 4px;
}

/* Company table */
.company-grid { display: flex; flex-direction: column; gap: 6px; }
.company-row {
  display: grid; grid-template-columns: minmax(100px, 160px) 1fr;
  gap: 1px; background: var(--border);
  border-radius: 9px; overflow: hidden;
}
.company-row > div { padding: 10px 14px; background: var(--surface); font-size: 12.5px; }
.company-row > div:first-child { font-weight: 700; background: var(--surface2); font-size: 11.5px; }
.company-row > div:last-child { color: var(--text-dim); }
.company-row strong { color: var(--text); }

/* Ask list */
.ask-list { display: flex; flex-direction: column; gap: 8px; counter-reset: ask; }
.ask-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 14px 46px;
  position: relative;
  font-size: 12.5px; line-height: 1.7;
  color: var(--text-dim);
  counter-increment: ask;
}
.ask-item::before {
  content: counter(ask);
  position: absolute; left: 14px; top: 14px;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,201,104,0.15);
  border-radius: 5px;
  font-size: 11px; font-weight: 700; color: var(--accent-glow);
}

/* Controversy */
.controversy-card {
  background: var(--surface);
  border: 1px solid rgba(232,69,60,0.2);
  border-radius: 12px;
  padding: 22px;
  border-left: 3px solid var(--red);
}
.controversy-card h3 { color: var(--red); font-size: 14px; margin-bottom: 12px; }
.do-dont { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (max-width: 640px) { .do-dont { grid-template-columns: 1fr; } }
.do-col, .dont-col { background: var(--surface2); border-radius: 8px; padding: 12px; }
.do-col h4 { color: var(--green); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.dont-col h4 { color: var(--red); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.do-dont-text { font-size: 11.5px; color: var(--text-dim); line-height: 1.7; }
.do-dont-text ul { padding-left: 16px; margin: 0; }
.do-dont-text li { margin-bottom: 4px; }
.controversy-context { font-size: 12.5px; color: var(--text-dim); line-height: 1.7; }
.controversy-context ul { padding-left: 16px; margin: 4px 0; }
.controversy-context li { margin-bottom: 4px; }
.controversy-card ul { padding-left: 16px; margin: 4px 0; }
.controversy-card li { margin-bottom: 4px; line-height: 1.7; }
.script-box ul { padding-left: 16px; margin: 4px 0; }
.script-box li { margin-bottom: 2px; }
.script-box {
  background: var(--surface2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 12px;
  font-size: 12.5px; line-height: 1.7;
  color: var(--text-dim);
  border-left: 3px solid var(--blue);
  font-style: italic;
}

/* ===== CHECKLIST — prioritized layout ===== */
.checklist-day {
  margin-bottom: 32px;
}
.checklist-day-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.day-badge {
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.day-1 .day-badge { background: rgba(232,69,60,0.12); color: var(--red); }
.day-2 .day-badge { background: rgba(245,166,35,0.12); color: var(--orange); }
.day-of .day-badge { background: rgba(0,201,104,0.12); color: var(--green); }
.day-label { font-size: 13px; color: var(--text-dim); }
.priority-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: auto;
  flex-shrink: 0;
}
.priority-critical { background: rgba(232,69,60,0.15); color: var(--red); }
.priority-high { background: rgba(245,166,35,0.15); color: var(--orange); }
.priority-medium { background: rgba(61,139,194,0.15); color: var(--blue); }

.checklist { display: flex; flex-direction: column; gap: 6px; }
.check-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.check-item:hover { border-color: rgba(0,201,104,0.4); }
.check-item.done { opacity: 0.4; }
.check-item.done .check-text { text-decoration: line-through; }
.check-box {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  margin-top: 1px;
  cursor: pointer;
}
.check-item.done .check-box { background: var(--green); border-color: var(--green); }
.check-box svg { opacity: 0; transition: opacity 0.2s; }
.check-item.done .check-box svg { opacity: 1; }
.check-text { font-size: 13px; line-height: 1.6; flex: 1; }
.check-text strong { color: var(--text); }
.check-detail {
  font-size: 11.5px;
  color: var(--text-dim);
  margin-top: 4px;
  line-height: 1.5;
}
.time-est {
  font-size: 11px;
  color: var(--text-dim);
  background: var(--surface2);
  padding: 2px 8px;
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 2px;
  margin-left: auto;
}

.values-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 12px;
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 11.5px;
}

/* Progress bar */
.progress-bar {
  position: fixed;
  bottom: 0; left: var(--sidebar-w); right: 0;
  height: 44px;
  background: rgba(28,28,30,0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  gap: 14px; padding: 0 24px;
  z-index: 100;
}
.progress-text { font-size: 12px; color: var(--text-dim); font-weight: 500; }
.progress-track { width: 180px; height: 5px; background: var(--surface2); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); border-radius: 3px; transition: width 0.4s ease; width: 0%; }

/* Flashcard */
.flashcard-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(28,28,30,0.95);
  backdrop-filter: blur(20px);
  z-index: 300;
  align-items: center; justify-content: center;
  flex-direction: column; padding: 40px;
}
.flashcard-overlay.active { display: flex; }
.flashcard {
  width: 100%; max-width: 860px; min-height: 300px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px;
  cursor: pointer;
  transition: transform 0.3s;
}
.flashcard:hover { transform: translateY(-2px); }
.flashcard-front {
  display: flex; align-items: center; justify-content: center;
  text-align: center; min-height: 220px;
}
.flashcard-front .fc-bilingual {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 36px; text-align: left; width: 100%;
}
.flashcard-front .fc-bilingual > div { font-size: 17px; font-weight: 600; line-height: 1.6; }
.flashcard-front .fc-bilingual .fc-zh { color: var(--accent-glow); }
.flashcard-front .fc-mono { font-size: 17px; font-weight: 600; line-height: 1.6; }
.flashcard-back { display: none; }
.flashcard-back .fc-bilingual-answer {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 36px; font-size: 13.5px; line-height: 1.8; color: var(--text-dim);
}
.flashcard-back .fc-mono-answer {
  font-size: 13.5px; line-height: 1.8; color: var(--text-dim);
}
.flashcard.flipped .flashcard-front { display: none; }
.flashcard.flipped .flashcard-back { display: block; }
.flashcard-controls { display: flex; gap: 12px; margin-top: 24px; }
.fc-btn {
  padding: 10px 24px; border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface); color: var(--text);
  cursor: pointer; font-size: 14px; font-weight: 500;
  transition: all 0.2s;
}
.fc-btn:hover { background: var(--surface2); border-color: var(--accent); }
.fc-btn.primary { background: var(--accent); border-color: var(--accent); color: #1C1C1E; }
.fc-close {
  position: absolute; top: 24px; right: 24px;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-dim); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.fc-counter { margin-top: 16px; font-size: 13px; color: var(--text-dim); }
.flashcard-trigger {
  position: fixed; bottom: 56px; right: 24px;
  z-index: 100;
  padding: 10px 20px;
  background: var(--accent); border: none; border-radius: 8px;
  color: #1C1C1E; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(0,201,104,0.3);
}
.flashcard-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,201,104,0.4); }

/* Editable hint */
[contenteditable="true"]:hover {
  box-shadow: 0 0 0 1px rgba(0,201,104,0.2);
  border-radius: 4px;
  cursor: text;
}
[contenteditable="true"]:focus {
  box-shadow: 0 0 0 1px rgba(0,201,104,0.5) !important;
}
[contenteditable="true"] ul, [contenteditable="true"] ol {
  padding-left: 24px;
  margin: 4px 0;
}
[contenteditable="true"] li {
  margin-bottom: 2px;
  line-height: 1.7;
}

/* Mobile */
@media (max-width: 768px) {
  .sidebar { width: 100%; height: auto; position: relative; }
  .main-wrap { margin-left: 0; }
  .progress-bar { left: 0; }
  .sidebar-nav { display: flex; overflow-x: auto; padding: 8px 12px; gap: 4px; }
  .sidebar-nav a { padding: 6px 12px; white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .sidebar-nav a.active { border-bottom-color: var(--accent-glow); border-left: none; }
}


/* ===== DASHBOARD-SPECIFIC STYLES ===== */
.dashboard-wrap {
  min-height: 100vh;
  padding: 60px 40px 120px;
  max-width: 1100px;
  margin: 0 auto;
}
.dashboard-header {
  margin-bottom: 48px;
}
.dashboard-header h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 6px;
}
.dashboard-header h1 span { color: var(--accent-glow); }
.dashboard-header p {
  font-size: 14px;
  color: var(--text-dim);
}
.dashboard-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.dash-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.dash-btn:hover { border-color: var(--accent); background: var(--surface2); }
.dash-btn.primary { background: var(--accent); border-color: var(--accent); color: #1C1C1E; }
.dash-btn.primary:hover { background: var(--accent-glow); }
.dash-btn.danger { color: var(--red); }
.dash-btn.danger:hover { border-color: var(--red); background: rgba(232,69,60,0.08); }

/* Card grid */
.prep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}
.prep-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}
.prep-card:hover { border-color: rgba(0,201,104,0.4); transform: translateY(-2px); }
.prep-card .card-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.prep-card .card-company {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  margin-top: 6px;
}
.prep-card .card-role {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.prep-card .card-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prep-card .card-progress-track {
  flex: 1;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
}
.prep-card .card-progress-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s;
}
.prep-card .card-progress-text {
  font-size: 11px;
  color: var(--text-dim);
  font-weight: 600;
  flex-shrink: 0;
}
.prep-card .card-delete {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-dim);
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: all 0.15s;
}
.prep-card:hover .card-delete { opacity: 1; }
.prep-card .card-delete:hover {
  background: rgba(232,69,60,0.1);
  border-color: rgba(232,69,60,0.3);
  color: var(--red);
}
.prep-card .card-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.prep-card .card-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--surface2);
  color: var(--text-dim);
}

/* New prep form */
.new-prep-form {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 32px;
}
.new-prep-form.active { display: block; }
.new-prep-form h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
}
.form-row {
  display: flex;
  gap: 14px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.form-field {
  flex: 1;
  min-width: 200px;
}
.form-field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.form-field input, .form-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface2);
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--accent);
}
/* Color swatches */
.color-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  outline: none;
  padding: 0;
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.selected {
  border-color: white;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor;
}

/* Select dropdown fix */
.form-field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238888a0' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}
.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}
.empty-state p {
  font-size: 20px;
  margin-bottom: 4px;
}

/* ===== DASHBOARD HEADER ROW ===== */
.dashboard-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.settings-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-dim);
  transition: all 0.2s;
  flex-shrink: 0;
}
.settings-icon:hover { color: var(--accent-glow); border-color: var(--accent); background: var(--surface2); }
.settings-back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: color 0.15s;
}
.settings-back:hover { color: var(--accent-glow); }

/* ===== SETTINGS PAGE ===== */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.settings-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}
.settings-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.settings-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 18px;
  line-height: 1.5;
}

/* Info tooltip */
.info-tooltip {
  position: relative;
}
.info-icon {
  width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  font-style: italic;
  font-family: Georgia, serif;
  color: var(--text-dim);
  cursor: help;
  transition: all 0.15s;
}
.info-icon:hover { color: var(--accent-glow); border-color: var(--accent); }
.info-tooltip-content {
  display: none;
  position: absolute;
  top: 28px; left: -40px;
  width: 320px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-dim);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  z-index: 10;
}
.info-tooltip:hover .info-tooltip-content { display: block; }

/* Provider cards */
.provider-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.provider-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.provider-card:hover { border-color: rgba(0,201,104,0.3); background: rgba(0,201,104,0.03); }
.provider-card.selected { border-color: var(--accent); background: rgba(0,201,104,0.06); }
.provider-logo {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
@media (max-width: 600px) { .provider-cards { grid-template-columns: repeat(2, 1fr); } }

/* API key input */
.api-key-wrap {
  display: flex;
  gap: 0;
}
.api-key-wrap input {
  flex: 1;
  border-radius: 8px 0 0 8px;
  border-right: none;
}
.api-key-toggle {
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 0 8px 8px 0;
  background: var(--surface2);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.api-key-toggle:hover { color: var(--text); background: var(--surface); }
.api-status {
  margin-top: 10px;
  font-size: 12px;
  min-height: 18px;
}
.api-help-text {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.api-help-text a { color: var(--accent-glow); text-decoration: none; }
.api-help-text a:hover { text-decoration: underline; }

/* API guide (collapsible) */
.api-guide {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.api-guide summary {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
  list-style: none;
}
.api-guide summary::-webkit-details-marker { display: none; }
.api-guide summary::before {
  content: '\25B8';
  display: inline-block;
  margin-right: 8px;
  transition: transform 0.2s;
  font-size: 11px;
}
.api-guide[open] summary::before { transform: rotate(90deg); }
.api-guide summary:hover { color: var(--text); }
.api-guide-body {
  padding: 0 16px 16px;
}
.api-guide-body > p {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 16px;
}
.api-guide-providers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.api-guide-item {
  background: var(--surface2);
  border-radius: 8px;
  padding: 14px 16px;
}
.api-guide-item h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.api-guide-item ol {
  padding-left: 18px;
  margin: 0;
}
.api-guide-item li {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.7;
  margin-bottom: 2px;
}
.api-guide-item a { color: var(--accent-glow); text-decoration: none; }
.api-guide-item a:hover { text-decoration: underline; }
.api-guide-note {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.7;
}
.api-guide-note code {
  background: var(--bg);
  padding: 1px 5px;
  border-radius: 3px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 10.5px;
}
.api-guide-privacy {
  font-size: 11.5px;
  color: var(--text-dim);
  opacity: 0.7;
  line-height: 1.5;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* ===== LOGIN PAGE ===== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.login-card {
  text-align: center;
  max-width: 380px;
  width: 100%;
}
.login-logo {
  height: 48px;
  margin-bottom: 16px;
}
.login-card h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 10px;
}
.login-card h1 span { color: var(--accent-glow); }
.login-card p {
  font-size: 14px;
  color: var(--text-dim);
  margin-bottom: 32px;
}
.login-google-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 150ms ease;
}
.login-google-btn:hover {
  border-color: var(--accent);
  background: var(--surface2);
  transform: translateY(-1px);
}

/* Sign out button in dashboard */
.signout-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.signout-btn:hover { color: var(--red); border-color: rgba(232,69,60,0.3); }

/* Confirm modal */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,28,30,0.8);
  backdrop-filter: blur(8px);
  z-index: 500;
  align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 380px;
  width: 90%;
}
.modal-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}
.modal-card p {
  font-size: 14px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-bottom: 20px;
}
.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.dash-btn.danger {
  background: var(--red);
  border-color: var(--red);
  color: white;
}
.dash-btn.danger:hover {
  background: #d03a32;
}

/* Generation loading overlay */
.gen-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(28,28,30,0.95);
  backdrop-filter: blur(24px);
  z-index: 500;
  align-items: center; justify-content: center;
  flex-direction: column;
}
.gen-overlay.active { display: flex; }
body.overlay-active { overflow: hidden; }
.gen-overlay-content { max-width: 380px; width: 100%; padding: 24px; }
.gen-header-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}
.gen-overlay-content h3 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  text-align: center;
  transition: opacity 0.3s ease;
}
.gen-spinner {
  width: 36px; height: 36px;
  border: 4px solid var(--surface2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Step checklist */
.gen-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.gen-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: 10px;
  opacity: 0.3;
  transform: translateY(6px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s;
}
.gen-step.active {
  opacity: 1;
  transform: translateY(0);
  background: rgba(255,255,255,0.03);
}
.gen-step.done {
  opacity: 0.55;
  transform: translateY(0);
}
.gen-step-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-dim);
  transition: background 0.3s, color 0.3s;
}
.gen-step.active .gen-step-icon {
  background: rgba(0,201,104,0.15);
  color: var(--accent-glow);
}
.gen-step.done .gen-step-icon {
  background: rgba(0,201,104,0.1);
  color: var(--accent);
}
.gen-step-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.3s;
}
.gen-step.active .gen-step-label {
  color: var(--text);
  font-weight: 600;
}
.gen-step-check {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gen-step.done .gen-step-check {
  opacity: 1;
  transform: scale(1);
}
/* Pulse animation on active step icon */
.gen-step.active .gen-step-icon {
  animation: stepPulse 1.5s ease-in-out infinite;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,201,104,0.2); }
  50% { box-shadow: 0 0 0 6px rgba(0,201,104,0); }
}
.gen-elapsed {
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.5;
  min-width: 28px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* Progress bar inside finalize step */
.gen-progress-wrap {
  width: 100%;
  margin-top: 16px;
  padding: 0 16px;
}
.gen-progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
}
.gen-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.5s ease;
}
.gen-progress-label {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}

/* ===== SIDEBAR CHAT ===== */
.sidebar-chat {
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  max-height: 280px;
  min-height: 120px;
  overscroll-behavior: contain;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chat-msg {
  font-size: 12px;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 10px;
  max-width: 95%;
  word-wrap: break-word;
}
.chat-msg-ai {
  background: var(--surface2);
  color: var(--text-dim);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.chat-msg-user {
  background: rgba(0,201,104,0.12);
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-msg-loading {
  color: var(--text-dim);
  font-style: italic;
}
.chat-input-wrap {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.chat-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 12px;
  outline: none;
  min-width: 0;
}
.chat-input:focus { border-color: var(--accent); }
.chat-input::placeholder { color: var(--text-dim); opacity: 0.5; }
.chat-send {
  width: 32px; height: 32px;
  border: none;
  background: var(--accent);
  color: #1C1C1E;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 150ms ease;
}
.chat-send:hover { background: var(--accent-glow); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Generate notes button */
.gen-notes-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 24px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #1C1C1E;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 150ms ease;
}
.gen-notes-btn:hover {
  background: var(--accent-glow);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,201,104,0.25);
}
.gen-notes-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.gen-notes-btn .btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== BILINGUAL SYNC HIGHLIGHTING ===== */
@keyframes change-glow {
  0%   { background-color: rgba(0, 201, 104, 0.18); }
  70%  { background-color: rgba(0, 201, 104, 0.08); }
  100% { background-color: transparent; }
}
.change-highlight {
  animation: change-glow 2.5s ease-out;
  border-radius: 3px;
}
mark.change-highlight {
  background: none;
  color: inherit;
  padding: 1px 2px;
  display: inline;
}
.syncing {
  opacity: 0.6;
  pointer-events: none;
  transition: opacity 0.2s;
}
