*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@700;800;900&display=swap');
h1, h2, h3, .logo, .panel-header h1, .plan-name, .tier-name { font-family: 'Inter', sans-serif; font-weight: 900; letter-spacing: -0.03em; }

:root {
  --blue:        #6366F1;
  --blue-dark:   #4F46E5;
  --blue-light:  rgba(99,102,241,0.12);
  --green:       #10b981;
  --orange:      #f97316;
  --red:         #ef4444;
  --teal:        #0d9488;
  --bg:          #030712;
  --bg2:         rgba(255,255,255,0.04);
  --border:      rgba(255,255,255,0.08);
  --text:        #e2e8f0;
  --text-muted:  #94a3b8;
  --radius:      12px;
  --shadow:      0 1px 8px rgba(0,0,0,0.35);
  --shadow-md:   0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:   0 10px 40px rgba(0,0,0,0.5);
  /* legacy aliases so JS that reads these still works */
  --glass:       rgba(255,255,255,0.04);
  --glass-border:rgba(255,255,255,0.08);
}

html { overflow-x: hidden; }
body {
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99,102,241,0.08), transparent),
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 100% 100%, 56px 56px, 56px 56px;
  pointer-events: none;
}
.nav, .dashboard, .auth-overlay, .mobile-upgrade-banner { position: relative; z-index: 1; }
a { text-decoration: none; color: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

/* ══ BUTTONS ═══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 22px; border-radius: 8px; font-weight: 700; font-size: 14px;
  cursor: pointer; transition: all .15s; border: 2px solid transparent; gap: 8px;
  font-family: inherit; letter-spacing: .1px; white-space: nowrap;
  position: relative; overflow: hidden;
}
.btn::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 60%; height: 100%;
  background: linear-gradient(120deg,transparent,rgba(255,255,255,0.15),transparent);
  transform: skewX(-20deg); transition: left 0.5s ease;
}
.btn:hover::before { left: 150%; }

.btn-primary {
  background: linear-gradient(135deg,#6366F1,#8B5CF6); color: #fff; border-color: transparent;
  box-shadow: 0 0 20px rgba(99,102,241,0.35);
}
.btn-primary:hover { background: linear-gradient(135deg,#5558e8,#7c3aed); border-color: transparent; transform: translateY(-1px); box-shadow: 0 0 32px rgba(99,102,241,0.6); }
.btn-outline {
  border-color: var(--blue); color: var(--blue); background: transparent;
}
.btn-outline:hover { background: var(--blue-light); }
.btn-ghost {
  border-color: var(--border); color: var(--text-muted); background: rgba(255,255,255,0.05);
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.2); color: var(--text); }
.btn-lg { padding: 14px 32px; font-size: 16px; border-radius: 10px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ══ NAV ════════════════════════════════════════════════════════════════════════ */
.nav {
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  background: rgba(3,7,18,0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo {
  font-weight: 900; font-size: 18px; letter-spacing: -.3px; color: #f1f5f9;
  background: none; -webkit-background-clip: unset; -webkit-text-fill-color: #f1f5f9; background-clip: unset;
}
.badge-ai {
  background: linear-gradient(135deg,#6366F1,#8B5CF6); color: #fff; font-size: 10px; font-weight: 800;
  padding: 2px 7px; border-radius: 5px; vertical-align: middle;
  margin-left: 5px; -webkit-text-fill-color: #fff; letter-spacing: .3px;
}

/* ══ DASHBOARD ══════════════════════════════════════════════════════════════════ */
.dashboard { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 64px); max-width: 1600px; margin: 0 auto; }

/* ── Sidebar ── */
.sidebar {
  background: rgba(3,7,18,0.9);
  border-right: 1px solid var(--border);
  padding: 24px 12px; position: sticky; top: 64px;
  height: calc(100vh - 64px); overflow-y: auto;
}
.sidebar-section { margin-bottom: 28px; }
.sidebar-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
  color: #64748b; padding: 0 12px; margin-bottom: 6px;
}
.sidebar-btn {
  width: 100%; text-align: left; background: none; border: none;
  padding: 10px 12px; border-radius: 8px; font-size: 14px; font-weight: 600;
  color: var(--text-muted); cursor: pointer;
  display: flex; align-items: center; gap: 10px; transition: all .15s; font-family: inherit;
}
.sidebar-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.sidebar-btn.active {
  background: var(--blue-light); color: var(--blue); font-weight: 700;
}
.sidebar-icon { font-size: 16px; flex-shrink: 0; }
.sidebar-pro-box {
  background: var(--blue-light); border: 1px solid rgba(99,102,241,0.3);
  border-radius: 12px; padding: 16px; color: var(--text); margin-top: 16px;
  text-align: center;
}
.sidebar-pro-title { font-weight: 800; font-size: 14px; margin-bottom: 6px; color: var(--blue); }
.sidebar-pro-text { font-size: 12px; color: var(--text-muted); line-height: 1.6; }

/* Mobile upgrade banner — shown inside main content when sidebar pro box is hidden */
.mobile-upgrade-banner {
  display: none;
}
@media (max-width: 900px) {
  .mobile-upgrade-banner {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: var(--blue-light); border: 1px solid rgba(99,102,241,0.3);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 20px;
  }
  .mobile-upgrade-banner p { font-size: 13px; font-weight: 600; color: var(--blue); margin: 0; flex: 1; min-width: 160px; }
  .mobile-upgrade-banner button { flex-shrink: 0; padding: 9px 18px; font-size: 13px; }
}

/* ── Main content ── */
.dash-main {
  padding: 36px 44px 80px;
  background: var(--bg);
  min-width: 0;
  overflow-x: hidden;
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.panel-header { margin-bottom: 28px; }
.panel-header h1 {
  font-size: 26px; font-weight: 900; margin-bottom: 6px; letter-spacing: -.4px;
  color: var(--text); background: none; -webkit-background-clip: unset; -webkit-text-fill-color: var(--text); background-clip: unset;
}
.panel-header p { color: var(--text-muted); font-size: 15px; line-height: 1.6; }

/* Mode toggle */
.mode-row { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.mode-btn {
  padding: 9px 18px; border-radius: 8px;
  border: 1.5px solid var(--border); font-weight: 600; font-size: 14px;
  cursor: pointer; background: rgba(255,255,255,0.04); color: var(--text-muted);
  transition: all .15s; font-family: inherit;
}
.mode-btn:hover { border-color: var(--blue); color: var(--blue); }
.mode-btn.active {
  background: var(--blue-light); border-color: var(--blue); color: var(--blue); font-weight: 700;
}

/* Inputs */
.inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
label { font-weight: 700; font-size: 12px; color: var(--text-muted); letter-spacing: .3px; text-transform: uppercase; }
textarea {
  width: 100%; min-height: 240px; padding: 14px 16px; font-size: 14px; font-family: inherit;
  border: 1.5px solid var(--border); border-radius: 10px; resize: vertical; line-height: 1.65;
  transition: all .15s; background: rgba(255,255,255,0.06); color: var(--text);
}
textarea::placeholder { color: #64748b; }
textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }

/* Email row */
.email-row { display: flex; gap: 12px; margin-bottom: 20px; align-items: center; flex-wrap: wrap; }
.email-row input {
  flex: 1; min-width: 220px; padding: 11px 16px;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: rgba(255,255,255,0.06);
  color: var(--text); transition: all .15s;
}
.email-row input::placeholder { color: #64748b; }
.email-row input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.email-hint { font-size: 12px; color: var(--text-muted); }

/* Output */
.output-wrap { margin-top: 28px; }
.output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.output-header h2 { font-size: 17px; font-weight: 800; color: var(--text); }
.copy-btn { font-size: 13px; font-weight: 700; padding: 7px 16px; }
.output-box { border-radius: 4px; min-height: 120px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 40px rgba(0,0,0,0.12); background: #fff; }
.output-box.cover-banner { padding: 0 !important; }

/* ══ TEMPLATE PICKER ══════════════════════════════════════════════════════════ */
.tpl-picker-section { margin: 20px 0 4px; }
.tpl-picker-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; margin-bottom: 6px; }
.tpl-picker-row::-webkit-scrollbar { display: none; }
.tpl-picker-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px; color: var(--text-muted); margin-bottom: 10px; }


/* ══ RESUME DOCUMENT BASE ═════════════════════════════════════════════════════ */
.resume-doc, .cover-doc {
  background: #fff;
  color: #1a1a1a;
  font-family: 'Georgia','Times New Roman',serif;
  font-size: 13.5px;
  line-height: 1.82;
  padding: 52px 64px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06), 0 12px 40px rgba(0,0,0,0.12);
}
.rd-name { font-size: 26px; font-weight: 700; margin-bottom: 3px; }
.rd-contact { font-size: 12px; color: #555; margin-bottom: 18px; }
.rd-section { margin-top: 16px; }
.rd-section-title {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.8px;
  border-bottom: 1.5px solid #ccc; padding-bottom: 3px; margin-bottom: 8px; color: #333;
}
.rd-entry-header { font-weight: 700; font-size: 13px; color: #1a1a1a; margin: 5px 0 1px; }
.rd-bullet { padding-left: 12px; color: #333; font-size: 13px; }
.rd-text { color: #333; }
.rd-blank { height: 5px; }
.cl-para { margin-bottom: 16px; }
.cl-para:last-child { margin-bottom: 0; }

/* ── tpl-classic (default, free) ─────────── */
.tpl-classic .rd-name { text-align: center; }
.tpl-classic .rd-contact { text-align: center; }

/* ── tpl-modern (free) ───────────────────── */
.tpl-modern { font-family: 'Inter',sans-serif; }
.tpl-modern .rd-name { color: #6d28d9; }
.tpl-modern .rd-contact { color: #6b7280; }
.tpl-modern .rd-section-title { border-bottom-color: #6d28d9; color: #6d28d9; letter-spacing: 1px; }
.tpl-modern .rd-entry-header { color: #1f2937; }

/* ── tpl-executive (pro) ─────────────────── */
.tpl-executive { border-top: 5px solid #1e3a5f; }
.tpl-executive .rd-name { color: #1e3a5f; text-align: center; font-size: 27px; }
.tpl-executive .rd-contact { text-align: center; color: #4b5563; }
.tpl-executive .rd-section-title { border-bottom-color: #1e3a5f; color: #1e3a5f; }

/* ── tpl-minimal (pro) ───────────────────── */
.tpl-minimal { font-family: 'Inter',sans-serif; padding: 48px 52px; }
.tpl-minimal .rd-name { font-size: 30px; font-weight: 900; letter-spacing: -1px; }
.tpl-minimal .rd-contact { color: #9ca3af; }
.tpl-minimal .rd-section-title { border-bottom: 1px solid #e5e7eb; color: #9ca3af; font-size: 9px; letter-spacing: 2.2px; }
.tpl-minimal .rd-bullet, .tpl-minimal .rd-text { color: #374151; }

/* ── tpl-creative (pro) ──────────────────── */
.tpl-creative { font-family: 'Inter',sans-serif; }
.tpl-creative .rd-name { color: #ea580c; font-size: 28px; font-weight: 900; }
.tpl-creative .rd-contact { color: #6b7280; }
.tpl-creative .rd-section-title { border-bottom-color: #ea580c; color: #ea580c; }
.tpl-creative .rd-entry-header { font-weight: 800; }

/* ── tpl-professional (pro) ──────────────── */
.tpl-professional { font-family: 'Times New Roman',serif; }
.tpl-professional .rd-name { text-align: center; text-transform: uppercase; letter-spacing: 3px; font-size: 21px; }
.tpl-professional .rd-contact { text-align: center; font-size: 11.5px; }
.tpl-professional .rd-section-title { border-top: 1px solid #aaa; border-bottom: 1px solid #aaa; text-align: center; letter-spacing: 2px; padding: 2px 0; }

/* ── tpl-tech (pro) ──────────────────────── */
.tpl-tech { font-family: 'Inter',sans-serif; }
.tpl-tech .rd-name { color: #059669; font-weight: 900; }
.tpl-tech .rd-contact { color: #6b7280; }
.tpl-tech .rd-section-title { border-bottom: none; border-left: 3px solid #059669; padding-left: 9px; color: #059669; letter-spacing: .5px; }

/* ── tpl-elegant (pro) ───────────────────── */
.tpl-elegant .rd-name { text-align: center; color: #4c1d95; font-style: italic; font-size: 28px; font-weight: 400; }
.tpl-elegant .rd-contact { text-align: center; color: #6b7280; font-style: italic; }
.tpl-elegant .rd-section-title { text-align: center; border-top: 1px solid #d1d5db; border-bottom: 1px solid #d1d5db; color: #4c1d95; padding: 2px 0; font-size: 9px; letter-spacing: 2.5px; }

/* ── tpl-bold (pro) ──────────────────────── */
.tpl-bold { font-family: 'Inter',sans-serif; padding-top: 0; }
.tpl-bold .rd-name-band { background: #111; margin: 0 0 20px; padding: 28px 44px 22px; }
.tpl-bold .rd-name { color: #fff; font-size: 30px; font-weight: 900; margin: 0 0 4px; }
.tpl-bold .rd-contact-in-band { color: #9ca3af; font-size: 12px; }
.tpl-bold .rd-section-title { border-bottom-color: #111; color: #111; }
.tpl-bold .rd-entry-header { font-weight: 800; }

/* ── tpl-contemporary (pro) ──────────────── */
.tpl-contemporary { font-family: 'Inter',sans-serif; }
.tpl-contemporary .rd-name { color: #0891b2; font-weight: 800; }
.tpl-contemporary .rd-contact { color: #6b7280; }
.tpl-contemporary .rd-section-title { border-bottom: none; background: #f3f4f6; padding: 3px 8px; border-radius: 4px; color: #374151; }
.tpl-contemporary .rd-entry-header { color: #0891b2; }

/* ── tpl-academic (pro) ──────────────────── */
.tpl-academic { font-family: 'Georgia',serif; }
.tpl-academic .rd-name { text-align: center; font-size: 26px; font-weight: 700; letter-spacing: 1px; color: #1a1a1a; }
.tpl-academic .rd-contact { text-align: center; color: #4b5563; font-size: 12.5px; }
.tpl-academic .rd-section-title { font-variant: small-caps; letter-spacing: 1.5px; color: #1a1a1a; border-bottom: 2px solid #1a1a1a; }

/* ── tpl-compact (pro) ───────────────────── */
.tpl-compact { font-family: 'Inter',sans-serif; padding: 32px 40px; font-size: 12.5px; }
.tpl-compact .rd-name { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.tpl-compact .rd-contact { font-size: 11.5px; color: #6b7280; }
.tpl-compact .rd-section-title { font-size: 10px; letter-spacing: 2px; border-bottom: 1px solid #d1d5db; color: #6b7280; }
.tpl-compact .rd-entry { margin-bottom: 8px; }

/* ── tpl-sharp (pro) ─────────────────────── */
.tpl-sharp { font-family: 'Inter',sans-serif; }
.tpl-sharp .rd-name { color: #dc2626; font-weight: 900; font-size: 28px; }
.tpl-sharp .rd-contact { color: #374151; font-size: 12px; }
.tpl-sharp .rd-section-title { color: #dc2626; border-bottom-color: #dc2626; letter-spacing: 1px; }
.tpl-sharp .rd-entry-header { font-weight: 800; color: #111827; }

/* ── tpl-neutral (pro) ───────────────────── */
.tpl-neutral { font-family: 'Inter',sans-serif; background: #fafaf9; }
.tpl-neutral .rd-name { color: #57534e; font-weight: 800; font-size: 26px; }
.tpl-neutral .rd-contact { color: #78716c; }
.tpl-neutral .rd-section-title { color: #78716c; border-bottom-color: #d6d3d1; font-weight: 700; letter-spacing: 0.5px; }
.tpl-neutral .rd-entry-header { color: #44403c; }

/* ── tpl-vivid (pro) ─────────────────────── */
.tpl-vivid { font-family: 'Inter',sans-serif; }
.tpl-vivid .rd-name { color: #0d9488; font-weight: 900; font-size: 28px; }
.tpl-vivid .rd-contact { color: #6b7280; }
.tpl-vivid .rd-section-title { color: #0d9488; border-bottom: 2px solid #0d9488; }
.tpl-vivid .rd-entry-header { color: #134e4a; font-weight: 700; }

/* ── Cover Letter template overrides ─────── */
.tpl-cl-classic-cover { font-family: 'Georgia',serif; }
.tpl-cl-modern-cover { font-family: 'Inter',sans-serif; font-size: 13.5px; }
.tpl-cl-executive-cover { font-family: 'Georgia',serif; border-top: 5px solid #1e3a5f; }
.tpl-cl-executive-cover .cl-para:first-child { color: #1e3a5f; font-weight: 700; }
.tpl-cl-minimal-cover { font-family: 'Inter',sans-serif; padding: 56px 60px; color: #374151; line-height: 2; }
.tpl-cl-creative-cover { font-family: 'Inter',sans-serif; }
.tpl-cl-creative-cover .cl-para:first-child { border-left: 3px solid #ea580c; padding-left: 14px; }
.tpl-cl-professional-cover { font-family: 'Times New Roman',serif; line-height: 2; }
.tpl-cl-tech-cover { font-family: 'Inter',sans-serif; }
.tpl-cl-tech-cover .cl-para:first-child { border-left: 3px solid #059669; padding-left: 14px; }
.tpl-cl-elegant-cover { font-family: 'Georgia',serif; }
.tpl-cl-elegant-cover .cl-para { line-height: 2.05; }
.tpl-cl-bold-cover { font-family: 'Inter',sans-serif; }
.tpl-cl-bold-cover .cl-para:first-child { font-size: 15px; font-weight: 700; color: #111; }
.tpl-cl-contemporary-cover { font-family: 'Inter',sans-serif; }
.tpl-cl-contemporary-cover .cl-para:first-child { background: #f0f9ff; padding: 14px; border-radius: 8px; border-left: 3px solid #0891b2; }
.tpl-cl-academic-cover { font-family: 'Georgia',serif; line-height: 1.85; }
.tpl-cl-academic-cover .cl-para:first-child { font-style: italic; color: #374151; }
.tpl-cl-compact-cover { font-family: 'Inter',sans-serif; font-size: 13px; padding: 40px 52px; line-height: 1.8; }
.tpl-cl-sharp-cover { font-family: 'Inter',sans-serif; }
.tpl-cl-sharp-cover .cl-para:first-child { border-left: 3px solid #dc2626; padding-left: 14px; font-weight: 600; }
.tpl-cl-neutral-cover { font-family: 'Inter',sans-serif; color: #57534e; line-height: 1.9; }
.tpl-cl-vivid-cover { font-family: 'Inter',sans-serif; }
.tpl-cl-vivid-cover .cl-para:first-child { border-left: 3px solid #0d9488; padding-left: 14px; }

/* ══ STATUS BADGES ══════════════════════════════════════════════════════════════ */
.free-badge {
  display: inline-block; font-size: 13px; font-weight: 700;
  padding: 5px 14px; border-radius: 100px;
  background: rgba(34,197,94,.1); color: #16a34a;
  border: 1px solid rgba(34,197,94,.3);
}
.pro-badge {
  background: rgba(37,99,235,.1); color: var(--blue);
  border-color: rgba(37,99,235,.3);
}

/* Upsell banner */
.upsell {
  background: var(--blue-light); border: 1px solid rgba(99,102,241,0.3);
  border-radius: 12px; padding: 20px 24px; margin-top: 24px;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.upsell p { font-size: 15px; font-weight: 600; color: var(--text); }
.upsell strong { color: var(--blue); }

/* Spinner */
.spinner { display: inline-block; width: 18px; height: 18px; border: 2px solid rgba(99,102,241,.2); border-top-color: var(--blue); border-radius: 50%; animation: spin .6s linear infinite; margin-right: 8px; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Toast */
.toast {
  position: fixed; bottom: 30px; right: 30px;
  background: rgba(15,23,42,0.95); color: #fff;
  padding: 14px 22px; border-radius: 10px; font-size: 14px; font-weight: 600;
  opacity: 0; transform: translateY(10px); transition: all .22s; z-index: 9999;
  box-shadow: 0 8px 24px rgba(0,0,0,.4); border: 1px solid rgba(255,255,255,0.08);
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ══ FORUM ═══════════════════════════════════════════════════════════════════════ */
.forum-compose {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  border-top: 3px solid var(--blue);
  box-shadow: var(--shadow);
}
.forum-compose h3 { color: var(--text); }
.forum-input {
  width: 100%; padding: 11px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-size: 14px; font-family: inherit;
  background: rgba(255,255,255,0.06); color: var(--text); transition: all .15s;
}
.forum-input::placeholder { color: #64748b; }
.forum-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.forum-textarea {
  width: 100%; min-height: 100px; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; resize: vertical; line-height: 1.6;
  background: rgba(255,255,255,0.06); color: var(--text); transition: all .15s;
}
.forum-textarea::placeholder { color: #64748b; }
.forum-textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(99,102,241,0.15); }
.forum-post {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; transition: all .15s;
  box-shadow: var(--shadow);
}
.forum-post:hover { border-color: rgba(99,102,241,0.3); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.post-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-avatar {
  width: 42px; height: 42px; border-radius: 50%; font-weight: 900; font-size: 17px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.forum-post:nth-child(odd) .post-avatar { background: rgba(99,102,241,0.15); color: var(--blue); }
.forum-post:nth-child(even) .post-avatar { background: rgba(139,92,246,0.15); color: #8B5CF6; }
.post-author { font-weight: 800; font-size: 14px; color: var(--text); }
.post-meta { font-size: 12px; color: var(--text-muted); }
.post-body { font-size: 14px; line-height: 1.78; color: var(--text-muted); margin-bottom: 14px; }
.post-actions { display: flex; gap: 8px; }
.post-action-btn {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 7px; padding: 6px 14px; font-size: 13px;
  cursor: pointer; transition: all .15s; display: flex; align-items: center;
  gap: 5px; font-weight: 600; color: var(--text-muted); font-family: inherit;
}
.post-action-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.reply-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.post-replies { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.reply-item {
  background: rgba(255,255,255,0.04); border-radius: 8px; padding: 11px 14px;
  font-size: 13px; line-height: 1.65; color: var(--text-muted);
  border-left: 3px solid var(--blue);
}
.reply-time { color: var(--text-muted); font-size: 11px; margin-left: 6px; }

/* ══ SALARY GUIDE ════════════════════════════════════════════════════════════════ */
.salary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.salary-resource-card {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px;
  box-shadow: var(--shadow); transition: all .15s;
}
.salary-resource-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.salary-resource-card:nth-child(2) { border-top: 3px solid var(--blue); }
.salary-resource-card:nth-child(3) { border-top: 3px solid #7c3aed; }
.salary-resource-card:nth-child(4) { border-top: 3px solid var(--orange); }
.salary-resource-card:nth-child(5) { border-top: 3px solid var(--teal); }
.salary-resource-card:nth-child(6) { border-top: 3px solid #0891b2; }
.featured-card {
  grid-column: 1 / -1;
  background: var(--blue-light); border-color: rgba(99,102,241,0.3);
}
.resource-icon { font-size: 32px; margin-bottom: 12px; }
.salary-resource-card h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.salary-resource-card p { font-size: 14px; color: var(--text-muted); line-height: 1.7; }
.resource-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.resource-link {
  background: var(--blue-light); color: var(--blue);
  font-size: 13px; font-weight: 700; padding: 6px 14px; border-radius: 7px;
  text-decoration: none; transition: all .15s;
  border: 1px solid rgba(99,102,241,0.3);
}
.resource-link:hover { background: var(--blue); color: #fff; transform: translateY(-1px); }
.salary-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.salary-steps li { font-size: 14px; line-height: 1.65; color: var(--text-muted); }
.salary-steps li strong { color: var(--blue); }
.script-box {
  background: var(--blue-light); border: 1px solid rgba(99,102,241,0.3);
  border-left: 4px solid var(--blue);
  border-radius: 0 10px 10px 0; padding: 14px 16px;
}
.script-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px; color: var(--blue); margin-bottom: 8px; }
.script-text { font-size: 13px; line-height: 1.7; font-style: italic; color: var(--text-muted); }
.salary-tips { padding-left: 20px; display: flex; flex-direction: column; gap: 8px; }
.salary-tips li { font-size: 14px; color: var(--text-muted); line-height: 1.55; }

/* ══ CHECK-IN ════════════════════════════════════════════════════════════════════ */
.checkin-prompt-box {
  background: linear-gradient(135deg, #3730A3, #6366F1, #8B5CF6);
  border-radius: 16px; padding: 32px; color: #fff; margin-bottom: 28px;
  box-shadow: var(--shadow-lg); position: relative; overflow: hidden;
}
.checkin-prompt-box::before { display: none; }
.checkin-prompt-box::after { display: none; }
.checkin-prompt-label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: 1.5px; color: rgba(255,255,255,0.75); margin-bottom: 12px; }
.checkin-prompt-text { font-size: 24px; font-weight: 900; line-height: 1.35; }
.checkin-form {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px; margin-bottom: 28px;
  border-top: 3px solid var(--teal);
  box-shadow: var(--shadow);
}
.checkin-form h3 { color: var(--text); }
.checkin-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 4px; }
.checkin-field { display: flex; flex-direction: column; gap: 7px; }
.checkin-field label { font-weight: 700; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .5px; }
.checkin-milestones { margin-bottom: 28px; }
.checkin-milestones h3 { font-size: 19px; font-weight: 900; margin-bottom: 18px; color: var(--text); }
.milestone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.milestone-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: rgba(255,255,255,0.04); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 14px 16px; cursor: pointer; transition: all .15s;
}
.milestone-item:hover { border-color: var(--blue); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.milestone-item.completed { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.3); }
.milestone-item.completed .milestone-check { background: #16a34a; box-shadow: 0 2px 8px rgba(22,163,74,.3); }
.milestone-check {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.08); color: #64748b; font-size: 13px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.milestone-item.completed .milestone-check { color: #fff; }
.milestone-text { display: flex; flex-direction: column; gap: 3px; }
.milestone-text strong { font-size: 14px; font-weight: 800; color: var(--text); }
.milestone-text span { font-size: 12px; color: var(--text-muted); line-height: 1.45; }
.checkin-reminder {
  background: var(--blue-light); border: 1px solid rgba(99,102,241,0.3);
  border-radius: 14px; padding: 28px; text-align: center;
}
.checkin-reminder h3 { font-size: 19px; font-weight: 900; margin-bottom: 8px; color: var(--blue); }
.checkin-reminder p { font-size: 14px; color: var(--text-muted); line-height: 1.65; }

/* ══ RESPONSIVE — TABLET (≤900px) ═══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .nav-inner { padding: 0 20px; height: 58px; }
  .nav-inner .btn { padding: 7px 13px; font-size: 13px; }

  .dashboard { grid-template-columns: 1fr; }
  .sidebar {
    position: sticky; top: 58px; z-index: 90;
    height: auto; overflow-x: auto; overflow-y: hidden;
    display: flex; flex-direction: row; flex-wrap: nowrap; gap: 2px;
    padding: 6px 10px; border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(3,7,18,0.95);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section { margin-bottom: 0; display: contents; }
  .sidebar-label { display: none; }
  .sidebar-btn { width: auto; flex-shrink: 0; padding: 8px 14px; font-size: 13px; white-space: nowrap; border-radius: 8px; min-height: 40px; }
  .sidebar-icon { font-size: 15px; }
  .sidebar-pro-box { display: none; }

  .dash-main { padding: 24px 20px 60px; }
  .panel-header h1 { font-size: 22px; }
  .inputs { grid-template-columns: 1fr; }
  .email-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .mode-row { gap: 6px; }
  .mode-btn { padding: 8px 13px; font-size: 13px; }
  .output-header { flex-wrap: wrap; gap: 10px; }
  .download-row { flex-direction: column; gap: 10px; }
  .download-btn { width: 100%; justify-content: center; }
  .field-header { gap: 10px; }
  .upsell { flex-direction: column; align-items: flex-start; }
  .salary-grid { grid-template-columns: 1fr; }
  .featured-card { grid-column: 1; }
  .forum-compose { padding: 18px; }
  .checkin-fields { grid-template-columns: 1fr; }
  .milestone-grid { grid-template-columns: 1fr; }
  .checkin-prompt-text { font-size: 20px; }
  .checkin-prompt-box { padding: 22px; }
  .help-grid { grid-template-columns: 1fr; }
}

/* ══ RESPONSIVE — PHONE (≤480px) ════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .nav-inner { padding: 0 14px; height: 52px; }
  .nav-inner .btn { padding: 4px 10px; font-size: 11px; border-radius: 7px; }
  #navUsername { display: none !important; }
  #logoutBtn { padding: 4px 9px !important; font-size: 11px !important; }

  /* ── Bottom navigation bar ── */
  .sidebar {
    position: fixed; bottom: 0; left: 0; right: 0; top: auto;
    z-index: 90; height: calc(56px + env(safe-area-inset-bottom));
    flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    padding: 0 0 env(safe-area-inset-bottom); gap: 0;
    border-top: 1px solid rgba(255,255,255,0.08); border-bottom: none; border-right: none;
    box-shadow: 0 -2px 20px rgba(0,0,0,0.4);
    scrollbar-width: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section { display: contents; margin: 0; }
  .sidebar-label { display: none; }

  .sidebar-btn {
    flex: none; flex-shrink: 0;
    min-width: 64px; height: 56px;
    padding: 7px 12px 5px;
    flex-direction: column; align-items: center; justify-content: center;
    font-size: 0; gap: 0;
    border-radius: 0; border: none; border-top: 2px solid transparent;
    background: rgba(3,7,18,0.95); color: #64748b;
    white-space: nowrap;
  }
  .sidebar-btn:hover { background: rgba(255,255,255,0.06); color: #94a3b8; border-top-color: transparent; }
  .sidebar-btn.active { color: var(--blue); border-top-color: var(--blue); background: rgba(3,7,18,0.95); }
  .sidebar-btn::after {
    content: attr(data-label); font-size: 9px; font-weight: 700;
    color: inherit; margin-top: 3px; line-height: 1;
  }
  .sidebar-icon { font-size: 20px; line-height: 1; }
  .nav-pro-full { display: none; }
  .sidebar-pro-box { display: none; }

  .dash-main { padding: 18px 14px calc(72px + env(safe-area-inset-bottom)); }
  .panel-header { margin-bottom: 18px; }
  .panel-header h1 { font-size: 20px; }
  .panel-header p { font-size: 14px; }
  .mode-row { gap: 5px; }
  .mode-btn { padding: 7px 11px; font-size: 12px; border-radius: 7px; }
  textarea { min-height: 180px; padding: 12px; font-size: 14px; }
  .email-row input { font-size: 15px; padding: 12px 14px; }
  .output-box { padding: 16px; font-size: 13px; }
  .output-header h2 { font-size: 15px; }
  .download-btn { padding: 12px 14px; font-size: 14px; }
  .upload-btn { padding: 7px 12px; font-size: 12px; }
  .btn-lg { padding: 13px 26px; font-size: 15px; }
  .btn-full { padding: 13px; font-size: 15px; }
  .forum-compose { padding: 14px; }
  .forum-post { padding: 16px 14px; }
  .post-avatar { width: 36px; height: 36px; font-size: 14px; }
  .checkin-prompt-text { font-size: 18px; }
  .checkin-prompt-box { padding: 18px; }
  .checkin-form { padding: 18px; }
  .milestone-item { padding: 12px 13px; gap: 10px; }
  .salary-resource-card { padding: 18px; }
  .help-form-card, .help-faq-card { padding: 18px; }
  .upsell { padding: 16px 18px; }
  .toast { bottom: calc(70px + env(safe-area-inset-bottom)); right: 14px; left: 14px; text-align: center; font-size: 13px; }
  .auth-card { padding: 26px 20px; border-radius: 14px; }
  .auth-heading { font-size: 20px; }
}

/* ── Help & Support ──────────────────────────────────────────────────────── */
.help-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 8px;
}
.help-form-card, .help-faq-card {
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  border-radius: 12px; padding: 26px; box-shadow: var(--shadow);
}
.faq-item {
  border-bottom: 1px solid var(--border); padding: 13px 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text);
  gap: 12px; transition: color 0.15s;
}
.faq-q:hover { color: var(--blue); }
.faq-arrow { color: var(--text-muted); font-size: 16px; flex-shrink: 0; transition: color 0.15s; }
.faq-q:hover .faq-arrow { color: var(--blue); }
.faq-a { display: none; margin-top: 9px; font-size: 14px; color: var(--text-muted); line-height: 1.7; }

/* ══ TEMPLATE GALLERY ════════════════════════════════════════════════════════════ */
.template-gallery-outer { overflow: hidden; width: 100%; max-width: 100%; }
.template-gallery { display: flex; flex-wrap: nowrap; gap: 14px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.1) transparent; -webkit-overflow-scrolling: touch; }
.template-gallery::-webkit-scrollbar { height: 4px; }
.template-gallery::-webkit-scrollbar-track { background: transparent; }
.template-gallery::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }
.tpl-card {
  width: 160px; flex-shrink: 0; cursor: pointer; border-radius: 10px; overflow: hidden;
  transition: transform .18s, box-shadow .18s;
  border: 1.5px solid var(--border); background: rgba(255,255,255,0.04);
}
.tpl-card:hover:not(.locked) { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(99,102,241,0.4); }
.tpl-card.locked { opacity: 0.75; cursor: pointer; }
.tpl-card.locked:hover { transform: translateY(-4px); box-shadow: 0 6px 18px rgba(251,191,36,0.3); border-color: #fbbf24; }
.tpl-preview-wrap {
  width: 160px; height: 207px; overflow: hidden; position: relative; background: #e8eaf0;
}
.tpl-preview-inner {
  position: absolute; top: 0; left: 0;
  width: 794px; height: 1123px;
  transform: scale(0.2015); transform-origin: top left; pointer-events: none;
}
.tpl-card-label {
  padding: 8px 10px; font-size: 11px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tpl-free-badge {
  position: absolute; top: 7px; left: 7px;
  background: rgba(34,197,94,0.92); color: #fff;
  font-size: 9px; font-weight: 800; padding: 2px 7px; border-radius: 20px; letter-spacing: .5px;
}
.tpl-lock-overlay {
  position: absolute; inset: 0; background: rgba(15,23,42,0.55);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
}
.tpl-pro-badge {
  background: var(--blue); color: #fff;
  font-size: 10px; font-weight: 800; padding: 3px 10px; border-radius: 20px; letter-spacing: .5px;
}

/* Template modal */
.tpl-modal-overlay {
  position: fixed; inset: 0; z-index: 9998; background: rgba(0,0,0,0.8);
  display: flex; align-items: stretch; justify-content: center;
}
.tpl-modal-box {
  background: rgba(15,23,42,0.98); width: 100%; max-width: 900px; display: flex; flex-direction: column;
  overflow: hidden;
}
@media (min-width: 640px) {
  .tpl-modal-overlay { padding: 20px; align-items: center; }
  .tpl-modal-box { border: 1px solid var(--border); border-radius: 14px; height: 95vh; box-shadow: var(--shadow-lg); }
}
.tpl-modal-header {
  padding: 14px 20px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border); flex-shrink: 0; background: rgba(15,23,42,0.98);
}
.tpl-modal-title { font-size: 15px; font-weight: 800; color: var(--text); }
.tpl-modal-body { flex: 1; overflow: auto; background: rgba(255,255,255,0.03); padding: 20px; position: relative; }
.tpl-modal-body iframe {
  width: 794px; min-height: 1123px; border: none;
  box-shadow: var(--shadow-lg); display: block; margin: 0 auto; background: #fff;
}

/* Full-screen lock overlay on modal */
.tpl-modal-lock {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(8,12,24,0.84);
  backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 32px; text-align: center;
}
.tpl-modal-lock-icon { font-size: 150px; line-height: 1; filter: drop-shadow(0 8px 32px rgba(0,0,0,0.6)); }
.tpl-modal-lock-title { font-size: 36px; font-weight: 900; color: #fff; letter-spacing: -0.5px; }
.tpl-modal-lock-sub { font-size: 16px; color: rgba(255,255,255,0.65); max-width: 380px; line-height: 1.6; margin-bottom: 6px; }
.tpl-modal-lock-peek { font-size: 13px; color: rgba(255,255,255,0.4); cursor: pointer; margin-top: 8px; text-decoration: underline; }
.tpl-modal-lock-peek:hover { color: rgba(255,255,255,0.7); }
.tpl-free-note {
  background: var(--blue-light); border: 1px solid rgba(99,102,241,0.3);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 18px; font-size: 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
@media (max-width: 600px) {
  .tpl-modal-body iframe { width: 100%; min-width: 0; }
}

/* ── Extra Template Classes ── */
.tpl-academic { font-family: Georgia, 'Times New Roman', serif; }
.tpl-academic .resume-name { font-variant: small-caps; letter-spacing: 0.04em; }
.tpl-academic h2, .tpl-academic h3 { font-variant: small-caps; letter-spacing: 0.06em; border-bottom: 1px solid #333; padding-bottom: 4px; }

.tpl-compact { font-size: 12.5px; line-height: 1.4; }
.tpl-compact .resume-section { margin-bottom: 10px; }
.tpl-compact h2 { font-size: 13px; }

.tpl-sharp .resume-header { border-left: 5px solid #dc2626; padding-left: 14px; }
.tpl-sharp h2 { color: #dc2626; }
.tpl-sharp a { color: #dc2626; }

.tpl-neutral .resume-header { border-left: 5px solid #78716c; padding-left: 14px; }
.tpl-neutral h2 { color: #78716c; }
.tpl-neutral a { color: #78716c; }

.tpl-vivid .resume-header { border-left: 5px solid #0d9488; padding-left: 14px; }
.tpl-vivid h2 { color: #0d9488; }
.tpl-vivid a { color: #0d9488; }

/* Cover letter variants */
.tpl-cl-academic-cover { font-family: Georgia, 'Times New Roman', serif; }
.tpl-cl-compact-cover { font-size: 12.5px; line-height: 1.4; }
.tpl-cl-sharp-cover .cl-header { border-left: 5px solid #dc2626; padding-left: 14px; }
.tpl-cl-neutral-cover .cl-header { border-left: 5px solid #78716c; padding-left: 14px; }
.tpl-cl-vivid-cover .cl-header { border-left: 5px solid #0d9488; padding-left: 14px; }
