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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* ── Auth pages ─────────────────────────────────────────── */

body.auth-page {
  background: #f0f4ff;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  padding: 48px 40px 40px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 32px;
}

.auth-logo-text {
  font-size: 20px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.auth-heading {
  font-size: 24px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.4px;
  margin-bottom: 6px;
}

.auth-subheading {
  font-size: 14px;
  color: #6b7280;
  margin-bottom: 28px;
}

/* Google button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 11px 16px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  color: #374151;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.btn-google:hover {
  background: #f9fafb;
  border-color: #9ca3af;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Divider */
.auth-divider {
  position: relative;
  text-align: center;
  margin: 24px 0;
  color: #9ca3af;
  font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: calc(50% - 20px);
  height: 1px;
  background: #e5e7eb;
}

.auth-divider::before { left: 0; }
.auth-divider::after  { right: 0; }

.auth-divider span {
  background: #fff;
  padding: 0 8px;
  position: relative;
}

/* Error banner */
.auth-error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Form fields */
form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  letter-spacing: 0.01em;
}

input {
  padding: 11px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  color: #111;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  width: 100%;
}

input::placeholder {
  color: #9ca3af;
}

input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Primary button */
.btn-primary {
  display: block;
  width: 100%;
  padding: 12px 16px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
  margin-top: 4px;
}

.btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.btn-primary:disabled {
  background: #93c5fd;
  cursor: not-allowed;
  box-shadow: none;
}

/* Footer text */
.auth-terms {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  margin-top: 20px;
  line-height: 1.5;
}

.auth-terms a {
  color: #6b7280;
  text-decoration: underline;
}

.auth-terms a:hover {
  color: #374151;
}

.auth-switch {
  font-size: 14px;
  color: #6b7280;
  text-align: center;
  margin-top: 16px;
}

.auth-switch a {
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ── Landing page ───────────────────────────────────────── */

body.landing-page {
  background: #fff;
  color: #111;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e5e7eb;
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-size: 17px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
  flex-shrink: 0;
}

.nav-links {
  display: flex;
  gap: 28px;
  flex: 1;
}

.nav-links a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  transition: color 0.15s;
}

.nav-links a:hover { color: #111; }

.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.nav-signin {
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  padding: 7px 14px;
  border-radius: 6px;
  transition: background 0.15s;
}

.nav-signin:hover { background: #f3f4f6; }

.nav-cta {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  padding: 8px 16px;
  border-radius: 8px;
  transition: background 0.15s, box-shadow 0.15s;
}

.nav-cta:hover {
  background: #1d4ed8;
  box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}

/* Hero */
.hero {
  background: linear-gradient(160deg, #eff6ff 0%, #f5f3ff 60%, #ecfdf5 100%);
  padding: 88px 24px 80px;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 64px;
}

.hero-text {
  flex: 1;
  min-width: 0;
}

.hero-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 100px;
  padding: 4px 14px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero-heading {
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: #0f172a;
  margin-bottom: 20px;
}

.hero-heading em {
  font-style: normal;
  color: #2563eb;
}

.hero-sub {
  font-size: 18px;
  color: #475569;
  line-height: 1.6;
  max-width: 480px;
  margin-bottom: 36px;
}

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

.hero-btn-primary {
  display: inline-block;
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: #2563eb;
  padding: 14px 28px;
  border-radius: 10px;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.hero-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
  transform: translateY(-1px);
}

.hero-btn-primary.large {
  font-size: 17px;
  padding: 16px 36px;
}

.hero-btn-ghost {
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  transition: color 0.15s;
}

.hero-btn-ghost:hover { color: #2563eb; }

.hero-note {
  font-size: 13px;
  color: #9ca3af;
}

/* Hero visual */
.hero-visual {
  flex-shrink: 0;
  width: 400px;
}

.slide-preview {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.12);
  overflow: hidden;
  border: 1px solid #e5e7eb;
}

.slide-topbar {
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 14px;
  display: flex;
  gap: 6px;
}

.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d1d5db;
}

.slide-dot:first-child { background: #f87171; }
.slide-dot:nth-child(2) { background: #fbbf24; }
.slide-dot:nth-child(3) { background: #34d399; }

.slide-canvas {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slide-title-bar {
  height: 16px;
  background: #e0e7ff;
  border-radius: 4px;
  width: 70%;
}

.slide-body-bar {
  height: 10px;
  background: #f3f4f6;
  border-radius: 4px;
}

.slide-body-bar.wide { width: 90%; }
.slide-body-bar.medium { width: 60%; }

.slide-chart {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  margin-top: 8px;
  padding: 0 4px;
}

.slide-chart .bar {
  flex: 1;
  background: linear-gradient(180deg, #6366f1, #2563eb);
  border-radius: 4px 4px 0 0;
  opacity: 0.85;
}

.slide-chart .bar:nth-child(2) { background: linear-gradient(180deg, #34d399, #059669); }
.slide-chart .bar:nth-child(4) { background: linear-gradient(180deg, #f472b6, #db2777); }

.slide-avatars {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-top: 1px solid #f3f4f6;
  background: #fafafa;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  border: 2px solid #fff;
}

.avatar:first-child { margin-left: 0; }
.av1 { background: #6366f1; }
.av2 { background: #f472b6; }
.av3 { background: #34d399; }

.avatar-label {
  font-size: 12px;
  color: #6b7280;
  margin-left: 4px;
}

/* Social proof strip */
.proof-strip {
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.proof-stat {
  font-size: 14px;
  color: #6b7280;
}

.proof-stat strong {
  color: #111;
  font-weight: 700;
}

.proof-sep {
  width: 1px;
  height: 18px;
  background: #d1d5db;
}

/* Shared section styles */
.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-heading {
  font-size: clamp(26px, 3.5vw, 38px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: #0f172a;
  text-align: center;
  margin-bottom: 12px;
}

.section-sub {
  font-size: 17px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 56px;
}

/* Features */
.features {
  padding: 96px 24px;
  background: #fff;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 28px;
}

.feature-card {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 32px;
  transition: box-shadow 0.2s, transform 0.2s;
}

.feature-card:hover {
  box-shadow: 0 8px 32px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon.blue   { background: #eff6ff; color: #2563eb; }
.feature-icon.purple { background: #f5f3ff; color: #7c3aed; }
.feature-icon.green  { background: #ecfdf5; color: #059669; }

.feature-card h3 {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.65;
}

/* How it works */
.how-it-works {
  padding: 96px 24px;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
}

.steps {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 280px;
  text-align: center;
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #2563eb;
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.step h3 {
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 8px;
}

.step p {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.6;
}

.step-arrow {
  font-size: 24px;
  color: #d1d5db;
  margin-top: 14px;
  flex-shrink: 0;
}

/* Bottom CTA */
.bottom-cta {
  padding: 96px 24px;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  text-align: center;
}

.cta-inner h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.8px;
  margin-bottom: 12px;
}

.cta-inner p {
  font-size: 17px;
  color: #bfdbfe;
  margin-bottom: 36px;
}

.bottom-cta .hero-btn-primary {
  background: #fff;
  color: #1d4ed8;
}

.bottom-cta .hero-btn-primary:hover {
  background: #f0f9ff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

/* Footer */
.footer {
  background: #0f172a;
  padding: 36px 24px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #f1f5f9;
}

.footer-copy {
  font-size: 13px;
  color: #64748b;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-links a:hover { color: #cbd5e1; }

/* Responsive */
@media (max-width: 768px) {
  .hero-inner { flex-direction: column; gap: 40px; }
  .hero-visual { width: 100%; }
  .nav-links { display: none; }
  .step-arrow { display: none; }
  .proof-sep { display: none; }
  .footer-inner { flex-direction: column; text-align: center; }
  .footer-links { justify-content: center; }
}

/* ── Dashboard ──────────────────────────────────────────── */

body.dashboard-page {
  background: #fff;
  color: #111;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top bar */
.topbar {
  height: 60px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  background: #fff;
  z-index: 50;
}

.topbar-logo {
  width: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  white-space: nowrap;
}

.topbar-search {
  flex: 1;
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.topbar-search svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
}

.topbar-search input {
  width: 100%;
  padding: 9px 14px 9px 40px;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  background: #f9fafb;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.topbar-search input::placeholder { color: #9ca3af; }

.topbar-search input:focus {
  background: #fff;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s;
}

.icon-btn:hover { background: #f3f4f6; }

/* Avatar button + dropdown */
.avatar-wrap { position: relative; }

.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #6b7280;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.15s;
  flex-shrink: 0;
}

.avatar-btn:hover { box-shadow: 0 0 0 2px #d1d5db; }

.avatar-btn.has-photo {
  background: transparent;
  overflow: hidden;
  padding: 0;
}

.avatar-btn.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  min-width: 180px;
  z-index: 200;
  overflow: hidden;
}

.avatar-menu.open { display: block; }

.avatar-menu-user {
  padding: 12px 16px 10px;
  border-bottom: 1px solid #f3f4f6;
}

.avatar-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: #111;
}

.avatar-menu-email {
  font-size: 12px;
  color: #6b7280;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}

.avatar-menu a,
.avatar-menu button.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}

.avatar-menu a:hover,
.avatar-menu button.menu-item:hover { background: #f9fafb; }

.avatar-menu .menu-danger { color: #ef4444; }
.avatar-menu .menu-danger:hover { background: #fef2f2; }

.menu-divider {
  height: 1px;
  background: #f3f4f6;
  margin: 2px 0;
}

/* Main content */
.main {
  flex: 1;
  overflow-y: auto;
}

.main-content {
  max-width: 960px;
  margin: 0 auto;
  padding: 40px 48px;
}

.main-welcome {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.8px;
  color: #111;
  margin-bottom: 28px;
}

/* Action buttons row */
.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.btn-new {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: #1a7aff;
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-new:hover { background: #0f6ae0; }
.btn-new:active { transform: scale(0.97); }

.btn-outline {
  position: relative;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.btn-outline:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.btn-star-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  background: #3d6b4f;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Section headings */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #111;
  margin-bottom: 16px;
  letter-spacing: -0.2px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-row .section-title { margin-bottom: 0; }

.section-mb { margin-bottom: 40px; }

/* Recently viewed card */
.recent-card {
  width: 320px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  background: #fff;
}

.recent-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.recent-card-thumb {
  height: 180px;
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
}

.recent-card-thumb-inner {
  width: 80%;
  height: 80%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.thumb-title {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  align-self: flex-start;
}

.thumb-sub {
  font-size: 9px;
  color: #9ca3af;
  align-self: flex-start;
}

.thumb-illustration {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  gap: 4px;
}

.recent-card-meta {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.recent-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #6b7280;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recent-info { flex: 1; min-width: 0; }

.recent-title {
  font-size: 14px;
  font-weight: 600;
  color: #111;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-time {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 1px;
}

/* See all link */
.see-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  padding: 6px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.see-all:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* Template grid */
.template-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.template-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.15s;
  background: #fff;
}

.template-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.template-thumb {
  height: 120px;
  background: #f8f9fa;
  position: relative;
  overflow: hidden;
}

.template-thumb--warm   { background: #f5f0e8; }
.template-thumb--green  { background: #e8f0e8; }
.template-thumb--indigo { background: #eaeaf8; }

.template-thumb-content {
  position: absolute;
  inset: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.template-thumb-content--top { justify-content: flex-start; }

.template-thumb-text {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  line-height: 1.4;
}

.template-thumb-text--sm {
  font-size: 9px;
  color: #666;
  max-width: 100px;
}

.template-brand {
  position: absolute;
  right: 10px;
  bottom: 10px;
  font-size: 18px;
  font-weight: 800;
  color: #e8762c;
  opacity: 0.7;
  line-height: 1;
}

/* Slider visual inside template cards */
.template-slider {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.template-slider-track {
  flex: 1;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  position: relative;
}

.template-slider-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 75%;
  border-radius: 2px;
}

.template-slider-fill--green  { background: #3d6b4f; }
.template-slider-fill--indigo { background: #6366f1; }

.template-slider-thumb {
  position: absolute;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  color: #fff;
  font-size: 7px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.template-slider-thumb--green  { background: #3d6b4f; }
.template-slider-thumb--indigo { background: #6366f1; }

/* Mountain decoration */
.mountain-bg {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 70px;
  height: 56px;
  opacity: 0.3;
}

.template-label { padding: 8px 12px 10px; }

.template-label p {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  line-height: 1.4;
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 160px;
  color: #9ca3af;
  font-size: 14px;
  gap: 8px;
}

/* ── Post feed ─────────────────────────────────────────── */

.post-feed {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 600px;
}

.post-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: box-shadow 0.15s;
}

.post-card:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.post-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 0;
}

.post-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.post-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.post-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.post-author-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 2px;
}

.post-author-name {
  font-size: 14px;
  font-weight: 600;
  color: #111;
}

.post-sub-line {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post-time {
  font-size: 12px;
  color: #9ca3af;
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}

.post-content {
  padding: 10px 16px;
  font-size: 15px;
  color: #374151;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-photo {
  width: 100%;
  display: block;
}

.post-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.post-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 12px;
  border-top: 1px solid #f3f4f6;
}

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

.post-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #6b7280;
  padding: 4px 0;
  transition: color 0.15s;
  line-height: 1;
}

.post-action-btn:hover {
  color: #374151;
}

.post-action-btn.liked {
  color: #ef4444;
}

.post-action-btn.liked:hover {
  color: #dc2626;
}

.post-action-btn span {
  font-size: 14px;
  color: inherit;
}

/* Skeleton loading */
@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton {
  background: linear-gradient(90deg, #f3f4f6 25%, #e5e7eb 50%, #f3f4f6 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

.skeleton-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.skeleton-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}

.skeleton-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.skeleton-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skeleton-line {
  height: 12px;
  border-radius: 4px;
}

.skeleton-line--short { width: 40%; }
.skeleton-line--medium { width: 70%; }
.skeleton-line--long { width: 100%; }

.skeleton-body {
  padding: 0 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.skeleton-photo {
  height: 200px;
  margin: 0 16px 14px;
  border-radius: 8px;
}

/* Load more button */
.btn-load-more {
  display: block;
  width: 100%;
  padding: 12px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-load-more:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-load-more:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Feed error / retry */
.feed-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: #6b7280;
  font-size: 14px;
  gap: 12px;
  text-align: center;
}

.btn-retry {
  padding: 8px 20px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-retry:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

/* ── Dashboard responsive ──────────────────────────────── */

@media (max-width: 1024px) {
  .template-grid { grid-template-columns: repeat(3, 1fr); }
  .main-content { padding: 32px 32px; }
}

@media (max-width: 768px) {
  /* Topbar */
  .topbar-logo { width: auto; }
  .topbar-search { display: none; }

  /* Main content */
  .main-content { padding: 24px 20px; }
  .main-welcome { font-size: clamp(22px, 6vw, 32px); margin-bottom: 20px; }

  /* Action row */
  .action-row { margin-bottom: 28px; }

  /* Template grid: 2 columns */
  .template-grid { grid-template-columns: repeat(2, 1fr); }

  /* Post feed: full width */
  .post-feed { max-width: 100%; }

  /* Section spacing */
  .section-mb { margin-bottom: 28px; }

  /* Modal responsive */
  .modal {
    max-width: 100%;
    margin: 12px;
    max-height: 95vh;
  }
  .modal-header { padding: 16px 16px 12px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px 16px; }
  .upload-preview img { max-height: 180px; }
}

/* ── Create Slide Modal ────────────────────────────────── */

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

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
}

.modal-overlay.open { display: flex; }

.modal {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.15);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  margin: 20px;
  animation: modalIn 0.2s ease-out;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid #f3f4f6;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.3px;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #6b7280;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover {
  background: #f3f4f6;
  color: #111;
}

.modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-textarea {
  width: 100%;
  min-height: 100px;
  max-height: 200px;
  resize: vertical;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  color: #111;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.modal-textarea::placeholder { color: #9ca3af; }

.modal-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.modal-char-count {
  text-align: right;
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.modal-char-count.warn { color: #f59e0b; }
.modal-char-count.over { color: #ef4444; font-weight: 600; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.upload-zone:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.upload-zone.dragover {
  border-color: #2563eb;
  background: #eff6ff;
}

.upload-zone-icon {
  color: #9ca3af;
  margin-bottom: 8px;
}

.upload-zone-text {
  font-size: 14px;
  color: #6b7280;
  line-height: 1.5;
}

.upload-zone-text strong {
  color: #2563eb;
  cursor: pointer;
}

.upload-zone-hint {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}

.upload-preview {
  position: relative;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  background: #f9fafb;
}

.upload-preview img {
  display: block;
  max-width: 100%;
  max-height: 240px;
  margin: 0 auto;
}

.upload-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.upload-preview-remove:hover { background: rgba(0,0,0,0.8); }

/* Location section */
.modal-location {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-location-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-detect-location {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-detect-location:hover {
  border-color: #9ca3af;
  background: #f9fafb;
}

.btn-detect-location:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.modal-location-label {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  color: #111;
  font-family: inherit;
}

.modal-location-label:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.modal-location-coords {
  font-size: 12px;
  color: #9ca3af;
}

.modal-location-manual {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-location-coord-input {
  flex: 1;
  padding: 8px 12px;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 13px;
  color: #111;
  font-family: inherit;
}

.modal-location-coord-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.modal-location-hint {
  font-size: 12px;
  color: #9ca3af;
}

.modal-location-hint a {
  color: #2563eb;
  text-decoration: none;
}

.modal-location-hint a:hover {
  text-decoration: underline;
}

/* Modal footer */
.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px 20px;
  border-top: 1px solid #f3f4f6;
}

.btn-cancel {
  padding: 9px 18px;
  background: #fff;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-cancel:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}

.btn-publish {
  padding: 9px 18px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-publish:hover { background: #333; }
.btn-publish:disabled { background: #9ca3af; cursor: not-allowed; }

/* Modal error */
.modal-error {
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 8px;
  font-size: 13px;
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #111;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 400;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Legacy / Dashboard styles ──────────────────────────── */

.container {
  max-width: 400px;
  margin: 50px auto;
  padding: 40px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
  margin-bottom: 20px;
  font-size: 28px;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.button {
  display: inline-block;
  padding: 12px 24px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
  color: #333;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.2s;
}

.button:hover {
  background: #f5f5f5;
}

.button-primary {
  background: #0066cc;
  color: white;
  border-color: #0066cc;
}

.button-primary:hover {
  background: #0052a3;
}

.button-google {
  background: #4285f4;
  color: white;
  border-color: #4285f4;
}

.button-google:hover {
  background: #357ae8;
}

.divider {
  text-align: center;
  margin: 20px 0;
  color: #999;
  position: relative;
}

.divider::before,
.divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: #ddd;
}

.divider::before {
  left: 0;
}

.divider::after {
  right: 0;
}

.text-center {
  text-align: center;
  margin-top: 20px;
}

.text-muted {
  color: #666;
  font-size: 14px;
}

.error {
  padding: 12px;
  background: #fee;
  color: #c33;
  border-radius: 4px;
  margin-bottom: 15px;
}

.hidden {
  display: none;
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid #eee;
}

.content {
  padding: 20px 0;
}

/* ── Admin page layout & sidebar ──────────────────────── */

.admin-page .main {
  padding: 40px 48px;
}

.admin-page .main-content {
  max-width: none;
  margin: 0;
}

.admin-page .layout {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.admin-page .sidebar {
  width: 220px;
  flex-shrink: 0;
  border-right: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 12px 0;
  background: #fff;
}

.admin-page .sidebar-section {
  padding: 0 8px;
  margin-bottom: 4px;
}

.admin-page .sidebar-section--spaced { margin-top: 8px; }

.admin-page .sidebar-label {
  font-size: 12px;
  font-weight: 600;
  color: #9ca3af;
  padding: 10px 8px 4px;
  letter-spacing: 0.02em;
}

.admin-page .sidebar-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: #374151;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
  font-weight: 500;
}

.admin-page .sidebar-item:hover { background: #f3f4f6; }

.admin-page .sidebar-item.active {
  background: #f3f4f6;
  color: #111;
  font-weight: 600;
}

.admin-page .sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  width: 3px;
  height: 24px;
  background: #111;
  border-radius: 0 2px 2px 0;
}

.admin-page .sidebar-item svg { flex-shrink: 0; color: #6b7280; }
.admin-page .sidebar-item.active svg { color: #111; }

/* ── Admin mobile tabs (hidden on desktop) ───────────── */

.admin-mobile-tabs {
  display: none;
  gap: 0;
  border-bottom: 1px solid #e5e7eb;
  margin: -24px -20px 24px;
  padding: 0;
  background: #fff;
}

.admin-mobile-tabs .admin-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 0;
  font-size: 14px;
  font-weight: 500;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.admin-mobile-tabs .admin-tab:hover { color: #374151; }

.admin-mobile-tabs .admin-tab.active {
  color: #111;
  font-weight: 600;
  border-bottom-color: #111;
}

.admin-mobile-tabs .admin-tab svg { flex-shrink: 0; }

/* ── Admin responsive ────────────────────────────────── */

@media (max-width: 1024px) {
  .admin-page .main { padding: 32px 32px; }
}

@media (max-width: 768px) {
  .admin-page .sidebar { display: none; }
  .admin-page .main { padding: 24px 20px; }
  .admin-mobile-tabs { display: flex; }
}
