/* =============================================
   STEP-UP WITH ENGLISH
   Light Professional Design System
   Industry-grade SaaS — Notion/Grammarly level
   ============================================= */

/* --- GOOGLE FONTS --- */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

/* --- CSS VARIABLES (Light Theme) --- */
:root {
  /* Brand */
  --brand-red: #8b1a1a;
  --brand-red-dark: #6e1515;
  --brand-red-light: #a82020;
  --brand-red-soft: #fef2f2;
  --brand-red-mid: #fee2e2;
  --brand-navy: #1b2a5c;
  --brand-navy-soft: #eef2ff;
  --brand-navy-mid: #c7d2fe;

  /* Neutral Palette */
  --bg-page: #f6f7f9;
  --bg-white: #ffffff;
  --bg-subtle: #f1f3f7;
  --border: #e4e7ee;
  --border-med: #d0d5e0;

  /* Text */
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6b7280;
  --text-light: #9ca3af;

  /* Sidebar */
  --sidebar-bg: #ffffff;
  --sidebar-width: 236px;

  /* Shadow */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.07), 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-red: 0 4px 16px rgba(139, 26, 26, 0.18);

  /* Radius */
  --r-xs: 4px;
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-full: 100px;

  /* Transition */
  --t: 0.18s ease;
}

/* --- RESET --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}
body {
  font-family: "Inter", system-ui, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  line-height: 1.6;
  font-size: 0.9rem;
}
a {
  text-decoration: none;
  color: inherit;
}
img {
  max-width: 100%;
  display: block;
}
button {
  cursor: pointer;
  border: none;
  font-family: inherit;
  background: none;
}
input,
textarea,
select {
  font-family: "Inter", sans-serif;
  outline: none;
}
h1,
h2,
h3,
h4 {
  font-family: "Plus Jakarta Sans", sans-serif;
  line-height: 1.25;
}

/* ==================================
   SIDEBAR
   ================================== */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transition: transform var(--t);
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
}
.sidebar-logo {
  width: auto;
  object-fit: contain;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 12px 10px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition:
    background var(--t),
    color var(--t);
}
.nav-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--brand-red-soft);
  color: var(--brand-red);
  font-weight: 600;
}
.nav-icon {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 10px;
  border-top: 1px solid var(--border);
}
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--r-md);
  margin-bottom: 8px;
  transition: background var(--t);
}
.user-chip:hover {
  background: var(--bg-subtle);
}
.user-avatar {
  width: 32px;
  height: 32px;
  background: var(--brand-red);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  color: #fff;
  flex-shrink: 0;
}
.user-info {
  overflow: hidden;
}
.user-name-chip {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.user-role {
  font-size: 0.7rem;
  color: var(--text-light);
}

.btn-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 10px;
  border-radius: var(--r-sm);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  transition:
    background var(--t),
    color var(--t);
}
.btn-logout:hover {
  background: var(--brand-red-soft);
  color: var(--brand-red);
}

/* Mobile */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 300;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  font-size: 1.1rem;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.3);
  backdrop-filter: blur(2px);
  z-index: 150;
}

/* ==================================
   MAIN CONTENT
   ================================== */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-height: 100vh;
  padding: 32px 36px;
  background: var(--bg-page);
}

/* ==================================
   PAGE HEADER
   ================================== */
.page-header {
  margin-bottom: 28px;
}
.page-header h1 {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.page-header p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.page-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-red);
  margin-bottom: 6px;
}

/* ==================================
   CARDS
   ================================== */
.card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-xs);
}
.card-sm {
  padding: 16px 20px;
}
.card:hover {
  box-shadow: var(--shadow-sm);
}

/* ==================================
   BUTTONS
   ================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: "Inter", sans-serif;
  transition: all var(--t);
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--brand-red);
  color: #fff;
  border-color: var(--brand-red-dark);
  box-shadow: var(--shadow-red);
}
.btn-primary:hover {
  background: var(--brand-red-dark);
  box-shadow:
    var(--shadow-red),
    0 1px 2px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-white);
  color: var(--text-secondary);
  border-color: var(--border-med);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--border-med);
}
.btn-navy {
  background: var(--brand-navy);
  color: #fff;
  border-color: var(--brand-navy);
}
.btn-navy:hover {
  background: #243470;
}
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.btn-danger {
  background: var(--brand-red-soft);
  color: var(--brand-red);
  border-color: var(--brand-red-mid);
}
.btn-danger:hover {
  background: var(--brand-red-mid);
}
.btn-lg {
  padding: 12px 26px;
  font-size: 0.95rem;
  border-radius: var(--r-md);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: var(--r-xs);
}

/* ==================================
   FORMS
   ================================== */
.form-group {
  margin-bottom: 16px;
}
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-control {
  width: 100%;
  background: var(--bg-white);
  border: 1px solid var(--border-med);
  border-radius: var(--r-sm);
  padding: 10px 13px;
  color: var(--text-primary);
  font-size: 0.875rem;
  transition:
    border-color var(--t),
    box-shadow var(--t);
}
.form-control:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.1);
}
.form-control::placeholder {
  color: var(--text-light);
}

/* ==================================
   STATS
   ================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-xs);
}
.stat-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.stat-value {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  margin: 4px 0 2px;
  line-height: 1;
}
.stat-sub {
  font-size: 0.75rem;
  color: var(--text-light);
}
.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  margin-bottom: 12px;
}
.stat-icon-red {
  background: var(--brand-red-soft);
}
.stat-icon-navy {
  background: var(--brand-navy-soft);
}
.stat-icon-gold {
  background: #fffbeb;
}

/* ==================================
   BADGES / TAGS
   ================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-red {
  background: var(--brand-red-soft);
  color: var(--brand-red);
}
.badge-navy {
  background: var(--brand-navy-soft);
  color: var(--brand-navy);
}
.badge-green {
  background: #f0fdf4;
  color: #16a34a;
}
.badge-amber {
  background: #fffbeb;
  color: #b45309;
}
.badge-gray {
  background: var(--bg-subtle);
  color: var(--text-muted);
}

/* ==================================
   DIVIDER
   ================================== */
.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

/* ==================================
   MODAL
   ================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 20px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t);
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.modal-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: auto;
}
.modal-overlay.open .modal-box {
  transform: translateY(0) scale(1);
}
.modal-box h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.modal-sub {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 22px;
}

.auth-tabs {
  display: flex;
  background: var(--bg-subtle);
  border-radius: var(--r-sm);
  padding: 3px;
  gap: 3px;
  margin-bottom: 22px;
}
.auth-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--t);
}
.auth-tab.active {
  background: var(--bg-white);
  color: var(--brand-red);
  box-shadow: var(--shadow-xs);
}
.form-error {
  font-size: 0.78rem;
  color: var(--brand-red);
  margin-bottom: 10px;
  display: none;
  padding: 8px 12px;
  background: var(--brand-red-soft);
  border-radius: var(--r-xs);
  border: 1px solid var(--brand-red-mid);
}
.form-error.show {
  display: block;
}

/* ==================================
   TOAST
   ================================== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 18px;
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(60px);
  opacity: 0;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 320px;
  color: var(--text-primary);
  font-weight: 500;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success {
  border-left: 3px solid #16a34a;
}
.toast.error {
  border-left: 3px solid var(--brand-red);
}

/* ==================================
   PROGRESS BAR
   ================================== */
.progress-bar {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: var(--r-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: var(--r-full);
  background: var(--brand-red);
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ==================================
   LAYOUT UTILS
   ================================== */
.flex {
  display: flex;
}
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.gap-sm {
  gap: 8px;
}
.gap-md {
  gap: 14px;
}
.gap-lg {
  gap: 20px;
}
.mt-sm {
  margin-top: 8px;
}
.mt-md {
  margin-top: 16px;
}
.mt-lg {
  margin-top: 24px;
}
.mb-sm {
  margin-bottom: 8px;
}
.mb-md {
  margin-bottom: 16px;
}
.mb-lg {
  margin-bottom: 24px;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border-med);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ==================================
   === LANDING PAGE ===
   ================================== */
.landing-body {
  display: block;
  margin-left: 0;
  background: #fff;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 60px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.landing-logo {
  height: 60px;
}
.landing-nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Hero */
.hero-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 72px 60px 64px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-red);
  margin-bottom: 16px;
}
.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 18px;
}
.hero-title .accent {
  color: var(--brand-red);
}
.hero-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.75;
  margin-bottom: 32px;
  max-width: 460px;
}
.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.hero-visual {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px;
  box-shadow: var(--shadow-md);
  position: relative;
}
.hero-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-xs);
  transition:
    transform var(--t),
    box-shadow var(--t);
}
.hero-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-sm);
}
.hero-card:last-child {
  margin-bottom: 0;
}
.hero-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--r-sm);
  background: var(--brand-red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.hero-card-icon.navy {
  background: var(--brand-navy-soft);
}
.hero-card-icon.amber {
  background: #fffbeb;
}
.hero-card-title {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.hero-card-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Features Strip */
.features-strip {
  background: var(--bg-page);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 56px 60px;
}
.section-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-red);
  text-align: center;
  margin-bottom: 10px;
}
.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 480px;
  margin: 0 auto 44px;
  line-height: 1.7;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto;
}
.feat-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  transition:
    box-shadow var(--t),
    transform var(--t),
    border-color var(--t);
}
.feat-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--brand-red-mid);
  transform: translateY(-2px);
}
.feat-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--r-sm);
  background: var(--brand-red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 16px;
}
.feat-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.feat-card p {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* Footer */
.landing-footer {
  border-top: 1px solid var(--border);
  padding: 24px 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  background: var(--bg-white);
}
.footer-copy {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* Quick Links Grid */
.quick-links-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}

/* ==================================
   DASHBOARD
   ================================== */
.welcome-bar {
  background: var(--brand-navy);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}
.welcome-bar::before {
  content: "";
  position: absolute;
  right: -20px;
  top: -20px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}
.welcome-bar::after {
  content: "";
  position: absolute;
  right: 60px;
  top: 30px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
}
.welcome-text h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.welcome-text p {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 4px;
}
.welcome-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
  z-index: 1;
}
.btn-white {
  background: #fff;
  color: var(--brand-navy);
  border-color: rgba(255, 255, 255, 0.2);
  font-weight: 700;
}
.btn-white:hover {
  background: #f0f4ff;
}
.btn-white-outline {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.btn-white-outline:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

/* Recent Drafts */
.draft-list {
  display: flex;
  flex-direction: column;
}
.draft-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: background var(--t);
  border-radius: 0;
}
.draft-row:last-child {
  border-bottom: none;
}
.draft-row:hover .draft-title {
  color: var(--brand-red);
}
.draft-thumb {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  background: var(--brand-red-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.draft-body {
  flex: 1;
  min-width: 0;
}
.draft-title {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t);
}
.draft-meta-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 3px;
  flex-wrap: wrap;
}
.draft-words {
  font-size: 0.72rem;
  color: var(--text-light);
}
.draft-score-pill {
  font-weight: 800;
  color: var(--brand-red);
  font-size: 0.85rem;
  font-family: "Plus Jakarta Sans", sans-serif;
}

/* ==================================
   ARCHIVES
   ================================== */
.archives-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.archives-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(272px, 1fr));
  gap: 14px;
}
.archive-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition:
    box-shadow var(--t),
    border-color var(--t),
    transform var(--t);
  box-shadow: var(--shadow-xs);
}
.archive-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-med);
  transform: translateY(-1px);
}
.archive-card-score {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--brand-red);
  letter-spacing: -0.03em;
  line-height: 1;
}
.archive-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archive-card-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}
.archive-card-date {
  font-size: 0.72rem;
  color: var(--text-light);
}
.archive-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* ==================================
   GENRES PAGE
   ================================== */
.genres-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  height: calc(100vh - 128px);
}
.genre-list-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow-y: auto;
  padding: 10px;
  box-shadow: var(--shadow-xs);
}
.genre-list-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition:
    background var(--t),
    color var(--t);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.genre-list-item:hover {
  background: var(--bg-subtle);
  color: var(--text-primary);
}
.genre-list-item.active {
  background: var(--brand-red-soft);
  color: var(--brand-red);
  font-weight: 600;
}
.genre-list-item .g-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.genre-guide-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 32px;
  overflow-y: auto;
  box-shadow: var(--shadow-xs);
}
.genre-placeholder {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-light);
  text-align: center;
}
.genre-placeholder-emoji {
  font-size: 3rem;
  opacity: 0.5;
}
.genre-guide-title {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.guide-section {
  margin-top: 22px;
}
.guide-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-red);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.guide-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.structure-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.structure-item {
  display: flex;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-page);
  border-radius: var(--r-sm);
  border-left: 3px solid var(--brand-red);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand-red);
}
.structure-num {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--brand-red);
  flex-shrink: 0;
  padding-top: 1px;
  min-width: 16px;
}
.structure-name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--text-primary);
}
.structure-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.5;
}
.features-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pro-tip-box {
  background: var(--brand-navy-soft);
  border: 1px solid var(--brand-navy-mid);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.pro-tip-text {
  font-size: 0.875rem;
  color: var(--brand-navy);
  line-height: 1.6;
  font-style: italic;
}
.sample-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.75;
  font-style: italic;
}

/* ==================================
   IDEA LAB
   ================================== */
.idea-search-box {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 24px 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-xs);
}
.idea-search-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.idea-input {
  flex: 1;
  background: var(--bg-page);
  border: 1px solid var(--border-med);
  border-radius: var(--r-sm);
  padding: 11px 16px;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition:
    border-color var(--t),
    box-shadow var(--t);
}
.idea-input:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(139, 26, 26, 0.09);
  background: var(--bg-white);
}
.idea-input::placeholder {
  color: var(--text-light);
}
.ideas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.idea-card {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: all var(--t);
  box-shadow: var(--shadow-xs);
  animation: ideaReveal 0.35s ease both;
  opacity: 0;
  overflow: hidden;
}
@keyframes ideaReveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.idea-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
/* Visual header (Image) */
.idea-card-visual {
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 12px;
  position: relative;
  overflow: hidden;
}
.idea-card-visual-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0) 20%, rgba(0,0,0,0.6) 100%);
  pointer-events: none;
}
.idea-card-num {
  position: relative;
  z-index: 1;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}
/* Text body */
.idea-card-body {
  padding: 14px 16px 16px;
}
.idea-num {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-red);
  margin-bottom: 8px;
}
.idea-title {
  font-weight: 700;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.idea-cta {
  font-size: 0.73rem;
  color: var(--brand-red);
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  opacity: 0;
  transition: opacity var(--t);
}
.idea-card:hover .idea-cta {
  opacity: 1;
}


/* ==================================
   EDITOR PAGE
   ================================== */
.editor-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 16px;
  height: calc(100vh - 128px);
}
.editor-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.editor-toolbar {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-page);
  flex-wrap: wrap;
}
.editor-title-input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}
.editor-title-input::placeholder {
  color: var(--text-light);
  font-weight: 400;
}
.genre-select {
  background: var(--bg-white);
  border: 1px solid var(--border-med);
  border-radius: var(--r-xs);
  color: var(--text-secondary);
  padding: 6px 10px;
  font-size: 0.78rem;
  font-family: "Inter", sans-serif;
}
.editor-area {
  flex: 1;
  padding: 24px 28px;
  color: var(--text-primary);
  font-size: 1rem;
  line-height: 1.9;
  resize: none;
  background: transparent;
  border: none;
  overflow-y: auto;
}
.editor-area::placeholder {
  color: var(--text-light);
  font-style: italic;
}
.editor-footer {
  padding: 11px 18px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-page);
  gap: 10px;
}
.word-counter {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
}
.word-counter span {
  color: var(--brand-red);
  font-weight: 700;
}
.editor-actions {
  display: flex;
  gap: 8px;
}

/* AI Mentor Panel */
.mentor-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
}
.mentor-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-page);
}
.mentor-avatar {
  width: 32px;
  height: 32px;
  background: var(--brand-navy);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}
.mentor-name {
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-primary);
}
.mentor-status {
  font-size: 0.7rem;
  color: #16a34a;
  display: flex;
  align-items: center;
  gap: 4px;
}
.online-dot {
  width: 6px;
  height: 6px;
  background: #16a34a;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-bubble {
  max-width: 88%;
  padding: 10px 13px;
  border-radius: var(--r-md);
  font-size: 0.82rem;
  line-height: 1.55;
  animation: bubbleIn 0.25s ease both;
}
@keyframes bubbleIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chat-bubble.ai {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  color: var(--text-secondary);
}
.chat-bubble.user {
  background: var(--brand-navy);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
  color: #fff;
}
.chat-input-row {
  padding: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  background: var(--bg-page);
}
.chat-input {
  flex: 1;
  background: var(--bg-white);
  border: 1px solid var(--border-med);
  border-radius: var(--r-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.82rem;
  transition: border-color var(--t);
}
.chat-input:focus {
  border-color: var(--brand-red);
}
.chat-input::placeholder {
  color: var(--text-light);
}
.btn-send {
  width: 34px;
  height: 34px;
  background: var(--brand-red);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: all var(--t);
}
.btn-send:hover {
  background: var(--brand-red-dark);
  transform: scale(1.05);
}

/* ==================================
   EVALUATION MODAL
   ================================== */
.eval-modal-box {
  max-width: 520px;
}
.eval-score-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 0 20px;
}
.eval-score-circle {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: conic-gradient(
    var(--brand-red) 0deg,
    var(--brand-red) var(--score-deg, 0deg),
    var(--bg-subtle) var(--score-deg, 0deg)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  position: relative;
}
.eval-score-circle::after {
  content: "";
  width: 72px;
  height: 72px;
  background: var(--bg-white);
  border-radius: 50%;
  position: absolute;
}
.eval-score-num {
  position: relative;
  z-index: 1;
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
}
.eval-score-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-light);
}
.eval-breakdown {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}
.eval-row-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 5px;
}
.eval-row-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.eval-row-val {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--brand-red);
  font-family: "Plus Jakarta Sans", sans-serif;
}
.feedback-item {
  display: flex;
  gap: 10px;
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 6px;
}
.eval-section-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--brand-red);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.eval-section-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}


/* ==================================
   RESPONSIVE
   ================================== */

/* ---- Tablet / Small Desktop (≤ 900px) ---- */
@media (max-width: 900px) {
  /* Sidebar becomes drawer */
  .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-width)));
  }
  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .sidebar-overlay.show {
    display: block;
  }
  .mobile-menu-btn {
    display: flex;
  }

  /* Main content no longer offset */
  .main-content {
    margin-left: 0;
    padding: 68px 16px 32px;
  }

  /* Landing nav */
  .landing-nav {
    padding: 12px 20px;
    gap: 8px;
  }
  .landing-nav-actions {
    gap: 6px;
  }

  /* Hero — single column */
  .hero-section {
    grid-template-columns: 1fr !important;
    padding: 40px 20px 36px !important;
    gap: 28px !important;
  }
  .hero-visual {
    display: none;
  }
  .hero-desc {
    max-width: 100%;
  }

  /* Features */
  .features-strip {
    padding: 40px 20px;
  }
  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Stats */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Welcome bar */
  .welcome-bar {
    padding: 22px 20px;
  }

  /* Genres: stack list above panel */
  .genres-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .genre-list-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px;
    overflow-y: visible;
  }
  .genre-list-item {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.82rem;
  }
  .genre-guide-panel {
    min-height: 60vh;
    padding: 20px;
  }

  /* Editor: stack writing + mentor */
  .editor-layout {
    grid-template-columns: 1fr;
    height: auto;
    gap: 12px;
  }
  .editor-panel {
    min-height: 55vh;
  }
  .mentor-panel {
    height: 360px;
  }

  /* Archives grid */
  .archives-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Footer */
  .landing-footer {
    padding: 20px 24px;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* ---- Mobile (≤ 480px) ---- */
@media (max-width: 480px) {
  /* Typography */
  .hero-title {
    font-size: 1.75rem;
  }
  .page-header h1 {
    font-size: 1.4rem;
  }

  /* Landing nav: shrink buttons */
  .landing-nav {
    padding: 10px 14px;
  }
  .landing-nav-actions .btn {
    padding: 7px 12px;
    font-size: 0.78rem;
  }

  /* Hero CTA: stack */
  .hero-cta {
    flex-direction: column;
    gap: 10px;
  }
  .hero-cta .btn {
    width: 100%;
    justify-content: center;
  }

  /* Social proof row */
  .hero-section
    [style*="display:flex"][style*="align-items:center"][style*="gap:14px"] {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  /* Features — 1 col */
  .features-grid {
    grid-template-columns: 1fr;
  }
  .feat-card {
    padding: 18px;
  }

  /* Stats — 1 col */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Welcome bar — stacked */
  .welcome-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px;
  }
  .welcome-actions {
    width: 100%;
    flex-direction: row;
    gap: 8px;
  }
  .welcome-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.8rem;
    padding: 9px 10px;
  }

  /* Quick link cards: stack */
  .quick-links-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* Archives: 1 col */
  .archives-grid {
    grid-template-columns: 1fr;
  }

  /* Archives toolbar */
  .archives-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .archives-toolbar .form-control,
  .archives-toolbar select {
    width: 100%;
  }

  /* Genres: pill list */
  .genre-list-panel {
    gap: 4px;
  }
  .genre-guide-panel {
    padding: 16px;
  }
  .genre-guide-title {
    font-size: 1.25rem;
  }

  /* Idea lab search */
  .idea-search-box {
    padding: 16px;
  }
  .idea-search-row {
    flex-direction: column;
    gap: 8px;
  }
  .idea-search-row .btn {
    width: 100%;
    justify-content: center;
  }
  .ideas-grid {
    grid-template-columns: 1fr;
  }

  /* Editor */
  .editor-panel {
    min-height: 60vmax;
  }
  .editor-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 14px;
  }
  .editor-title-input {
    font-size: 0.9rem;
  }
  .genre-select {
    width: 100%;
  }
  .editor-area {
    padding: 16px;
    font-size: 0.95rem;
  }
  .editor-footer {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 14px;
  }
  .editor-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .mentor-panel {
    height: 340px;
  }

  /* Modal */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }
  .modal-box {
    padding: 20px 18px;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    max-width: 100% !important;
  }

  /* Toast */
  .toast {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: 100%;
  }

  /* Main content padding */
  .main-content {
    padding: 64px 12px 28px;
  }

  /* Card padding */
  .card {
    padding: 16px;
  }
  .stat-card {
    padding: 16px 18px;
  }
  .stat-value {
    font-size: 1.75rem;
  }

  /* Page header */
  .page-header {
    margin-bottom: 20px;
  }

  /* Landing footer */
  .landing-footer {
    padding: 16px 14px;
  }
}
