/* ═══════════════════════════════════════════════════════════
   ProjectGenie — Global Stylesheet
   Fonts: Sora (headings) + Inter (body)
   Primary: #1A6EFC · Orange: #FF6B35 · Green: #22C55E
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* ── RESET & ROOT ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Brand */
  --blue:        #1A6EFC;
  --blue-dark:   #0F4EC4;
  --blue-light:  #EBF1FF;
  --blue-mid:    #3B82F6;
  --orange:      #FF6B35;
  --green:       #22C55E;
  --purple:      #8B5CF6;

  /* Grays */
  --gray-50:     #F8FAFC;
  --gray-100:    #F1F5F9;
  --gray-200:    #E2E8F0;
  --gray-300:    #CBD5E1;
  --gray-400:    #94A3B8;
  --gray-500:    #64748B;
  --gray-600:    #475569;
  --gray-700:    #334155;
  --gray-800:    #1E293B;
  --gray-900:    #0F172A;

  /* Aliases */
  --text:        #1E293B;
  --white:       #FFFFFF;

  /* Radius */
  --radius:      12px;
  --radius-lg:   16px;
  --radius-xl:   24px;

  /* Shadows */
  --shadow:      0 2px 16px rgba(26, 110, 252, 0.08);
  --shadow-md:   0 4px 24px rgba(26, 110, 252, 0.12);
  --shadow-lg:   0 8px 40px rgba(26, 110, 252, 0.15);

  /* Typography */
  --font-head:   'Sora',  sans-serif;
  --font-body:   'Inter', sans-serif;
  --font-mono:   'Courier New', monospace;

  /* Tracking */
  --tracking-tight: -0.02em;
  --tracking-wide:   0.04em;
}

html  { scroll-behavior: smooth; }
body  {
  font-family:    var(--font-body);
  font-size:      15px;
  line-height:    1.65;
  color:          var(--text);
  background:     #fff;
  -webkit-font-smoothing:  antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a    { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; outline: none; font-family: var(--font-body); }
img  { max-width: 100%; display: block; }

/* ── TYPOGRAPHY SCALE ─────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family:    var(--font-head);
  font-weight:    700;
  line-height:    1.2;
  letter-spacing: var(--tracking-tight);
  color:          var(--gray-900);
}
h1 { font-size: clamp(32px, 5vw, 56px); font-weight: 800; }
h2 { font-size: clamp(24px, 4vw, 40px); font-weight: 800; }
h3 { font-size: clamp(18px, 2.5vw, 26px); font-weight: 700; }
h4 { font-size: 18px; font-weight: 700; }
h5 { font-size: 15px; font-weight: 600; }
p  { line-height: 1.75; }

/* ── LAYOUT ───────────────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin:    0 auto;
  padding:   0 24px;
}

/* ── FLASH ────────────────────────────────────────────────── */
.flash {
  position:   fixed;
  top:        72px;
  left:       50%;
  transform:  translateX(-50%);
  z-index:    999;
  padding:    12px 24px;
  border-radius: 10px;
  font-size:  14px;
  font-weight: 500;
  display:    flex;
  align-items: center;
  gap:        12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  max-width:  500px;
  width:      90%;
}
.flash-success { background: #DCFCE7; color: #166534; border: 1px solid #86EFAC; }
.flash-error   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }
.flash button  { background: none; border: none; font-size: 18px; cursor: pointer; color: inherit; margin-left: auto; }

/* ── NAVIGATION ───────────────────────────────────────────── */
.nav {
  position:         fixed;
  top:              0; left: 0; right: 0;
  z-index:          100;
  background:       rgba(255,255,255,.96);
  backdrop-filter:  blur(14px);
  border-bottom:    1px solid var(--gray-200);
  transition:       box-shadow .3s;
}
.nav-inner {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         14px 24px;
}
.logo {
  font-family:   var(--font-head);
  font-size:     20px;
  font-weight:   800;
  color:         var(--blue);
  display:       flex;
  align-items:   center;
  gap:           8px;
  letter-spacing: -0.03em;
}
.nav-links {
  display:     flex;
  align-items: center;
  gap:         28px;
}
.nav-links a {
  font-size:   14px;
  font-weight: 500;
  color:       var(--gray-600);
  transition:  color .2s;
  letter-spacing: -0.01em;
}
.nav-links a:hover { color: var(--blue); }
.nav-cta { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; background: none; font-size: 22px; color: var(--gray-700); }

@media (max-width: 768px) {
  .nav-links {
    display:        none;
    position:       absolute;
    top:            100%; left: 0; right: 0;
    background:     #fff;
    border-bottom:  1px solid var(--gray-200);
    flex-direction: column;
    padding:        16px 24px;
    gap:            16px;
  }
  .nav-links.open { display: flex; }
  .nav-toggle     { display: block; }
  .nav-cta .btn-outline { display: none; }
}

/* ── BUTTONS ──────────────────────────────────────────────── */
.btn {
  padding:       10px 22px;
  border-radius: 9px;
  font-size:     14px;
  font-weight:   600;
  font-family:   var(--font-body);
  transition:    all .2s;
  display:       inline-flex;
  align-items:   center;
  gap:           8px;
  cursor:        pointer;
  letter-spacing: -0.01em;
}
.btn-outline {
  border:     1.5px solid var(--gray-300);
  background: transparent;
  color:      var(--gray-700);
}
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }

.btn-primary {
  background: var(--blue);
  color:      #fff;
  border:     1.5px solid var(--blue);
}
.btn-primary:hover {
  background:  var(--blue-dark);
  border-color: var(--blue-dark);
  transform:   translateY(-1px);
  box-shadow:  0 4px 16px rgba(26,110,252,.32);
}
.btn-orange {
  background: var(--orange);
  color:      #fff;
  border:     1.5px solid var(--orange);
}
.btn-orange:hover { background: #e05a27; transform: translateY(-1px); }

.btn-lg    { padding: 13px 30px; font-size: 15px; border-radius: 10px; }
.btn-ghost { background: transparent; color: var(--blue); padding: 10px 16px; border: none; }
.btn-ghost:hover { background: var(--blue-light); }

/* ── TAGS & BADGES ────────────────────────────────────────── */
.tag {
  display:       inline-flex;
  padding:       4px 11px;
  border-radius: 100px;
  font-size:     11px;
  font-weight:   600;
  letter-spacing: 0.01em;
}
.tag-blue   { background: var(--blue-light); color: var(--blue); }
.tag-orange { background: #FFF0EB; color: var(--orange); }
.tag-green  { background: #DCFCE7; color: #16A34A; }
.tag-purple { background: #F3F0FF; color: var(--purple); }

/* ── HERO ─────────────────────────────────────────────────── */
.hero {
  padding:    120px 0 80px;
  background: linear-gradient(135deg, #EEF4FF 0%, #fff 65%);
  position:   relative;
  overflow:   hidden;
}
.hero .container {
  display:               grid;
  grid-template-columns: 1fr 400px;
  gap:                   40px;
  align-items:           center;
}
.hero-badge {
  display:       inline-flex;
  align-items:   center;
  gap:           8px;
  background:    var(--blue-light);
  color:         var(--blue);
  padding:       6px 14px;
  border-radius: 100px;
  font-size:     11px;
  font-weight:   700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
  border:        1px solid rgba(26,110,252,.18);
}
.hero-badge-dot {
  width:      6px; height: 6px;
  background: var(--blue);
  border-radius: 50%;
  animation:  pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }

.hero h1 {
  font-size:     clamp(36px, 5vw, 58px);
  font-weight:   800;
  line-height:   1.08;
  color:         var(--gray-900);
  margin-bottom: 18px;
  letter-spacing: -0.03em;
}
.hero h1 span { color: var(--blue); }
.hero h1 em   { color: var(--orange); font-style: normal; }

.hero-sub {
  font-size:     16px;
  color:         var(--gray-500);
  max-width:     520px;
  line-height:   1.78;
  margin-bottom: 34px;
  font-weight:   400;
}
.hero-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-play    {
  display:     flex;
  align-items: center;
  gap:         10px;
  color:       var(--gray-600);
  font-size:   14px;
  font-weight: 500;
}
.hero-play-icon {
  width:        40px; height: 40px;
  background:   #fff;
  border:       1.5px solid var(--gray-200);
  border-radius: 50%;
  display:      flex;
  align-items:  center;
  justify-content: center;
  box-shadow:   var(--shadow);
  font-size:    12px;
}
.hero-stats {
  display:        flex;
  gap:            32px;
  margin-top:     48px;
  padding-top:    36px;
  border-top:     1px solid var(--gray-200);
  flex-wrap:      wrap;
}
.hero-stat-num {
  font-family:   var(--font-head);
  font-size:     28px;
  font-weight:   800;
  color:         var(--gray-900);
  letter-spacing: -0.03em;
}
.hero-stat-num span { color: var(--blue); }
.hero-stat-label    { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

.hero-visual        { display: flex; flex-direction: column; gap: 12px; }
.hero-card-float {
  background:    #fff;
  border-radius: var(--radius);
  border:        1px solid var(--gray-200);
  padding:       14px 18px;
  box-shadow:    var(--shadow-md);
  display:       flex;
  align-items:   center;
  gap:           12px;
}
.hero-card-icon {
  width:         40px; height: 40px;
  border-radius: 10px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     18px;
  flex-shrink:   0;
}
.hero-card-icon.blue   { background: var(--blue-light); }
.hero-card-icon.orange { background: #FFF0EB; }
.hero-card-icon.green  { background: #DCFCE7; }

.hero-card-title {
  font-size:   13px;
  font-weight: 600;
  color:       var(--gray-800);
  letter-spacing: -0.01em;
}
.hero-card-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }

@media (max-width: 900px) {
  .hero .container { grid-template-columns: 1fr; }
  .hero-visual     { display: none; }
}

/* ── SECTIONS ─────────────────────────────────────────────── */
.section     { padding: 80px 0; }
.section-alt { background: var(--gray-50); }

.section-header { text-align: center; margin-bottom: 52px; }
.section-label  {
  display:        inline-block;
  background:     var(--blue-light);
  color:          var(--blue);
  padding:        5px 14px;
  border-radius:  100px;
  font-size:      11px;
  font-weight:    700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-bottom:  14px;
}
.section-title {
  font-family:   var(--font-head);
  font-size:     clamp(26px, 4vw, 40px);
  font-weight:   800;
  color:         var(--gray-900);
  margin-bottom: 14px;
  letter-spacing: -0.03em;
}
.section-title span { color: var(--blue); }
.section-sub {
  font-size:  15px;
  color:      var(--gray-500);
  max-width:  540px;
  margin:     0 auto;
  line-height: 1.75;
}

/* ── PROJECT TYPE CARDS ───────────────────────────────────── */
.project-grid {
  display:               grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap:                   20px;
}
.project-card {
  background:    #fff;
  border:        1.5px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding:       28px 24px;
  cursor:        pointer;
  transition:    all .25s;
  position:      relative;
  overflow:      hidden;
  display:       block;
}
.project-card::before {
  content:  '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height:   3px;
  background: var(--card-color, var(--blue));
}
.project-card:hover {
  border-color: var(--card-color, var(--blue));
  transform:    translateY(-4px);
  box-shadow:   var(--shadow-md);
}
.project-card-icon {
  width:         52px; height: 52px;
  border-radius: 14px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     24px;
  margin-bottom: 16px;
  background:    var(--card-bg, var(--blue-light));
}
.project-card h3 {
  font-family:   var(--font-head);
  font-size:     18px;
  font-weight:   700;
  color:         var(--gray-900);
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}
.project-card p           { font-size: 13px; color: var(--gray-500); line-height: 1.65; }
.project-card-meta        { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

/* ── FEATURE CARDS ────────────────────────────────────────── */
.features-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   20px;
}
.feature-card {
  background:    #fff;
  border:        1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding:       26px 22px;
  transition:    all .2s;
}
.feature-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.feature-icon {
  width:         48px; height: 48px;
  border-radius: 12px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     22px;
  margin-bottom: 14px;
}
.feature-card h3 {
  font-family:   var(--font-head);
  font-size:     15px;
  font-weight:   700;
  color:         var(--gray-900);
  margin-bottom: 7px;
  letter-spacing: -0.02em;
}
.feature-card p { font-size: 13px; color: var(--gray-500); line-height: 1.7; }

@media (max-width: 900px) { .features-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .features-grid { grid-template-columns: 1fr; } }

/* ── STEP INDICATORS ──────────────────────────────────────── */
.steps          { display: flex; gap: 0; position: relative; margin: 40px 0; }
.steps::before  {
  content:    '';
  position:   absolute;
  top:        28px; left: 0; right: 0;
  height:     2px;
  background: var(--gray-200);
  z-index:    0;
}
.step {
  flex:           1;
  display:        flex;
  flex-direction: column;
  align-items:    center;
  text-align:     center;
  position:       relative;
  z-index:        1;
}
.step-num {
  width:          56px; height: 56px;
  border-radius:  50%;
  background:     #fff;
  border:         2px solid var(--gray-200);
  display:        flex;
  align-items:    center;
  justify-content: center;
  font-family:    var(--font-head);
  font-size:      18px;
  font-weight:    800;
  color:          var(--gray-400);
  margin-bottom:  12px;
  letter-spacing: -0.02em;
}
.step.done .step-num   { background: var(--blue); border-color: var(--blue); color: #fff; }
.step.active .step-num { background: #fff; border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px rgba(26,110,252,.15); }
.step-label            { font-size: 13px; font-weight: 600; color: var(--gray-600); letter-spacing: -0.01em; }
.step.done .step-label, .step.active .step-label { color: var(--blue); }
.step-sub              { font-size: 11px; color: var(--gray-400); margin-top: 3px; }

/* ── FORMS ────────────────────────────────────────────────── */
.form-section {
  background:    var(--gray-50);
  border-radius: var(--radius-xl);
  padding:       36px;
  border:        1px solid var(--gray-200);
}
.form-grid {
  display:               grid;
  grid-template-columns: 1fr 1fr;
  gap:                   18px;
}
.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group.full { grid-column: 1 / -1; }
.form-label {
  font-size:      13px;
  font-weight:    600;
  color:          var(--gray-700);
  letter-spacing: -0.01em;
}
.form-input {
  padding:       11px 15px;
  border:        1.5px solid var(--gray-200);
  border-radius: 10px;
  font-size:     14px;
  font-family:   var(--font-body);
  color:         var(--gray-800);
  background:    #fff;
  transition:    border-color .2s, box-shadow .2s;
  width:         100%;
}
.form-input:focus {
  outline:    none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26,110,252,.1);
}
.form-select {
  appearance:        none;
  background-image:  url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size:   16px;
  background-color:  #fff;
}
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }

/* ── PREVIEW BOX ──────────────────────────────────────────── */
.preview-box {
  background:    #fff;
  border:        1.5px solid var(--gray-200);
  border-radius: var(--radius-xl);
  overflow:      hidden;
  box-shadow:    var(--shadow-md);
}
.preview-header {
  background: var(--gray-900);
  padding:    14px 22px;
  display:    flex;
  align-items: center;
  justify-content: space-between;
}
.preview-dots { display: flex; gap: 8px; }
.preview-dots span { width: 12px; height: 12px; border-radius: 50%; display: block; }
.preview-title {
  color:       var(--gray-400);
  font-size:   12px;
  font-family: var(--font-mono);
}
.preview-content { padding: 28px; }
.preview-text {
  font-size:   14px;
  line-height: 1.88;
  color:       var(--gray-700);
}
.preview-blurred {
  filter:         blur(5px);
  user-select:    none;
  pointer-events: none;
  opacity:        .7;
}
.preview-lock-overlay {
  display:        flex;
  flex-direction: column;
  align-items:    center;
  justify-content: center;
  padding:        40px;
  background:     rgba(255,255,255,.72);
  backdrop-filter: blur(2px);
}

/* ── FAQ ──────────────────────────────────────────────────── */
.faq-item {
  border:        1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow:      hidden;
  margin-bottom: 10px;
}
.faq-q {
  padding:        16px 22px;
  font-size:      14px;
  font-weight:    600;
  color:          var(--gray-800);
  cursor:         pointer;
  display:        flex;
  justify-content: space-between;
  align-items:    center;
  background:     #fff;
  transition:     background .2s;
  letter-spacing: -0.01em;
}
.faq-q:hover { background: var(--gray-50); }
.faq-q .arrow { font-size: 16px; transition: transform .3s; color: var(--gray-400); }
.faq-a {
  padding:    0 22px;
  max-height: 0;
  overflow:   hidden;
  transition: all .3s;
  font-size:  14px;
  color:      var(--gray-600);
  line-height: 1.75;
  background: #fff;
}
.faq-item.open .faq-a  { max-height: 300px; padding: 0 22px 16px; }
.faq-item.open .arrow  { transform: rotate(180deg); }

/* ── PRICING ──────────────────────────────────────────────── */
.pricing-grid {
  display:               grid;
  grid-template-columns: repeat(3, 1fr);
  gap:                   24px;
  max-width:             1000px;
  margin:                0 auto;
}
@media (max-width: 800px) { .pricing-grid { grid-template-columns: 1fr; } }

/* ── DASHBOARD ────────────────────────────────────────────── */
.dash-layout {
  display:               grid;
  grid-template-columns: 240px 1fr;
  min-height:            100vh;
  background:            var(--gray-50);
}
.dash-sidebar {
  background:  #fff;
  border-right: 1px solid var(--gray-200);
  position:    sticky;
  top:         0;
  height:      100vh;
  overflow-y:  auto;
  display:     flex;
  flex-direction: column;
}
.dash-logo        { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); margin-bottom: 12px; }
.dash-nav-item {
  display:     flex;
  align-items: center;
  gap:         12px;
  padding:     11px 24px;
  font-size:   14px;
  font-weight: 500;
  color:       var(--gray-600);
  cursor:      pointer;
  transition:  all .2s;
  position:    relative;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.dash-nav-item:hover { background: var(--gray-50); color: var(--gray-900); }
.dash-nav-item.active {
  background: var(--blue-light);
  color:      var(--blue);
  font-weight: 600;
}
.dash-nav-item.active::before {
  content:       '';
  position:      absolute;
  left:          0; top: 0; bottom: 0;
  width:         3px;
  background:    var(--blue);
  border-radius: 0 3px 3px 0;
}
.dash-nav-icon { font-size: 18px; width: 20px; text-align: center; flex-shrink: 0; }
.dash-main     { padding: 32px; overflow-y: auto; }
.dash-header   {
  display:         flex;
  justify-content: space-between;
  align-items:     flex-start;
  margin-bottom:   28px;
  flex-wrap:       wrap;
  gap:             16px;
}
.dash-greeting {
  font-family:   var(--font-head);
  font-size:     24px;
  font-weight:   800;
  color:         var(--gray-900);
  letter-spacing: -0.03em;
}
.dash-greeting span { color: var(--blue); }

.stats-row {
  display:               grid;
  grid-template-columns: repeat(4, 1fr);
  gap:                   14px;
  margin-bottom:         28px;
}
.stat-card {
  background:    #fff;
  border:        1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding:       18px 22px;
}
.stat-card-num {
  font-family:   var(--font-head);
  font-size:     28px;
  font-weight:   800;
  color:         var(--gray-900);
  letter-spacing: -0.04em;
}
.stat-card-label { font-size: 12px; color: var(--gray-500); margin-top: 4px; }

@media (max-width: 900px) { .stats-row { grid-template-columns: 1fr 1fr; } }

.projects-row {
  display:               grid;
  grid-template-columns: repeat(2, 1fr);
  gap:                   18px;
}
.proj-card {
  background:    #fff;
  border:        1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding:       22px;
  transition:    all .2s;
  cursor:        pointer;
}
.proj-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.proj-card-head  { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.proj-card h4 {
  font-family:   var(--font-head);
  font-size:     15px;
  font-weight:   700;
  color:         var(--gray-900);
  margin-bottom: 5px;
  line-height:   1.35;
  letter-spacing: -0.02em;
}
.proj-card p { font-size: 12px; color: var(--gray-500); margin-bottom: 14px; }

.progress-wrap  { margin-bottom: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; color: var(--gray-500); margin-bottom: 5px; }
.progress-bar   { height: 5px; background: var(--gray-200); border-radius: 100px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 100px; background: var(--blue); transition: width .5s; }
.proj-footer    { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--gray-100); }

@media (max-width: 700px) { .projects-row { grid-template-columns: 1fr; } }

/* ── EDITOR ───────────────────────────────────────────────── */
.editor-layout {
  display:               grid;
  grid-template-columns: 240px 1fr 280px;
  height:                calc(100vh - 57px);
  overflow:              hidden;
}
.editor-sidebar {
  border-right: 1px solid var(--gray-200);
  overflow-y:   auto;
  background:   #fff;
}
.editor-sidebar-head {
  padding:        16px 20px;
  border-bottom:  1px solid var(--gray-200);
  font-family:    var(--font-head);
  font-size:      11px;
  font-weight:    700;
  color:          var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.chapter-nav          { list-style: none; }
.chapter-nav-item     { border-bottom: 1px solid var(--gray-100); }
.chapter-nav-item .ch-head {
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  padding:         13px 20px;
  cursor:          pointer;
  transition:      background .2s;
  font-size:       13px;
  font-weight:     600;
  color:           var(--gray-700);
  letter-spacing:  -0.01em;
}
.chapter-nav-item .ch-head:hover   { background: var(--gray-50); }
.chapter-nav-item.active .ch-head  { color: var(--blue); background: var(--blue-light); }
.chapter-nav-item .ch-sections     { display: none; background: var(--gray-50); }
.chapter-nav-item.open .ch-sections { display: block; }
.ch-section {
  padding:         9px 18px 9px 32px;
  font-size:       12px;
  color:           var(--gray-600);
  cursor:          pointer;
  transition:      all .2s;
  display:         flex;
  align-items:     center;
  justify-content: space-between;
  letter-spacing:  -0.01em;
}
.ch-section:hover  { color: var(--blue); background: rgba(26,110,252,.04); }
.ch-section.active { color: var(--blue); font-weight: 600; background: rgba(26,110,252,.07); }
.ch-status         { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ch-status.done    { background: var(--green); }
.ch-status.partial { background: var(--orange); }
.ch-status.empty   { background: var(--gray-300); }

.editor-main    { display: flex; flex-direction: column; overflow: hidden; }
.editor-toolbar {
  padding:     10px 20px;
  border-bottom: 1px solid var(--gray-200);
  display:     flex;
  align-items: center;
  gap:         6px;
  flex-wrap:   wrap;
  background:  #fff;
  flex-shrink: 0;
}
.tool-btn {
  padding:       7px 12px;
  border-radius: 8px;
  font-size:     12px;
  font-weight:   600;
  border:        1.5px solid var(--gray-200);
  background:    #fff;
  color:         var(--gray-700);
  transition:    all .2s;
  display:       flex;
  align-items:   center;
  gap:           5px;
  cursor:        pointer;
  font-family:   var(--font-body);
  letter-spacing: -0.01em;
}
.tool-btn:hover       { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.tool-btn.primary     { background: var(--blue); color: #fff; border-color: var(--blue); }
.tool-btn.primary:hover { background: var(--blue-dark); }
.tool-btn.orange      { background: var(--orange); color: #fff; border-color: var(--orange); }
.tool-btn.orange:hover { background: #e05a27; }

.editor-body {
  flex:       1;
  overflow-y: auto;
  padding:    36px 40px;
}
.editor-section-title {
  font-family:   var(--font-head);
  font-size:     21px;
  font-weight:   800;
  color:         var(--gray-900);
  margin-bottom: 6px;
  letter-spacing: -0.03em;
}
.editor-section-sub { font-size: 12px; color: var(--gray-400); margin-bottom: 22px; }
.editor-content {
  font-family:   var(--font-body);
  font-size:     15px;
  line-height:   1.9;
  color:         var(--gray-700);
  border:        1.5px solid transparent;
  border-radius: var(--radius);
  padding:       16px;
  transition:    border-color .2s;
  min-height:    420px;
  outline:       none;
}
.editor-content:focus { border-color: var(--blue); background: var(--gray-50); }

.editor-panel   { border-left: 1px solid var(--gray-200); overflow-y: auto; background: #fff; }
.panel-tabs     { display: flex; border-bottom: 1px solid var(--gray-200); flex-shrink: 0; }
.panel-tab {
  flex:            1;
  padding:         13px 8px;
  text-align:      center;
  font-size:       12px;
  font-weight:     600;
  color:           var(--gray-500);
  cursor:          pointer;
  transition:      all .2s;
  letter-spacing:  -0.01em;
}
.panel-tab.active { color: var(--blue); border-bottom: 2px solid var(--blue); }
.panel-body     { padding: 18px; }
.panel-section  { margin-bottom: 22px; }
.panel-section-title {
  font-size:      11px;
  font-weight:    700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color:          var(--gray-400);
  margin-bottom:  10px;
}
.ai-btn {
  width:         100%;
  padding:       10px 14px;
  border-radius: 10px;
  border:        1.5px solid var(--gray-200);
  background:    #fff;
  color:         var(--gray-700);
  font-size:     13px;
  font-weight:   500;
  text-align:    left;
  display:       flex;
  align-items:   center;
  gap:           10px;
  transition:    all .2s;
  margin-bottom: 7px;
  cursor:        pointer;
  font-family:   var(--font-body);
  letter-spacing: -0.01em;
}
.ai-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.ai-btn-icon  {
  width:         28px; height: 28px;
  border-radius: 8px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     14px;
  flex-shrink:   0;
}
.ref-tab {
  padding:       7px 16px;
  border-radius: 100px;
  border:        1.5px solid var(--gray-200);
  font-size:     12px;
  font-weight:   600;
  background:    #fff;
  color:         var(--gray-600);
  cursor:        pointer;
  transition:    all .2s;
  letter-spacing: -0.01em;
}
.ref-tab.active, .ref-tab:hover {
  border-color: var(--blue);
  background:   var(--blue-light);
  color:        var(--blue);
}

.quality-widget  { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 14px; }
.quality-row     { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.quality-label   { font-size: 11px; color: var(--gray-600); width: 100px; flex-shrink: 0; }
.quality-bar-wrap{ flex: 1; height: 5px; background: var(--gray-200); border-radius: 100px; overflow: hidden; }
.quality-bar-fill{ height: 100%; border-radius: 100px; }
.quality-score   { font-size: 11px; font-weight: 700; width: 28px; text-align: right; }

/* ── UPLOAD ───────────────────────────────────────────────── */
.upload-zone {
  border:        2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding:       40px 28px;
  text-align:    center;
  background:    var(--gray-50);
  cursor:        pointer;
  transition:    all .3s;
}
.upload-zone:hover { border-color: var(--blue); background: var(--blue-light); }
.upload-icon   { font-size: 44px; margin-bottom: 14px; display: block; }
.upload-zone h4 {
  font-family:   var(--font-head);
  font-size:     17px;
  font-weight:   700;
  color:         var(--gray-800);
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.upload-zone p { font-size: 13px; color: var(--gray-500); }

.rules-preview { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; }
.rule-item {
  display:     flex;
  align-items: flex-start;
  gap:         10px;
  padding:     9px 0;
  border-bottom: 1px solid var(--gray-200);
  font-size:   13px;
  color:       var(--gray-700);
}
.rule-item:last-child { border-bottom: none; }
.rule-check {
  width:         20px; height: 20px;
  border-radius: 50%;
  background:    var(--blue-light);
  color:         var(--blue);
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     11px;
  flex-shrink:   0;
  font-weight:   700;
  line-height:   20px;
  text-align:    center;
  margin-top:    1px;
}

/* ── AI TYPING INDICATOR ──────────────────────────────────── */
.ai-typing      { display: flex; gap: 4px; align-items: center; }
.ai-typing span {
  width:      7px; height: 7px;
  background: var(--blue);
  border-radius: 50%;
  animation:  bounce .8s infinite;
  opacity:    .3;
}
.ai-typing span:nth-child(2) { animation-delay: .15s; }
.ai-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .3; }
  40%           { transform: translateY(-5px); opacity: 1; }
}

/* ── SPINNER ──────────────────────────────────────────────── */
.spinner {
  width:         16px; height: 16px;
  border:        2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation:     spin .6s linear infinite;
  display:       inline-block;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── TOAST NOTIFICATION ───────────────────────────────────── */
.notify {
  position:      fixed;
  bottom:        24px; right: 24px;
  background:    #fff;
  border:        1px solid var(--gray-200);
  border-radius: var(--radius);
  padding:       14px 18px;
  box-shadow:    0 8px 32px rgba(0,0,0,.12);
  display:       flex;
  align-items:   flex-start;
  gap:           12px;
  z-index:       999;
  max-width:     320px;
  transform:     translateY(100px);
  opacity:       0;
  transition:    all .4s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.notify.show   { transform: translateY(0); opacity: 1; pointer-events: all; }
.notify-icon   {
  width:         34px; height: 34px;
  border-radius: 9px;
  display:       flex;
  align-items:   center;
  justify-content: center;
  font-size:     16px;
  flex-shrink:   0;
  background:    var(--blue-light);
}
.notify-title  { font-size: 13px; font-weight: 600; color: var(--gray-900); letter-spacing: -0.01em; }
.notify-sub    { font-size: 11px; color: var(--gray-500); margin-top: 2px; }

/* ── FOOTER ───────────────────────────────────────────────── */
.footer       { background: var(--gray-900); color: #fff; padding: 56px 0 24px; }
.footer-grid  {
  display:               grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap:                   36px;
  margin-bottom:         40px;
}
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
.footer-brand p {
  font-size:   13px;
  color:       var(--gray-400);
  margin-top:  12px;
  max-width:   260px;
  line-height: 1.75;
}
.footer-col h5 {
  font-family:   var(--font-head);
  font-size:     13px;
  font-weight:   700;
  color:         #fff;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 9px; }
.footer-col ul li a {
  font-size:  13px;
  color:      var(--gray-400);
  transition: color .2s;
}
.footer-col ul li a:hover { color: #fff; }
.footer-bottom {
  display:        flex;
  justify-content: space-between;
  align-items:    center;
  padding-top:    20px;
  border-top:     1px solid rgba(255,255,255,.08);
  font-size:      12px;
  color:          var(--gray-500);
  flex-wrap:      wrap;
  gap:            8px;
}

/* ── ADMIN OVERRIDES ──────────────────────────────────────── */
.admin-topbar-title {
  font-family:   var(--font-head);
  font-size:     18px;
  font-weight:   800;
  color:         var(--gray-900);
  letter-spacing: -0.03em;
}
.admin-card-title {
  font-family:   var(--font-head);
  font-size:     15px;
  font-weight:   700;
  color:         var(--gray-900);
  letter-spacing: -0.02em;
}
.admin-stat-num {
  font-family:   var(--font-head);
  font-size:     30px;
  font-weight:   800;
  color:         var(--gray-900);
  letter-spacing: -0.04em;
}
.admin-table th {
  font-family:   var(--font-head);
  font-size:     11px;
  font-weight:   700;
  letter-spacing: 0.06em;
}

/* ── BLOG CONTENT ─────────────────────────────────────────── */
.blog-content               { font-family: var(--font-body); font-size: 16px; line-height: 1.85; color: #334155; }
.blog-content h2            { font-family: var(--font-head); font-size: 22px; font-weight: 800; color: #0F172A; margin: 32px 0 14px; letter-spacing: -0.03em; }
.blog-content h3            { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: #0F172A; margin: 24px 0 10px; letter-spacing: -0.02em; }
.blog-content p             { margin-bottom: 16px; }
.blog-content ul,
.blog-content ol            { margin: 16px 0 16px 24px; }
.blog-content li            { margin-bottom: 8px; }
.blog-content blockquote    { border-left: 4px solid var(--blue); padding: 12px 20px; background: var(--blue-light); border-radius: 0 8px 8px 0; margin: 20px 0; font-style: italic; }
.blog-content strong        { color: #0F172A; font-weight: 700; }
.blog-content a             { color: var(--blue); text-decoration: underline; }
.blog-content code          { background: #F1F5F9; padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 13px; }

/* ── UTILITY ──────────────────────────────────────────────── */
.badge-plan    { padding: 3px 8px; border-radius: 100px; font-size: 10px; font-weight: 700; font-family: var(--font-head); }
.bp-free       { background: var(--gray-100); color: var(--gray-600); }
.bp-monthly    { background: var(--blue-light); color: var(--blue); }
.bp-yearly     { background: #F3F0FF; color: var(--purple); }
.bp-per_project{ background: #FFF0EB; color: var(--orange); }
.action-btn    { padding: 5px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: var(--font-body); border: none; transition: all .2s; }
.action-btn.danger { background: #FEE2E2; color: #991B1B; }
.action-btn.danger:hover { background: #DC2626; color: #fff; }
.action-btn.info   { background: var(--blue-light); color: var(--blue); }
.action-btn.info:hover   { background: var(--blue); color: #fff; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate { animation: fadeIn .5s ease both; }
