@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;0,800;1,400;1,600&family=DM+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
  --navy: #1a2332;
  --navy-deep: #0f1721;
  --navy-light: #243044;
  --gold: #d4a853;
  --gold-light: #e8c882;
  --gold-dim: #a68438;
  --gold-faint: rgba(212, 168, 83, 0.12);
  --cream: #f5f0e8;
  --cream-dark: #e8e0d2;
  --parchment: #faf6ee;
  --ink: #1c1c1c;
  --ink-light: #4a4a4a;
  --ink-faint: #7a7a7a;
  --green: #3d6b5e;
  --green-light: #4d8b74;
  --border: #d6cfc3;
  --border-light: #e8e0d2;
  --danger: #c0392b;
  --danger-light: rgba(192, 57, 43, 0.1);
  --success: #27ae60;
  --success-light: rgba(39, 174, 96, 0.1);
  --warning: #d4a853;
  --twitter: #1da1f2;
  --facebook: #1877f2;
  --instagram: #e4405f;
  --linkedin: #0a66c2;
  --threads: #1c1c1c;
  --tiktok: #ff0050;
  --youtube: #ff0000;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--cream);
  color: var(--ink);
  height: 100vh;
  overflow: hidden;
}

.serif { font-family: 'Playfair Display', Georgia, serif; }
.mono { font-family: 'JetBrains Mono', monospace; }

/* ===== LANDING PAGE ===== */
#landing-page {
  overflow-y: auto;
  overflow-x: hidden;
  max-width: 100vw;
  background: var(--cream);
}

#landing-page::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1000;
}

/* Landing Nav */
.landing-nav {
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.logo-mark {
  width: 36px;
  height: 36px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  object-fit: cover;
}

.logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.landing-nav-links { display: flex; gap: 32px; align-items: center; }
.landing-nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}
.landing-nav-links a:hover { color: var(--ink); }
.landing-nav-cta {
  background: var(--navy);
  color: var(--cream) !important;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 600 !important;
  transition: background 0.2s !important;
}
.landing-nav-cta:hover { background: var(--navy-deep) !important; }

/* Hero */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 48px 100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  overflow: hidden;
}

.hero-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-tag::before {
  content: '';
  width: 24px;
  height: 1px;
  background: var(--gold);
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 54px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--navy);
  margin-bottom: 24px;
  letter-spacing: -1px;
}
.hero h1 em { color: var(--gold-dim); font-style: italic; }

.hero p {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink-light);
  margin-bottom: 36px;
  max-width: 480px;
}

.hero-actions { display: flex; gap: 16px; align-items: center; }

.btn-primary-landing {
  background: var(--navy);
  color: var(--cream);
  padding: 16px 36px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s;
  border: 2px solid var(--navy);
  white-space: nowrap;
}
.btn-primary-landing:hover { background: var(--navy-deep); border-color: var(--navy-deep); }

.btn-secondary-landing {
  color: var(--ink);
  padding: 16px 24px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  transition: all 0.2s;
}
.btn-secondary-landing:hover { color: var(--gold-dim); }

/* Hero Card */
.hero-right { position: relative; }
.hero-card {
  background: var(--navy);
  border-radius: 12px;
  padding: 28px;
  color: var(--cream);
  box-shadow: 0 24px 80px rgba(26,35,50,0.2);
  position: relative;
  overflow: hidden;
}
.hero-card::after {
  content: '';
  position: absolute;
  top: -50%; right: -50%;
  width: 100%; height: 100%;
  background: radial-gradient(circle, rgba(212,168,83,0.08) 0%, transparent 70%);
  pointer-events: none;
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.card-header-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
}
.card-dots { display: flex; gap: 6px; }
.card-dots span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.15); }
.card-dots span:first-child { background: var(--gold); }
.card-chat-bubble {
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(245,240,232,0.8);
}
.card-chat-user {
  background: rgba(212,168,83,0.12);
  border: 1px solid rgba(212,168,83,0.2);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--gold-light);
  text-align: right;
}
.card-drafts-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(245,240,232,0.4);
  margin-bottom: 10px;
}
.card-draft-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  border-radius: 6px;
  margin-bottom: 6px;
}
.card-platform-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  flex-shrink: 0;
}
.badge-x { background: rgba(255,255,255,0.12); color: #fff; }
.badge-fb { background: rgba(66,103,178,0.3); color: #8ba6d4; }
.badge-ig { background: rgba(225,48,108,0.2); color: #e8839e; }
.badge-li { background: rgba(10,102,194,0.25); color: #7ab3e0; }
.card-draft-text {
  font-size: 11px;
  color: rgba(245,240,232,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-accent-line {
  position: absolute;
  top: -20px; left: -20px;
  width: 60px; height: 60px;
  border-left: 2px solid var(--gold);
  border-top: 2px solid var(--gold);
  opacity: 0.4;
}

/* Landing Sections */
.divider { max-width: 1200px; margin: 0 auto; padding: 0 48px; }
.divider-line { border: none; height: 1px; background: linear-gradient(to right, transparent, var(--cream-dark), transparent); }

.how-section { max-width: 1200px; margin: 0 auto; padding: 100px 48px; }
.section-header { text-align: center; margin-bottom: 64px; }
.section-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 16px;
}
.section-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 40px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
}

.steps-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; }
.step {
  position: relative;
  padding: 36px;
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  transition: all 0.3s;
}
.step:hover { border-color: var(--gold); box-shadow: 0 8px 32px rgba(212,168,83,0.1); }
.step-num {
  font-family: 'Playfair Display', serif;
  font-size: 48px;
  font-weight: 800;
  color: var(--cream-dark);
  position: absolute;
  top: 20px; right: 24px;
  line-height: 1;
}
.step h3 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; color: var(--navy); margin-bottom: 12px; }
.step p { font-size: 15px; line-height: 1.7; color: var(--ink-light); }

.features-strip { background: var(--navy); padding: 80px 48px; color: var(--cream); }
.features-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 40px; }
.feature-icon {
  width: 40px; height: 40px;
  border: 1px solid rgba(212,168,83,0.3);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
  font-size: 18px;
}
.feature-item h4 { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; color: var(--cream); margin-bottom: 8px; }
.feature-item p { font-size: 14px; line-height: 1.7; color: rgba(245,240,232,0.55); }

.quote-section { max-width: 800px; margin: 0 auto; padding: 100px 48px; text-align: center; }
.quote-mark { font-family: 'Playfair Display', serif; font-size: 80px; color: var(--gold); line-height: 0.5; margin-bottom: 24px; opacity: 0.4; }
.quote-text { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 400; font-style: italic; color: var(--navy); line-height: 1.5; margin-bottom: 20px; }
.quote-attr { font-family: 'JetBrains Mono', monospace; font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold-dim); }

.usecases-section { max-width: 1200px; margin: 0 auto; padding: 0 48px 100px; }
.usecases-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 64px; }
.usecase-card {
  background: var(--parchment);
  border: 1px solid var(--cream-dark);
  border-radius: 10px;
  padding: 36px;
  transition: all 0.3s;
}
.usecase-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: 0 12px 40px rgba(26,35,50,0.08); }
.usecase-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--green);
  background: rgba(61,107,94,0.08);
  padding: 4px 10px;
  border-radius: 4px;
  display: inline-block;
  margin-bottom: 14px;
}
.usecase-card h3 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; color: var(--navy); margin-bottom: 10px; }
.usecase-card p { font-size: 15px; line-height: 1.7; color: var(--ink-light); }

.cta-section {
  background: var(--navy);
  padding: 100px 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-section::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center top, rgba(212,168,83,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.cta-inner { position: relative; max-width: 600px; margin: 0 auto; }
.cta-section h2 { font-family: 'Playfair Display', serif; font-size: 40px; font-weight: 700; color: var(--cream); margin-bottom: 16px; letter-spacing: -0.5px; }
.cta-section p { font-size: 17px; line-height: 1.7; color: rgba(245,240,232,0.55); margin-bottom: 36px; }
.btn-gold {
  display: inline-block;
  background: var(--gold);
  color: var(--navy);
  padding: 16px 40px;
  border-radius: 6px;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.25s;
  letter-spacing: 0.3px;
}
.btn-gold:hover { background: var(--gold-light); }
.cta-sub { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: rgba(245,240,232,0.3); margin-top: 14px; }

.landing-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--cream-dark);
}
.footer-left { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600; color: var(--navy); }
.footer-right { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--ink-faint); letter-spacing: 0.5px; }

/* Landing Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.hero-left { animation: fadeUp 0.8s ease-out; }
.hero-right { animation: fadeUp 0.8s ease-out 0.2s both; }
.step { animation: fadeUp 0.6s ease-out both; }
.step:nth-child(1) { animation-delay: 0.1s; }
.step:nth-child(2) { animation-delay: 0.2s; }
.step:nth-child(3) { animation-delay: 0.3s; }

/* Landing Responsive */
@media (max-width: 900px) {
  .landing-nav { padding: 20px 24px; }
  .hero { grid-template-columns: 1fr; padding: 40px 24px 60px; gap: 40px; }
  .hero h1 { font-size: 36px; }
  .steps-grid { grid-template-columns: 1fr; }
  .features-inner { grid-template-columns: 1fr 1fr; }
  .usecases-grid { grid-template-columns: 1fr; }
  .hero-right { display: none; }
  .landing-nav-links a:not(.landing-nav-cta) { display: none; }
}


/* ===== LOGIN ===== */
.screen { height: 100vh; }

#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  position: relative;
}

.login-container {
  background: var(--parchment);
  padding: 48px;
  border-radius: 16px;
  border: 1px solid var(--cream-dark);
  width: 100%;
  max-width: 420px;
  text-align: center;
  box-shadow: 0 16px 64px rgba(26,35,50,0.08);
}

.login-logo {
  margin-bottom: 32px;
}

.login-logo-mark {
  width: 56px;
  height: 56px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 16px;
}

.login-logo h1 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
}

.login-subtitle {
  color: var(--ink-faint);
  font-size: 14px;
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}

#login-form input {
  width: 100%;
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 15px;
  font-family: 'DM Sans', sans-serif;
  margin-bottom: 16px;
  outline: none;
  transition: border-color 0.2s;
}

#login-form input:focus {
  border-color: var(--gold);
}

#login-form button {
  width: 100%;
  padding: 14px;
  background: var(--navy);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}

#login-form button:hover {
  background: var(--navy-deep);
}

#login-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.login-message {
  margin-top: 16px;
  font-size: 14px;
  color: var(--ink-light);
}

.login-message.success { color: var(--success); }
.login-message.error { color: var(--danger); }

.login-back-link {
  display: inline-block;
  margin-top: 20px;
  font-size: 13px;
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.2s;
}
.login-back-link:hover { color: var(--gold-dim); }


/* ===== APP LAYOUT ===== */
#app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--navy);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-logo {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Playfair Display', serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--cream);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-logo-mark {
  width: 32px;
  height: 32px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.nav-links {
  padding: 12px;
  flex: 1;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: none;
  border: none;
  border-radius: 8px;
  color: rgba(245,240,232,0.5);
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.nav-btn:hover {
  background: rgba(255,255,255,0.06);
  color: var(--cream);
}

.nav-btn.active {
  background: var(--gold);
  color: var(--navy);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-info {
  font-size: 13px;
  color: rgba(245,240,232,0.5);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.logout-btn {
  width: 100%;
  padding: 8px;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(245,240,232,0.5);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.logout-btn:hover {
  border-color: var(--danger);
  color: #e74c3c;
}

/* Content */
.content {
  flex: 1;
  overflow: hidden;
  display: flex;
  background: var(--cream);
}

.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  flex-direction: column;
}

.view.active {
  display: flex;
}

/* ===== CHAT ===== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--parchment);
}

.chat-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--cream);
}

.message {
  max-width: 80%;
  animation: fadeIn 0.3s ease;
}

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

.message.user { align-self: flex-end; }
.message.assistant { align-self: flex-start; }

.message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
}

.message.user .message-content {
  background: var(--navy);
  color: var(--cream);
  border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
  background: var(--parchment);
  border: 1px solid var(--border);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}

.message-content p { margin-bottom: 8px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content ul { margin: 8px 0; padding-left: 20px; }
.message-content li { margin-bottom: 4px; }
.message-content code {
  background: var(--gold-faint);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
}

/* Draft preview in chat */
.draft-preview {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.draft-preview-header {
  padding: 10px 14px;
  background: var(--navy);
  color: var(--cream);
  font-weight: 600;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.draft-platform {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}

.draft-platform-name {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--ink-faint);
  margin-bottom: 4px;
}

.draft-platform-content {
  color: var(--ink);
  white-space: pre-wrap;
}

.approve-draft-btn {
  padding: 6px 16px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}

.approve-draft-btn:hover { background: var(--gold-light); }
.approve-draft-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Chat input */
.chat-input-area {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  flex-shrink: 0;
  background: var(--parchment);
}

.chat-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

#chat-input {
  flex: 1;
  padding: 12px 16px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--ink);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  resize: none;
  outline: none;
  max-height: 120px;
  transition: border-color 0.2s;
}

#chat-input:focus { border-color: var(--gold); }

#chat-send-btn {
  padding: 10px 14px;
  background: var(--navy);
  border: none;
  border-radius: 10px;
  color: var(--cream);
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

#chat-send-btn:hover { background: var(--navy-deep); }
#chat-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Typing indicator */
.typing-indicator { display: flex; gap: 4px; padding: 16px; }
.typing-indicator span {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: typing 1.4s infinite;
  opacity: 0.4;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ===== VIEW HEADER ===== */
.view-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
  background: var(--parchment);
}

.view-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--navy);
}

/* ===== BUTTONS ===== */
.btn-primary {
  padding: 8px 20px;
  background: var(--navy);
  color: var(--cream);
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-primary:hover { background: var(--navy-deep); }

.btn-secondary {
  padding: 8px 20px;
  background: none;
  color: var(--ink-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--gold); color: var(--ink); }

.btn-sm { padding: 6px 12px; font-size: 13px; }

.btn-danger {
  padding: 6px 12px;
  background: none;
  color: var(--danger);
  border: 1px solid var(--danger);
  border-radius: 6px;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger:hover { background: var(--danger); color: white; }

.btn-success {
  padding: 6px 12px;
  background: var(--gold);
  color: var(--navy);
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-success:hover { background: var(--gold-light); }

/* ===== KNOWLEDGE BASE ===== */
.kb-list {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.kb-card {
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s;
}
.kb-card:hover { border-color: var(--gold); }

.kb-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.kb-card-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--navy);
}

.kb-card-meta { display: flex; gap: 8px; align-items: center; }

.kb-category {
  padding: 3px 10px;
  background: var(--gold-faint);
  color: var(--gold-dim);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
}

.kb-source-type {
  padding: 3px 10px;
  background: var(--success-light);
  color: var(--success);
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.kb-card-content {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.5;
  max-height: 80px;
  overflow: hidden;
  margin-bottom: 12px;
  position: relative;
}

.kb-card-content::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 30px;
  background: linear-gradient(transparent, var(--parchment));
}

.kb-card-actions { display: flex; gap: 8px; }

.kb-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-faint);
}
.kb-empty svg { margin-bottom: 16px; opacity: 0.5; }
.kb-empty h3 { margin-bottom: 8px; color: var(--ink-light); font-family: 'Playfair Display', serif; }

/* ===== MODAL ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 50, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.2s ease;
}

.modal-content {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(26,35,50,0.15);
}

.modal-wide { max-width: 720px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-header h3 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--navy);
}

.modal-close {
  background: none;
  border: none;
  color: var(--ink-faint);
  font-size: 24px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--ink); }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* ===== FORM ===== */
.form-group { margin-bottom: 16px; }

.form-group label {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-faint);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--gold);
}

.form-group select { cursor: pointer; }

/* ===== DRAFTS ===== */
.drafts-filter { display: flex; gap: 4px; }

.filter-btn {
  padding: 6px 14px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--ink-faint);
  font-size: 13px;
  font-family: 'JetBrains Mono', monospace;
  cursor: pointer;
  transition: all 0.2s;
}
.filter-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--cream);
}

.buffer-notice {
  margin: 16px 24px 0;
  padding: 12px 16px;
  background: var(--gold-faint);
  border: 1px solid rgba(212,168,83,0.3);
  border-radius: 8px;
  color: var(--gold-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.drafts-bulk-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: var(--parchment);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}

.draft-select-all-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-light);
  cursor: pointer;
  margin-right: 8px;
}
.draft-select-all-label input { accent-color: var(--gold); cursor: pointer; }

.draft-card-checkbox {
  display: flex;
  align-items: center;
  cursor: pointer;
  flex-shrink: 0;
}
.draft-card-checkbox input {
  width: 16px; height: 16px;
  accent-color: var(--gold);
  cursor: pointer;
}

.drafts-list {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.draft-card {
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.draft-card:hover { border-color: var(--gold); }
.draft-card.approved { border-color: rgba(39, 174, 96, 0.3); }

.draft-card-header {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-light);
}
.draft-card-header .platform-badge { margin-bottom: 0; flex-shrink: 0; }

.draft-card-username {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.draft-card-title {
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 15px;
  color: var(--navy);
  flex: 1;
}

.draft-status {
  padding: 3px 10px;
  border-radius: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.draft-status.pending { background: var(--gold-faint); color: var(--gold-dim); }
.draft-status.approved { background: var(--success-light); color: var(--success); }
.draft-status.posted { background: rgba(26,35,50,0.08); color: var(--navy); }
.draft-status.scheduled { background: rgba(10,102,194,0.1); color: #0a66c2; }
.draft-status.failed { background: var(--danger-light); color: var(--danger); }
.draft-status.queued { background: rgba(10,102,194,0.1); color: #0a66c2; }

.draft-card-body { padding: 16px 20px; }
.draft-card-body p {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.6;
  white-space: pre-wrap;
}

.draft-card-platforms { padding: 16px 20px; }
.draft-card-platform { margin-bottom: 12px; }
.draft-card-platform:last-child { margin-bottom: 0; }

.platform-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.platform-badge.twitter { background: var(--twitter); color: white; }
.platform-badge.facebook { background: var(--facebook); color: white; }
.platform-badge.instagram { background: var(--instagram); color: white; }
.platform-badge.linkedin { background: var(--linkedin); color: white; }
.platform-badge.threads { background: var(--threads); color: white; }
.platform-badge.tiktok { background: var(--tiktok); color: white; }
.platform-badge.youtube { background: var(--youtube); color: white; }

.draft-card-platform p {
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.5;
  white-space: pre-wrap;
}

.draft-card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.draft-card-schedule {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--ink-faint);
}

.draft-card-actions { display: flex; gap: 8px; }

.drafts-empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-faint);
}
.drafts-empty h3 {
  margin-bottom: 8px;
  color: var(--ink-light);
  font-family: 'Playfair Display', serif;
}

/* Platform Editors in Modal */
.platform-editors { display: grid; gap: 12px; }
.platform-editor label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-light);
  margin-bottom: 6px;
}
.platform-editor textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}
.platform-editor textarea:focus { border-color: var(--gold); }

.char-count {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 400;
  font-size: 11px;
  color: var(--ink-faint);
}
.char-count.over { color: var(--danger); font-weight: 600; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--ink-faint); }

/* ===== CALENDAR ===== */
.calendar-desc {
  padding: 16px 24px 0;
  font-size: 13px;
  color: var(--ink-faint);
  flex-shrink: 0;
}

.calendar-grid {
  padding: 24px;
  display: grid;
  gap: 16px;
}

.calendar-day {
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.calendar-day:hover { border-color: var(--gold); }

.calendar-day-name {
  padding: 12px 20px;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--navy);
  background: var(--cream);
  border-bottom: 1px solid var(--border-light);
}

.calendar-day-slots {
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.calendar-slot.disabled { opacity: 0.4; }

.calendar-slot-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink-light);
  flex: 1;
}
.calendar-slot-time.clickable {
  cursor: pointer;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}
.calendar-slot-time.clickable:hover { color: var(--gold-dim); }

.day-checkboxes { display: flex; flex-wrap: wrap; gap: 12px; }
.day-checkboxes label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--ink-light);
  cursor: pointer;
}
.day-checkboxes input { accent-color: var(--gold); cursor: pointer; }

.view-header-actions { display: flex; gap: 8px; }

/* ===== CONNECTED ACCOUNTS ===== */
.accounts-container {
  padding: 24px;
  display: grid;
  gap: 32px;
}

.accounts-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--navy);
}

.accounts-list { display: grid; gap: 12px; }

.account-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  transition: border-color 0.2s;
}
.account-card:hover { border-color: var(--gold); }

.account-platform-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; color: white; flex-shrink: 0;
}

.account-info { flex: 1; }
.account-username { font-weight: 600; font-size: 15px; color: var(--navy); }
.account-platform-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  text-transform: capitalize;
}

.accounts-empty {
  text-align: center;
  padding: 40px;
  color: var(--ink-faint);
}

.connect-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.connect-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--parchment);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.connect-btn:hover { border-color: var(--gold); background: var(--gold-faint); }

.connect-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: white; flex-shrink: 0;
}
.connect-btn.twitter .connect-icon { background: var(--twitter); }
.connect-btn.facebook .connect-icon { background: var(--facebook); }
.connect-btn.instagram .connect-icon { background: var(--instagram); }
.connect-btn.linkedin .connect-icon { background: var(--linkedin); }
.connect-btn.threads .connect-icon { background: var(--threads); }
.connect-btn.tiktok .connect-icon { background: var(--tiktok); }
.connect-btn.youtube .connect-icon { background: var(--youtube); }

/* ===== ADMIN ===== */
.admin-container {
  padding: 24px;
  display: grid;
  gap: 24px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.stat-card {
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--gold); }

.stat-value {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold-dim);
}

.stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-section h3 {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--navy);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--parchment);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 10px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}

.admin-table th {
  background: var(--cream);
  color: var(--ink-faint);
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-table td { color: var(--ink); }
.admin-table tr:last-child td { border-bottom: none; }

.admin-empty {
  padding: 24px;
  text-align: center;
  color: var(--ink-faint);
  font-size: 14px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  font-family: 'DM Sans', sans-serif;
  color: white;
  z-index: 200;
  animation: slideUp 0.3s ease, fadeOut 0.3s ease 3.7s;
  animation-fill-mode: forwards;
  box-shadow: 0 8px 32px rgba(26,35,50,0.15);
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .nav-btn span:not(svg), .user-info { display: none; }
  .nav-btn { justify-content: center; padding: 12px; }
  .message { max-width: 95%; }
}
