/* =========================================
   Cityscape AI — Stylesheet
   Light design, Montserrat, smooth corners
   ========================================= */

:root {
  --accent: #449342;
  --accent-light: #edf7ed;
  --accent-dark: #357a35;
  --blue: #02353c;
  --blue-light: #034a54;
  --blue-dark: #011f24;
  --teal: #2eaf7d;
  --teal-light: #3fd0c9;
  --bg: #f4faf4;
  --bg-surface: #ffffff;
  --bg-raised: #edf5ed;
  --bg-hover: #e0efe0;
  --border: rgba(2,53,60,0.07);
  --border-mid: rgba(2,53,60,0.13);
  --text: #3d5a5a;
  --text-dark: #02353c;
  --text-muted: #4a6a6a;
  --text-dim: #a8c0c0;
  --sidebar-width: 268px;
  --topbar-height: 52px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --font: 'Montserrat', sans-serif;
  --shadow-sm: 0 1px 4px rgba(2,53,60,0.06);
  --shadow-md: 0 4px 16px rgba(2,53,60,0.1);
  --shadow-lg: 0 12px 40px rgba(2,53,60,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ==================== ROOT ==================== */
.app-root { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.app-root-hidden { display: none !important; }
.app-shell { display: flex; flex: 1; overflow: hidden; }

/* ==================== BANNER ==================== */
.top-banner {
  background: var(--blue);
  color: rgba(255,255,255,0.65);
  font-size: 11px; font-weight: 500;
  padding: 5px 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.top-banner a { color: rgba(255,255,255,0.65); text-decoration: none; }
.top-banner a:hover { color: #fff; }
.top-banner-left { display: flex; gap: 10px; align-items: center; }
.banner-sep { opacity: 0.25; }

/* ==================== SIDEBAR ==================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-surface);
  border-right: none;
  display: flex; flex-direction: column;
  flex-shrink: 0; overflow: hidden;
  transition: transform 0.3s ease;
  box-shadow: 6px 0 24px rgba(2,53,60,0.18), 2px 0 0 rgba(2,53,60,0.08);
  z-index: 10;
}

.sidebar-header {
  height: var(--topbar-height);
  padding: 0 18px;
  border-bottom: none;
  display: flex; align-items: center; justify-content: space-between;
  background: var(--blue);
  flex-shrink: 0;
}

.logo { display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 34px; height: 34px; background: var(--accent); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; color: #fff; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.25; }
.logo-name { font-weight: 700; font-size: 14px; color: #fff; }
.logo-tag { font-size: 10px; color: rgba(255,255,255,0.45); font-weight: 400; }

.sidebar-close { display: none; background: none; border: none; color: rgba(255,255,255,0.5); font-size: 14px; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.sidebar-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.sidebar-nav { padding: 14px 12px; border-top: 1px solid var(--border); }
.nav-btn { width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--accent); border: none; border-radius: var(--radius-md); color: #fff; font-family: var(--font); font-size: 13px; font-weight: 600; cursor: pointer; transition: background 0.15s; }
.nav-btn:hover { background: var(--accent-dark); }

.sidebar-section { flex: 1; padding: 0 12px; overflow-y: auto; }
.sidebar-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-dim); padding: 0 4px; margin-bottom: 6px; font-weight: 600; }

.recent-list { display: flex; flex-direction: column; gap: 2px; }
.recent-item-wrap { display: flex; align-items: center; gap: 4px; }
.recent-item { flex: 1; display: flex; flex-direction: column; padding: 8px 10px; border-radius: var(--radius-md); cursor: pointer; border: none; background: none; text-align: left; transition: background 0.15s; min-width: 0; }
.recent-item:hover { background: var(--accent-light); }
.recent-title { font-size: 12px; color: var(--text-muted); font-weight: 500; font-family: var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item:hover .recent-title { color: var(--accent-dark); }
.recent-date { font-size: 10px; color: var(--text-dim); margin-top: 1px; font-family: var(--font); }
.recent-delete { background: none; border: none; color: var(--text-dim); font-size: 11px; cursor: pointer; padding: 6px 7px; border-radius: var(--radius-sm); flex-shrink: 0; transition: background 0.15s, color 0.15s; }
.recent-delete:hover { background: #fee2e2; color: #e24b4a; }

.empty-state { font-size: 12px; color: var(--text-dim); padding: 6px 4px; }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }
.api-status { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-muted); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.status-dot.error { background: #e24b4a; }

.settings-btn { display: block; text-align: center; background: var(--accent-light); border: 1px solid rgba(74,155,95,0.15); border-radius: var(--radius-md); color: var(--accent-dark); font-size: 12px; font-weight: 600; padding: 8px 12px; cursor: pointer; transition: background 0.15s; text-decoration: none; font-family: var(--font); }
.settings-btn:hover { background: #d4eddb; }

/* ==================== MAIN ==================== */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* ==================== TOPBAR ==================== */
.topbar { height: var(--topbar-height); background: var(--blue); display: flex; align-items: center; padding: 0 18px; gap: 10px; flex-shrink: 0; box-shadow: 0 2px 8px rgba(2,53,60,0.25); }
.menu-toggle { display: none; background: none; border: none; color: rgba(255,255,255,0.8); font-size: 18px; cursor: pointer; padding: 4px 6px; border-radius: var(--radius-sm); }
.menu-toggle:hover { background: rgba(255,255,255,0.1); }
.topbar-logo-mark { width: 26px; height: 26px; background: var(--accent); border-radius: 7px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 10px; color: #fff; flex-shrink: 0; }
.topbar-title { font-weight: 600; font-size: 14px; flex: 1; color: rgba(255,255,255,0.9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 8px; }
.btn-ghost { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: var(--radius-md); color: rgba(255,255,255,0.85); font-size: 12px; font-weight: 500; padding: 6px 14px; cursor: pointer; transition: background 0.15s; font-family: var(--font); }
.btn-ghost:hover { background: rgba(255,255,255,0.2); }

/* ==================== PAGES ==================== */
.page { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }

/* ==================== CHAT HERO ==================== */
.chat-container { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-hero {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; padding: 36px 28px 20px;
  overflow-y: auto; background: var(--bg);
}

.hero-badge {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 14px; border-radius: 100px;
  margin-bottom: 18px;
  border: 1px solid rgba(74,155,95,0.15);
}

.hero-title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 700; line-height: 1.2;
  color: var(--text-dark);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: -0.01em;
}
.hero-title em { font-style: normal; color: var(--accent); }

.hero-desc {
  font-size: 13.5px; color: var(--text-muted);
  max-width: 520px; margin-bottom: 28px;
  font-weight: 400; line-height: 1.75;
  text-align: center;
}

.hero-features {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 10px; width: 100%; max-width: 540px; margin-bottom: 24px;
}
@media (min-width: 600px) { .hero-features { grid-template-columns: repeat(3, 1fr); } }

.hero-feature {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: var(--shadow-sm);
}

.hero-feature-icon {
  width: 36px; height: 36px;
  background: var(--blue);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.hero-feature-title { font-size: 12px; font-weight: 600; color: var(--text-dark); }
.hero-feature-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.hero-how {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  width: 100%; max-width: 540px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.hero-how-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 12px; }

.hero-steps { display: flex; flex-direction: column; gap: 8px; }
.hero-step { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--text-muted); }
.step-num { width: 20px; height: 20px; background: var(--accent); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: #fff; flex-shrink: 0; margin-top: 1px; }

.btn-primary { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-lg); padding: 13px 30px; font-family: var(--font); font-weight: 700; font-size: 14px; cursor: pointer; transition: background 0.15s, transform 0.1s; box-shadow: 0 4px 16px rgba(74,155,95,0.3); }
.btn-primary:hover { background: var(--accent-dark); box-shadow: 0 6px 20px rgba(74,155,95,0.4); }
.btn-primary:active { transform: scale(0.98); }
.btn-start { min-width: 180px; }

/* ==================== MESSAGES ==================== */
.messages-list { flex: 1; overflow-y: auto; padding: 20px 24px 12px; display: flex; flex-direction: column; gap: 2px; scroll-behavior: smooth; }
.messages-list::-webkit-scrollbar { width: 4px; }
.messages-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.message { display: flex; gap: 10px; max-width: 680px; animation: fadeUp 0.2s ease; padding: 3px 0; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

.message.user { align-self: flex-end; flex-direction: row-reverse; max-width: 560px; }
.message.assistant { align-self: flex-start; }

.msg-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 700; color: #fff; flex-shrink: 0; margin-top: 4px; }
.message.user .msg-avatar { background: var(--blue); }

.msg-bubble { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 11px 15px; font-size: 13px; line-height: 1.65; color: var(--text); box-shadow: var(--shadow-sm); }
.message.user .msg-bubble { background: var(--blue); border-color: var(--blue); color: rgba(255,255,255,0.9); }
.msg-bubble p { margin: 0 0 7px; }
.msg-bubble p:last-child { margin-bottom: 0; }
.msg-bubble strong { font-weight: 600; color: var(--text-dark); }
.message.user .msg-bubble strong { color: #fff; }

.typing-indicator .msg-bubble { padding: 13px 16px; }
.typing-dots { display: flex; gap: 4px; align-items: center; }
.typing-dots span { width: 5px; height: 5px; border-radius: 50%; background: var(--text-dim); animation: dot 1.2s infinite; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: 0.4; } 50% { transform: translateY(-4px); opacity: 1; } }

/* ==================== INPUT BAR ==================== */
.input-bar { background: var(--bg-surface); border-top: 1px solid var(--border); padding: 12px 20px 14px; flex-shrink: 0; box-shadow: 0 -1px 6px rgba(0,0,0,0.03); }
.input-wrapper { display: flex; align-items: flex-end; gap: 8px; background: var(--bg-raised); border: 1.5px solid var(--border-mid); border-radius: var(--radius-xl); padding: 8px 8px 8px 16px; transition: border-color 0.15s; }
.input-wrapper:focus-within { border-color: var(--accent); }
.chat-input { flex: 1; background: none; border: none; outline: none; color: var(--text-dark); font-family: var(--font); font-size: 13px; line-height: 1.5; resize: none; max-height: 130px; overflow-y: auto; }
.chat-input::placeholder { color: var(--text-dim); }
.send-btn { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); border: none; color: #fff; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.15s, transform 0.1s; flex-shrink: 0; }
.send-btn:hover { background: var(--accent-dark); }
.send-btn:active { transform: scale(0.9); }
.send-btn:disabled { background: var(--text-dim); cursor: not-allowed; }
.input-hint { font-size: 10px; color: var(--text-dim); text-align: center; margin-top: 5px; }

/* ==================== RESULTS PAGE ==================== */
.results-page { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg); }
.refine-bar { display: flex; gap: 10px; align-items: center; padding: 12px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border); flex-shrink: 0; }
.refine-input { flex: 1; background: var(--bg-raised); border: 1.5px solid var(--border-mid); border-radius: var(--radius-xl); padding: 9px 16px; font-family: var(--font); font-size: 13px; color: var(--text-dark); outline: none; transition: border-color 0.15s; }
.refine-input:focus { border-color: var(--accent); }
.refine-input::placeholder { color: var(--text-dim); }
.refine-btn { padding: 9px 20px; border-radius: var(--radius-lg); font-size: 13px; white-space: nowrap; box-shadow: none; }

.results-controls { display: flex; gap: 16px; align-items: center; padding: 10px 20px; background: var(--bg-surface); border-bottom: 1px solid var(--border); flex-shrink: 0; flex-wrap: wrap; }
.control-group { display: flex; align-items: center; gap: 8px; }
.control-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 600; white-space: nowrap; }
.pill-group { display: flex; gap: 4px; flex-wrap: wrap; }
.pill { background: none; border: 1px solid var(--border-mid); border-radius: 100px; color: var(--text-muted); font-size: 11px; font-weight: 500; padding: 4px 11px; cursor: pointer; transition: all 0.15s; font-family: var(--font); }
.pill:hover { border-color: var(--accent); color: var(--accent); }
.pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.output-tabs { display: flex; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; background: var(--bg-raised); }
.output-tabs::-webkit-scrollbar { display: none; }
.output-tab { padding: 10px 16px; background: none; border: none; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap; font-family: var(--font); }
.output-tab:hover { color: var(--accent); }
.output-tab.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--bg-surface); }

.output-body { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.tab-content { display: none; flex: 1; flex-direction: column; overflow: hidden; }
.tab-content.active { display: flex; }

.output-text { flex: 1; overflow-y: auto; padding: 24px 28px; font-size: 13px; line-height: 1.8; color: var(--text); white-space: pre-wrap; background: var(--bg-surface); }
.output-text::-webkit-scrollbar { width: 4px; }
.output-text::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.output-actions { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-shrink: 0; background: var(--bg-raised); flex-wrap: wrap; }

.btn-copy { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-md); padding: 8px 16px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; font-family: var(--font); }
.btn-copy:hover { background: var(--accent-dark); }

.btn-ghost-sm { background: none; border: 1px solid var(--border-mid); border-radius: var(--radius-md); color: var(--text-muted); font-size: 11px; font-weight: 500; padding: 7px 12px; cursor: pointer; transition: background 0.15s, color 0.15s; font-family: var(--font); }
.btn-ghost-sm:hover { background: var(--accent-light); color: var(--accent); }

.btn-linkedin { background: #0077b5; color: #fff; border: none; border-radius: var(--radius-md); padding: 8px 16px; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 0.15s; font-family: var(--font); }
.btn-linkedin:hover { background: #005f8e; }

/* ==================== MODALS ==================== */
.modal-overlay { position: fixed; inset: 0; background: rgba(2,53,60,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(8px); }
.modal { background: var(--bg-surface); border-radius: 22px; width: 100%; max-width: 400px; margin: 20px; overflow: hidden; box-shadow: var(--shadow-lg); animation: modalIn 0.2s ease; }
.modal-wide { max-width: 520px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-header { padding: 20px 22px 16px; border-bottom: 1px solid var(--border); background: var(--blue); }
.modal-header h3 { font-size: 15px; font-weight: 700; color: #fff; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.modal-body p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.modal-desc { font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.tone-textarea { width: 100%; min-height: 120px; background: var(--bg-raised); border: 1.5px solid var(--border-mid); border-radius: var(--radius-md); padding: 12px 14px; font-family: var(--font); font-size: 13px; color: var(--text-dark); outline: none; resize: vertical; transition: border-color 0.15s; }
.tone-textarea:focus { border-color: var(--accent); }
.tone-textarea::placeholder { color: var(--text-dim); }
.modal-footer { padding: 14px 22px 18px; display: flex; justify-content: flex-end; gap: 8px; }
.btn-ghost-modal { background: none; border: 1px solid var(--border-mid); border-radius: var(--radius-md); color: var(--text-muted); font-size: 13px; font-weight: 500; padding: 8px 16px; cursor: pointer; transition: background 0.15s; font-family: var(--font); }
.btn-ghost-modal:hover { background: var(--bg-hover); }
.btn-primary-modal { background: var(--accent); color: #fff; border: none; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; padding: 8px 18px; cursor: pointer; transition: background 0.15s; font-family: var(--font); }
.btn-primary-modal:hover { background: var(--accent-dark); }

/* ==================== TOAST ==================== */
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(70px); background: var(--text-dark); color: #fff; font-size: 12px; font-weight: 600; padding: 10px 20px; border-radius: 100px; z-index: 2000; transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s; opacity: 0; pointer-events: none; white-space: nowrap; font-family: var(--font); box-shadow: var(--shadow-md); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 640px) {
  .sidebar { position: fixed; inset: 0; z-index: 200; transform: translateX(-100%); width: 270px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-close { display: block; }
  .menu-toggle { display: block; }
  .hero-features { grid-template-columns: 1fr; }
  .top-banner { display: none; }
  .results-controls { gap: 10px; }
}

/* ==================== RESULTS SHORTCUT ==================== */
.results-shortcut {
  padding: 10px 20px;
  background: var(--accent-light);
  border-top: 1px solid rgba(74,155,95,0.15);
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.btn-view-results {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 10px 28px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 3px 12px rgba(74,155,95,0.3);
  letter-spacing: 0.01em;
}
.btn-view-results:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-view-results:active { transform: scale(0.98); }

/* ==================== COMPLETION MESSAGE BUTTON ==================== */
.completion-bubble { max-width: 460px; }
.completion-bubble p { margin-bottom: 10px; }

.btn-go-results {
  display: inline-block;
  margin-top: 6px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 10px 22px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  box-shadow: 0 3px 12px rgba(74,155,95,0.3);
  letter-spacing: 0.01em;
}
.btn-go-results:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-go-results:active { transform: scale(0.98); }

/* ==================== PASSWORD SCREEN ==================== */
.password-screen {
  position: fixed; inset: 0;
  background: var(--blue);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}

.password-card {
  background: var(--bg-surface);
  border-radius: 24px;
  padding: 40px 36px;
  width: 100%; max-width: 360px;
  margin: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}

.password-logo {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 24px;
}
.password-logo-mark {
  width: 42px; height: 42px;
  background: var(--accent);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff;
}
.password-logo-text { display: flex; flex-direction: column; line-height: 1.25; text-align: left; }
.password-logo-name { font-weight: 700; font-size: 16px; color: var(--text-dark); }
.password-logo-tag { font-size: 11px; color: var(--text-muted); }

.password-title { font-size: 20px; font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.password-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; }

.password-input-wrap { display: flex; gap: 8px; width: 100%; }
.password-input {
  flex: 1; background: var(--bg-raised);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 11px 16px; font-family: var(--font);
  font-size: 14px; color: var(--text-dark);
  outline: none; transition: border-color 0.15s;
}
.password-input:focus { border-color: var(--accent); }
.password-input::placeholder { color: var(--text-dim); }

.password-btn {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-md);
  padding: 11px 20px; font-family: var(--font);
  font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s; white-space: nowrap;
}
.password-btn:hover { background: var(--accent-dark); }

.password-error {
  margin-top: 12px; font-size: 12px;
  color: #e24b4a; min-height: 18px; font-weight: 500;
}

/* ==================== JOBADDER SUMMARY SECTION ==================== */
.jobadder-summary-section {
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
  flex-shrink: 0;
}

.jobadder-summary-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 28px 6px;
}

.jobadder-label-text {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-dark);
}

.jobadder-char-count {
  font-size: 10px; color: var(--text-dim); font-weight: 500;
}

.jobadder-summary-text {
  flex: none !important;
  max-height: 80px;
  padding: 6px 28px 10px !important;
  font-size: 12.5px !important;
  background: var(--bg-raised) !important;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted) !important;
}

/* ==================== RESULTS PAGE ANIMATIONS ==================== */

@keyframes sectionFadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.output-text.generating {
  background: linear-gradient(
    90deg,
    var(--bg-surface) 0%,
    var(--bg-raised) 40%,
    var(--bg-surface) 60%,
    var(--bg-raised) 100%
  );
  background-size: 200% auto;
  animation: shimmer 1.5s linear infinite;
  color: transparent !important;
  border-radius: var(--radius-md);
  min-height: 120px;
}

.output-text.section-ready {
  animation: sectionFadeIn 0.4s ease forwards;
}

.tab-content.active .output-text {
  animation: sectionFadeIn 0.3s ease;
}

/* Progress bar at top of results page */
.generation-progress {
  height: 3px;
  background: var(--bg-raised);
  flex-shrink: 0;
  overflow: hidden;
}

.generation-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 0 2px 2px 0;
  transition: width 0.5s ease;
  width: 0%;
}

/* ==================== PLATFORM TABS ==================== */
.advert-tab { color: #c0392b !important; }
.advert-tab.active { border-bottom-color: #c0392b !important; color: #c0392b !important; background: var(--bg-surface); }

.indeed-tab { color: #2557a7 !important; }
.indeed-tab.active { border-bottom-color: #2557a7 !important; color: #2557a7 !important; background: var(--bg-surface); }

.cvlib-tab { color: #27ae60 !important; }
.cvlib-tab.active { border-bottom-color: #27ae60 !important; color: #27ae60 !important; background: var(--bg-surface); }

.tab-platform-header {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 28px 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-surface);
}

.platform-logo {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff;
  flex-shrink: 0;
}

.indeed-logo { background: #2557a7; }
.cvlib-logo { background: #27ae60; font-size: 10px; }

.platform-name { font-size: 13px; font-weight: 700; color: var(--text-dark); }
.platform-desc { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.btn-platform {
  border: none; border-radius: var(--radius-md);
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: opacity 0.15s;
  font-family: var(--font); color: #fff;
}
.btn-platform:hover { opacity: 0.85; }
.indeed-btn { background: #2557a7; }
.cvlib-btn { background: #e84b37; }

.jobadder-prompt-label {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 28px 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.jobadder-actions {
  border-top: none !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

/* ==================== INTERNAL JD LAYOUT ==================== */
.jd-page {
  flex: 1; overflow-y: auto;
  display: flex; flex-direction: column;
  background: var(--bg);
}

.jd-section {
  background: var(--bg-surface);
  border-bottom: 2px solid var(--bg-raised);
  flex-shrink: 0;
}

.jd-main { flex: 1; display: flex; flex-direction: column; }
.jd-main .jd-section-body { flex: 1; }

.jd-section-header {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  padding: 12px 24px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
}

.jd-section-title {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--accent-dark);
  white-space: nowrap;
}

.jd-section-hint {
  font-size: 11px; color: var(--text-dim);
  font-weight: 400;
}

.jd-section-body {
  padding: 16px 24px;
  font-size: 13px; line-height: 1.75;
  color: var(--text); white-space: pre-wrap;
  min-height: 60px;
}

.summary-body {
  font-size: 14px; font-weight: 500;
  color: var(--text-dark);
  padding: 14px 24px;
  background: var(--accent-light);
  border-left: 3px solid var(--accent);
}

.jd-section-actions {
  padding: 10px 24px;
  display: flex; gap: 8px; align-items: center;
  border-top: 1px solid var(--border);
  background: var(--bg-raised);
}

/* ==================== AI ADVISOR PANEL ==================== */
.advisor-panel {
  width: 340px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  background: var(--bg-surface);
  box-shadow: -4px 0 20px rgba(2,53,60,0.08);
  transition: transform 0.3s ease;
}

.advisor-header {
  padding: 14px 16px;
  background: var(--blue);
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}

.advisor-title-wrap { display: flex; align-items: center; gap: 10px; }

.advisor-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.advisor-title { font-size: 13px; font-weight: 700; color: #fff; }
.advisor-sub { font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 1px; }

.advisor-close {
  background: none; border: none;
  color: rgba(255,255,255,0.6); font-size: 14px;
  cursor: pointer; padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.advisor-close:hover { background: rgba(255,255,255,0.1); color: #fff; }

.advisor-messages {
  flex: 1; overflow-y: auto;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.advisor-messages::-webkit-scrollbar { width: 4px; }
.advisor-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.advisor-welcome { display: flex; flex-direction: column; gap: 10px; }
.advisor-welcome p { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

.advisor-suggestions { display: flex; flex-direction: column; gap: 6px; }
.advisor-suggestion {
  background: var(--bg-raised);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: 12px; color: var(--text-muted);
  cursor: pointer; text-align: left;
  font-family: var(--font);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.advisor-suggestion:hover { background: var(--accent-light); color: var(--accent-dark); border-color: var(--accent); }

.advisor-msg {
  display: flex; gap: 8px; animation: fadeUp 0.2s ease;
}
.advisor-msg.user { flex-direction: row-reverse; }

.advisor-msg-avatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 8px; font-weight: 700; color: #fff;
  flex-shrink: 0; margin-top: 2px;
}
.advisor-msg.user .advisor-msg-avatar { background: var(--blue); }

.advisor-msg-bubble {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 9px 12px;
  font-size: 12px; line-height: 1.6;
  color: var(--text); max-width: 260px;
}
.advisor-msg.user .advisor-msg-bubble {
  background: var(--blue); border-color: var(--blue);
  color: rgba(255,255,255,0.9);
}

.advisor-input-wrap {
  display: flex; gap: 8px; padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface); flex-shrink: 0;
}

.advisor-input {
  flex: 1; background: var(--bg-raised);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-xl);
  padding: 8px 14px; font-family: var(--font);
  font-size: 12px; color: var(--text-dark); outline: none;
  transition: border-color 0.15s;
}
.advisor-input:focus { border-color: var(--accent); }
.advisor-input::placeholder { color: var(--text-dim); }

.advisor-send {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); border: none; color: #fff;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s; flex-shrink: 0;
}
.advisor-send:hover { background: var(--accent-dark); }

.btn-advisor { background: rgba(255,255,255,0.15) !important; }

@media (max-width: 900px) {
  .advisor-panel {
    position: fixed; right: 0; top: 0; bottom: 0;
    z-index: 150; width: 300px;
    transform: translateX(100%);
  }
  .advisor-panel.open { transform: translateX(0); }
}

/* ==================== CASEY TIPC BANNER ==================== */
.casey-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.casey-banner-left { display: flex; align-items: center; gap: 12px; }

.casey-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0; border: 2px solid rgba(255,255,255,0.2);
}

.casey-banner-text { display: flex; flex-direction: column; gap: 2px; }
.casey-name { font-size: 13px; font-weight: 700; color: #fff; }
.casey-desc { font-size: 11px; color: rgba(255,255,255,0.65); }

.casey-open-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius-lg);
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 8px 18px; cursor: pointer;
  transition: background 0.15s; font-family: var(--font);
  white-space: nowrap;
}
.casey-open-btn:hover { background: rgba(255,255,255,0.25); }

/* ==================== TONE CHANGE BUTTON ==================== */
.btn-tone-change {
  background: var(--bg-raised);
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 11px; font-weight: 500;
  padding: 5px 14px; cursor: pointer;
  transition: all 0.15s; font-family: var(--font);
}
.btn-tone-change:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-tone-change.tone-active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}
.jobadder-btn { background: var(--blue); }
.jobadder-btn:hover { background: var(--blue-dark); }
