/* ─────────────────────────────────────────────
   Content Bot SaaS — Design System
   ALL colours and spacing via CSS custom properties.
   To retheme: edit :root only.
   ───────────────────────────────────────────── */

/* ══ DESIGN TOKENS ══════════════════════════════════════════════════════════ */
:root {
  /* Brand */
  --accent:          #0f766e;
  --accent-hover:    #0d6560;
  --accent-light:    #f0fdfa;
  --accent-muted:    rgba(15,118,110,0.12);

  /* Surfaces */
  --bg:              #f9fafb;
  --surface:         #ffffff;
  --surface-2:       #f5f5f2;

  /* Borders */
  --border:          #e5e7eb;
  --border-mid:      #d1d5db;
  --border-focus:    #0f766e;

  /* Text */
  --text-1:          #111827;
  --text-2:          #6b7280;
  --text-3:          #9ca3af;

  /* Sidebar (dark) */
  --sidebar-bg:      #111827;
  --sidebar-active:  rgba(255,255,255,0.07);
  --sidebar-hover:   rgba(255,255,255,0.04);
  --sidebar-text:    rgba(255,255,255,0.75);
  --sidebar-text-active: #ffffff;
  --sidebar-border:  rgba(255,255,255,0.06);

  /* Semantic */
  --danger:          #dc2626;
  --danger-light:    #fef2f2;
  --danger-border:   #fecaca;
  --success:         #16a34a;
  --success-light:   #f0fdf4;
  --success-border:  #bbf7d0;
  --success-text:    #166534;
  --warning:         #d97706;
  --warning-light:   #fffbeb;

  /* Component-specific tokens */
  --danger-text-dark:  #f87171;   /* danger on dark sidebar */
  --danger-text-deep:  #991b1b;   /* deep red for score chip low */
  --thumb-gradient-end:#e0f2fe;   /* post thumbnail gradient tail */
  --telegram-bg:       #f0f4ff;   /* telegram card background */
  --telegram-border:   #c7d2f8;   /* telegram card border */

  /* Radii */
  --radius-sm:  6px;
  --radius:     8px;
  --radius-md:  10px;
  --radius-lg:  14px;
  --radius-xl:  18px;

  /* Shadows */
  --shadow-card: 0 0 0 1px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
  --shadow-sm:   0 1px 2px rgba(0,0,0,0.05);
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:   0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-lg:   0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04);

  /* Typography */
  --font:            -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-size-base:  13.5px;
  --font-size-sm:    12px;
  --font-size-xs:    11px;

  /* Layout */
  --sidebar-w:   228px;
  --topbar-h:    56px;
  --card-pad:    20px;
  --gap:         12px;
  --section-gap: 24px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  font-family: var(--font);
  font-size: var(--font-size-base);
  color: var(--text-1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;    /* prevent page-level horizontal scroll on mobile */
  max-width: 100%;
}

/* ══ APP SHELL ═══════════════════════════════════════════════════════════════ */
.app { display: flex; height: 100vh; overflow: hidden; max-width: 100%; }

/* ══ SIDEBAR (dark) ══════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  position: relative;
}
.sidebar::after {
  content: '';
  position: absolute;
  top: 0; right: 0;
  width: 1px; height: 100%;
  background: var(--sidebar-border);
}

/* Logo */
.sb-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.logo-icon {
  width: 28px; height: 28px;
  background: var(--accent);
  border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.logo-icon svg { display: block; }
.logo-wordmark { display: flex; flex-direction: column; }
.logo-name { font-size: 13.5px; font-weight: 700; color: #fff; letter-spacing: -0.01em; }
.logo-sub { font-size: 10px; color: rgba(255,255,255,0.35); font-weight: 400; letter-spacing: 0.02em; }

/* Nav */
.sb-nav { padding: 10px 0; flex: 1; }
.nav-group-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.25);
  padding: 14px 20px 6px;
  margin: 0;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 20px;
  margin: 1px 8px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 13.5px; font-weight: 450;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
  line-height: 1;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: var(--sidebar-text-active); font-weight: 500; }
.ni-icon { color: inherit; flex-shrink: 0; display: flex; opacity: 0.7; }
.nav-item.active .ni-icon { opacity: 1; }
.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 10px; line-height: 1.6;
}
.admin-tag {
  font-size: 9.5px; font-weight: 700;
  padding: 1px 5px;
  background: rgba(220,38,38,0.18);
  color: var(--danger-text-dark);
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-left: auto;
}

/* Plan widget */
.sb-plan {
  margin: 8px 12px 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 13px;
}
.sb-plan-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  color: rgba(255,255,255,0.35); margin-bottom: 5px;
}
.sb-plan-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 1px; }
.sb-plan-caption { font-size: 11.5px; color: rgba(255,255,255,0.4); margin-bottom: 9px; }
.mini-bar-wrap {
  height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 99px; overflow: hidden; margin-bottom: 10px;
}
.mini-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.5s ease; }
.btn-upgrade {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.85);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  text-decoration: none; transition: background 0.12s;
  font-family: inherit; border: none; cursor: pointer;
}
.btn-upgrade:hover { background: rgba(255,255,255,0.16); }

/* Sidebar user */
.sb-user {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px;
  border-top: 1px solid var(--sidebar-border);
  cursor: pointer;
  transition: background 0.12s;
}
.sb-user:hover { background: var(--sidebar-hover); }
.sb-avatar {
  width: 30px; height: 30px;
  background: linear-gradient(135deg, var(--accent) 0%, #0d9488 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff; flex-shrink: 0;
}
.sb-user-name { font-size: 12.5px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-email { font-size: 11px; color: rgba(255,255,255,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ══ MAIN AREA ═══════════════════════════════════════════════════════════════ */
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }

/* Legacy topbar (Dashboard page) */
.top-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 30px 0; flex-shrink: 0;
}
.page-heading { font-size: 20px; font-weight: 700; letter-spacing: -0.5px; color: var(--text-1); }
.top-bar-right { display: flex; align-items: center; gap: 10px; }
.top-date { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

/* New topbar (Posts / Account / Admin pages) */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; gap: 16px;
  flex-shrink: 0;
}
.topbar-left { display: flex; flex-direction: column; gap: 1px; }
.topbar-title { font-size: 14.5px; font-weight: 600; color: var(--text-1); letter-spacing: -0.01em; line-height: 1; }
.topbar-sub { font-size: 11.5px; color: var(--text-3); line-height: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* Breadcrumb */
.page-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 30px; border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0; gap: 12px;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-3); text-decoration: none; transition: color 0.1s; }
.breadcrumb a:hover { color: var(--text-1); }
.breadcrumb-sep { color: var(--border-mid); font-size: 12px; }
.breadcrumb-current { color: var(--text-1); font-weight: 600; }

/* Content area */
.content {
  flex: 1;
  padding: 20px 30px 48px;
  display: flex; flex-direction: column;
  gap: var(--section-gap);
  overflow-y: auto;
}

/* ══ ALERTS ══════════════════════════════════════════════════════════════════ */
.alert {
  padding: 11px 15px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 2px;
}
.alert-success {
  background: var(--success-light);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}
.alert-error {
  background: var(--danger-light);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.alert a { font-weight: 600; color: inherit; }

/* ══ CARDS ════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
}
.card-sm { padding: 16px 20px; }
/* Legacy card-head (Dashboard) */
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
/* New card-header (Posts/Account/Admin) */
.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: 13.5px; font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; }
.card-subtitle { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ══ FORM ELEMENTS ════════════════════════════════════════════════════════════ */
.field, .form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-row, .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row .form-group { flex: 1; grid-template-columns: unset; display: flex; flex-direction: column; gap: 5px; }
.label, label.label {
  font-size: var(--font-size-sm); font-weight: 500; color: var(--text-2);
  display: block; margin-bottom: 5px; letter-spacing: 0.01em;
}
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 500; margin-bottom: 14px; }

.select, .input, .textarea,
input[type=text], input[type=email], input[type=password], input[type=search], textarea, select {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--font-size-base); font-family: var(--font);
  color: var(--text-1);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
  width: 100%;
  line-height: 1.4;
}
.select, select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%239ca3af' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 30px; cursor: pointer;
}
.select:focus, .input:focus, .textarea:focus,
input[type=text]:focus, input[type=email]:focus, input[type=password]:focus, input[type=search]:focus, textarea:focus, select:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-muted);
  background: var(--surface);
}
.textarea, textarea { resize: vertical; line-height: 1.6; }

/* New field variants used in Account/Reset */
.field-readonly { background: var(--bg); color: var(--text-2); cursor: default; }
.field-textarea { min-height: 80px; resize: vertical; }
.field-lg { padding: 12px 14px; font-size: 15px; border-radius: var(--radius-md); }
.select-field {
  appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  padding-right: 30px; cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: var(--font-size-base); font-family: var(--font);
  color: var(--text-1); outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.select-field:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--accent-muted); }

.form-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 14px; gap: 12px; flex-wrap: wrap;
}
.form-hint { font-size: 11.5px; color: var(--text-3); line-height: 1.5; flex: 1; }

/* ══ BUTTONS ══════════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: var(--font-size-base); font-weight: 600; font-family: var(--font);
  cursor: pointer; border: 1px solid transparent;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn-primary { background: var(--text-1); color: #fff; border-color: var(--text-1); }
.btn-primary:hover { background: #374151; border-color: #374151; }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--text-1); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg); border-color: var(--border-mid); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { opacity: 0.88; }
.btn-sm { padding: 5px 11px; font-size: var(--font-size-sm); border-radius: var(--radius-sm); gap: 4px; }
.btn-lg { padding: 10px 20px; font-size: 14.5px; border-radius: var(--radius-md); }
.btn-xl { padding: 13px 28px; font-size: 15px; border-radius: var(--radius-md); font-weight: 600; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.w-full { width: 100%; }

.icon-btn {
  width: 29px; height: 29px; border-radius: var(--radius-sm);
  border: none; background: transparent; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); transition: background 0.1s, color 0.1s;
}
.icon-btn:hover { background: var(--bg); color: var(--text-1); }
.icon-btn.del:hover { background: var(--danger-light); color: var(--danger); }

/* ══ BADGES ══════════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; line-height: 1.5;
  white-space: nowrap;
}
.badge-instagram { background: #f3e8ff; color: #7c3aed; }
.badge-linkedin  { background: #dbeafe; color: #1d4ed8; }
.badge-x         { background: #f3f4f6; color: var(--text-1); border: 1px solid var(--border); }
.badge-green     { background: var(--success-light); color: var(--success); }
.badge-red       { background: var(--danger-light); color: var(--danger); }
.badge-teal      { background: var(--accent-light); color: var(--accent); }
.badge-gray      { background: #f3f4f6; color: var(--text-2); }
.badge-yellow    { background: var(--warning-light); color: var(--warning); }
.badge-pro       { background: var(--accent-light); color: var(--accent); border: 1px solid var(--accent-muted); }
.badge-starter   { background: #f3f4f6; color: var(--text-2); }
.badge-studio    { background: #faf5ff; color: #7c3aed; }
.badge-active    { background: var(--success-light); color: var(--success); }
.badge-inactive  { background: var(--danger-light); color: var(--danger); }

/* ══ SCORE CHIP ══════════════════════════════════════════════════════════════ */
.score-chip {
  display: inline-flex; align-items: center;
  font-size: 11.5px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0;
}
.score-chip.mid { background: var(--warning-light); color: #92400e; border-color: #fde68a; }
.score-chip.low { background: var(--danger-light); color: var(--danger-text-deep); border-color: var(--danger-border); }

/* ══ TABLE ════════════════════════════════════════════════════════════════════ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
table { width: 100%; border-collapse: collapse; }
thead tr { background: #fafafa; border-bottom: 1px solid var(--border); }
th {
  padding: 10px 14px;
  font-size: 11.5px; font-weight: 600;
  color: var(--text-3); text-align: left;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
}
td {
  padding: 12px 14px;
  font-size: var(--font-size-base);
  color: var(--text-1);
  vertical-align: middle;
  border-bottom: 1px solid #f3f4f6;
}
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fafafa; }

/* ══ PAGINATION ══════════════════════════════════════════════════════════════ */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
}
.page-info { font-size: 12.5px; color: var(--text-2); }
.page-btns { display: flex; gap: 4px; align-items: center; }
.page-btn {
  min-width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 500;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer; transition: all 0.12s;
  padding: 0 8px; font-family: var(--font);
}
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.page-btn.disabled { opacity: 0.4; cursor: default; }

/* ══ FILTER / SEARCH BAR ══════════════════════════════════════════════════════ */
.filter-bar { display: flex; align-items: center; gap: var(--gap); }
.search-wrap { position: relative; flex: 1; max-width: 280px; }
.search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.search-wrap input { padding-left: 32px; }

/* ══ PROGRESS / STRENGTH ══════════════════════════════════════════════════════ */
.progress-track {
  height: 6px; background: var(--border);
  border-radius: 10px; overflow: hidden; margin-top: 6px;
}
.progress-fill { height: 100%; background: var(--accent); border-radius: 10px; transition: width 0.3s; }
.progress-fill.danger { background: var(--danger); }

.strength-bar { display: flex; gap: 4px; margin-top: 6px; }
.strength-seg { flex: 1; height: 3px; border-radius: 2px; background: var(--border); }
.strength-seg.fill-weak   { background: var(--danger); }
.strength-seg.fill-fair   { background: var(--warning); }
.strength-seg.fill-strong { background: var(--success); }
.strength-label { font-size: 11px; color: var(--text-3); margin-top: 4px; }

/* ══ DIVIDER ══════════════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* ══ SPINNER ══════════════════════════════════════════════════════════════════ */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff; border-radius: 50%;
  animation: spin 0.65s linear infinite;
  vertical-align: middle;
}
.spinner-dark { border-color: rgba(0,0,0,.12); border-top-color: var(--text-1); }
.gen-hint { font-size: 12.5px; color: var(--text-3); margin-top: 10px; display: none; align-items: center; gap: 7px; }

/* ══ USAGE CARD ═══════════════════════════════════════════════════════════════ */
.usage-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.usage-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.usage-title { font-size: 16px; font-weight: 700; color: var(--text-1); margin-bottom: 2px; letter-spacing: -0.3px; }
.usage-sub { font-size: 12px; color: var(--text-3); margin-bottom: 12px; }
.usage-bar-wrap { height: 5px; background: var(--border); border-radius: 99px; overflow: hidden; margin-bottom: 7px; }
.usage-bar-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width 0.7s cubic-bezier(.4,0,.2,1); }
.usage-foot { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; }
.uf-count { font-weight: 700; color: var(--text-1); }
.uf-link { font-size: 11.5px; color: var(--accent); font-weight: 600; text-decoration: none; }
.uf-link:hover { text-decoration: underline; }

/* Dashboard stat boxes */
.stat-row { display: flex; gap: 10px; }
.stat-box {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 18px; min-width: 78px;
}
.stat-val { font-size: 24px; font-weight: 800; letter-spacing: -1.5px; color: var(--text-1); line-height: 1; }
.stat-key { font-size: 10px; color: var(--text-3); font-weight: 600; text-align: center; letter-spacing: 0.2px; line-height: 1.4; margin-top: 2px; }

/* Admin stats row */
.admin-stats-row { display: flex; gap: var(--gap); }

/* Admin stat boxes (different, wider) */
.stat-box-wide {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  flex: 1;
}
.stat-label { font-size: 11.5px; font-weight: 500; color: var(--text-3); letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 8px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text-1); letter-spacing: -0.03em; line-height: 1; margin-bottom: 4px; }
.stat-change { font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.stat-change .up { color: var(--success); font-weight: 500; }
.stat-change .down { color: var(--danger); font-weight: 500; }

/* ══ VOICE PROFILES ═══════════════════════════════════════════════════════════ */
.voice-list { display: flex; flex-direction: column; }
.voice-row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.voice-row:last-child { border-bottom: none; padding-bottom: 0; }
.voice-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.voice-body { flex: 1; min-width: 0; }
.voice-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.voice-tags { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.voice-actions { display: flex; gap: 1px; }

/* ══ POST LIST (Dashboard recent) ════════════════════════════════════════════ */
.post-list { display: flex; flex-direction: column; }
.post-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: opacity 0.1s; text-decoration: none; color: var(--text-1);
}
.post-row:hover { opacity: 0.75; }
.post-row:last-child { border-bottom: none; padding-bottom: 0; }
.post-thumb {
  width: 40px; height: 40px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--thumb-gradient-end) 100%);
  border: 1px solid var(--border);
}
.post-body { flex: 1; min-width: 0; }
.post-title {
  font-size: 13px; font-weight: 600; color: var(--text-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px;
}
.post-meta { font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 5px; }
.m-sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-mid); flex-shrink: 0; }
.status-done {
  font-size: 10.5px; font-weight: 700; padding: 2px 8px;
  border-radius: 99px; background: var(--success-light); color: var(--success); white-space: nowrap;
}

/* Post topic for table rows */
.post-topic {
  font-size: 13.5px; font-weight: 500; color: var(--text-1); margin-bottom: 2px;
  max-width: 280px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ══ 2-COL GRID ══════════════════════════════════════════════════════════════ */
.grid-2 { display: grid; grid-template-columns: 1fr 1.5fr; gap: 18px; align-items: start; }

/* ══ POST DETAIL ══════════════════════════════════════════════════════════════ */
.post-header { display: flex; flex-direction: column; gap: 10px; }
.post-topic-lg { font-size: 22px; font-weight: 800; color: var(--text-1); letter-spacing: -0.6px; line-height: 1.3; }
.post-meta-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; font-weight: 600; color: var(--text-2);
  background: var(--bg); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: 99px;
}
.meta-chip.accent { background: var(--accent-light); border-color: var(--accent-muted); color: var(--accent); }
.meta-chip.green { background: var(--success-light); border-color: var(--success-border); color: var(--success); }

.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; color: var(--text-3); }

/* ══ SLIDES GRID ══════════════════════════════════════════════════════════════ */
.slides-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.slide-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; transition: box-shadow 0.15s;
}
.slide-card:hover { box-shadow: var(--shadow-md); }
.slide-thumb {
  aspect-ratio: 1; position: relative;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer; background: var(--bg);
}
.slide-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-num-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,.45); backdrop-filter: blur(4px);
  color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 99px; z-index: 2; letter-spacing: 0.3px;
}
.slide-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0); transition: background 0.15s;
  z-index: 1; display: flex; align-items: center; justify-content: center;
}
.slide-card:hover .slide-overlay { background: rgba(0,0,0,.18); }
.slide-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 11px; background: var(--surface); border-top: 1px solid var(--border);
}
.slide-title-sm { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.dl-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  font-size: 11px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font); transition: all 0.1s;
  text-decoration: none; white-space: nowrap;
}
.dl-btn:hover { background: var(--text-1); color: #fff; border-color: var(--text-1); }

/* ══ HOOKS ════════════════════════════════════════════════════════════════════ */
.hook-list { display: flex; flex-direction: column; gap: 8px; }
.hook-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 13px;
}
.hook-num { font-size: 10.5px; font-weight: 800; color: var(--text-3); width: 18px; flex-shrink: 0; padding-top: 1px; }
.hook-text { flex: 1; font-size: 13px; color: var(--text-1); line-height: 1.55; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface);
  font-size: 11px; font-weight: 600; color: var(--text-3);
  cursor: pointer; font-family: var(--font); transition: all 0.1s; flex-shrink: 0;
}
.copy-btn:hover, .copy-btn.copied {
  background: var(--accent-light); color: var(--accent);
  border-color: var(--accent-muted);
}

/* ══ CAPTION ══════════════════════════════════════════════════════════════════ */
.caption-wrap {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
  font-size: 13.5px; color: var(--text-1); line-height: 1.7;
  margin-bottom: 12px; white-space: pre-wrap;
}
.caption-foot { display: flex; align-items: center; justify-content: flex-end; }

/* ══ HASHTAGS ═════════════════════════════════════════════════════════════════ */
.hashtag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.hashtag {
  display: inline-flex; align-items: center;
  padding: 4px 11px; background: var(--bg); border: 1px solid var(--border);
  border-radius: 99px; font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: default; transition: all 0.1s; user-select: none;
}
.hashtag:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent-muted); }
.hashtag-copy-all {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  cursor: pointer; font-family: var(--font); transition: all 0.1s;
}
.hashtag-copy-all:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent-muted); }

/* ══ BILLING / PLANS ══════════════════════════════════════════════════════════ */
.plans-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-top: 24px; }
.plan-card {
  background: var(--surface); border: 2px solid var(--border);
  border-radius: var(--radius-md); padding: 24px;
}
.plan-card.plan-current { border-color: var(--text-1); }
.plan-card.plan-featured { border-color: var(--accent); }
.plan-card h2 { font-size: 18px; margin-bottom: 6px; }
.plan-price { font-size: 28px; font-weight: 700; margin-bottom: 16px; }
.plan-price span { font-size: 14px; font-weight: 400; color: var(--text-3); }
.plan-card ul { list-style: none; margin-bottom: 20px; }
.plan-card ul li { font-size: 14px; padding: 4px 0; color: var(--text-3); }
.plan-card ul li::before { content: "✓ "; color: var(--success); }
.current-badge { font-size: 13px; color: var(--text-3); font-weight: 500; }

/* Account page — subscription/usage rows */
.usage-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.usage-val { font-size: 12.5px; font-weight: 600; color: var(--text-1); }
.plan-info-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.plan-period-info { font-size: 12.5px; color: var(--text-2); }
.renewal-info { font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.sub-actions { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.cancel-link { font-size: 12px; color: var(--danger); text-decoration: none; cursor: pointer; }
.cancel-link:hover { text-decoration: underline; }

/* Danger card */
.danger-card { border-color: var(--danger-border); background: var(--danger-light); }
.danger-card .card-title { color: var(--danger); }
.danger-warning { font-size: 12.5px; color: #7f1d1d; line-height: 1.55; margin-bottom: 16px; }

/* ══ WIZARD / ONBOARDING ══════════════════════════════════════════════════════ */
.wizard-wrap, .wizard { max-width: 540px; margin: 0 auto; }
.wizard-steps { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.wizard-title { font-size: 20px; font-weight: 700; margin-bottom: 20px; letter-spacing: -0.3px; }
.hint { font-size: 13px; color: var(--text-3); margin-bottom: 16px; }

.tone-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.tone-card {
  display: flex; flex-direction: column; padding: 14px 16px;
  border: 2px solid var(--border); border-radius: var(--radius-md); cursor: pointer;
}
.tone-card input { width: auto; margin-bottom: 4px; }
.tone-card strong { font-size: 14px; }
.tone-card span { font-size: 13px; color: var(--text-3); }
.tone-card:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }

.platform-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.platform-options label { flex-direction: row; align-items: center; gap: 10px; font-weight: 400; margin-bottom: 0; }
.platform-options input { width: auto; }

/* New onboarding shell (for redesigned onboarding) */
.onboarding-shell {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column;
}
.onboarding-topbar {
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px;
}
.step-progress { display: flex; align-items: center; gap: 6px; }
.step-dot { width: 28px; height: 5px; border-radius: 3px; background: var(--border); transition: background 0.2s; }
.step-dot.done { background: var(--accent); }
.step-dot.active { background: var(--accent); opacity: 0.6; }
.step-label { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* Chip selector (onboarding niche) */
.chips-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center;
  padding: 5px 11px; font-size: 12px; font-weight: 500;
  border-radius: 20px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text-2);
  cursor: pointer; transition: all 0.12s; white-space: nowrap;
}
.chip:hover, .chip.selected {
  border-color: var(--accent); background: var(--accent-light); color: var(--accent);
}

/* ══ TELEGRAM CARD ════════════════════════════════════════════════════════════ */
.telegram-card { background: var(--telegram-bg); border-color: var(--telegram-border); }

/* ══ FULLPAGE (404 / Verify / Reset) ══════════════════════════════════════════ */
.fullpage-center {
  min-height: 100vh; background: var(--bg);
  display: flex; flex-direction: column;
}
.fullpage-topbar {
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 32px;
}
.fullpage-topbar-logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.fullpage-topbar-logo-mark {
  width: 26px; height: 26px;
  background: var(--accent); border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.fullpage-topbar-logo-text { font-size: 13.5px; font-weight: 700; color: var(--text-1); }
.centered-content {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}

/* 404 */
.error-404-num {
  font-size: 110px; font-weight: 900;
  color: var(--border); line-height: 1; letter-spacing: -0.05em; margin-bottom: -8px;
}
.error-title { font-size: 22px; font-weight: 700; color: var(--text-1); letter-spacing: -0.02em; margin-bottom: 8px; }
.error-desc { font-size: 14px; color: var(--text-2); line-height: 1.6; margin-bottom: 28px; }

/* Verify */
.verify-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px 28px;
  text-align: center; box-shadow: var(--shadow-md);
  max-width: 380px; width: 100%;
}
.verify-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; margin: 0 auto 16px;
}
.verify-icon.success { background: var(--success-light); }
.verify-icon.error   { background: var(--danger-light); }
.verify-heading { font-size: 16px; font-weight: 700; color: var(--text-1); letter-spacing: -0.01em; margin-bottom: 6px; }
.verify-sub { font-size: 13px; color: var(--text-2); margin-bottom: 20px; line-height: 1.55; }
.verify-progress { height: 3px; background: var(--border); border-radius: 10px; overflow: hidden; margin-top: 14px; }
.verify-progress-fill {
  height: 100%; background: var(--accent); border-radius: 10px;
  width: 72%; animation: progress-grow 2s ease-out;
}
@keyframes progress-grow { from { width: 0; } to { width: 72%; } }
.verify-confirm { font-size: 12px; color: var(--text-3); margin-top: 8px; }

/* ══ RESET CARD ═══════════════════════════════════════════════════════════════ */
.reset-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-md); max-width: 400px; width: 100%;
}
.reset-logo { display: flex; justify-content: center; margin-bottom: 24px; }
.reset-logo-mark {
  width: 40px; height: 40px; background: var(--accent);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: #fff;
}
.reset-title { font-size: 20px; font-weight: 700; color: var(--text-1); letter-spacing: -0.02em; margin-bottom: 4px; text-align: center; }
.reset-sub { font-size: 13px; color: var(--text-2); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.back-link {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  font-size: 12.5px; color: var(--text-2); text-decoration: none;
  margin-top: 14px; cursor: pointer;
}
.back-link:hover { color: var(--text-1); }

/* ══ LANDING PAGE ══════════════════════════════════════════════════════════════ */
.landing-wrap { background: #0f172a; color: #f1f5f9; }
.landing-nav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 60px; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.landing-logo { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 700; color: #fff; text-decoration: none; }
.landing-logo-mark {
  width: 32px; height: 32px; background: var(--accent);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}
.landing-nav-links { display: flex; align-items: center; gap: 8px; }
.nav-link {
  font-size: 13.5px; color: rgba(255,255,255,0.6); text-decoration: none;
  padding: 6px 12px; border-radius: var(--radius); transition: color 0.12s, background 0.12s;
}
.nav-link:hover { color: #fff; background: rgba(255,255,255,0.05); }
.hero {
  text-align: center; padding: 72px 60px 64px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -80px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 400px;
  background: radial-gradient(ellipse, rgba(15,118,110,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: #5eead4; background: rgba(94,234,212,0.08); border: 1px solid rgba(94,234,212,0.2);
  padding: 4px 12px; border-radius: 20px; margin-bottom: 20px;
}
.hero-headline {
  font-size: 46px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.08;
  color: #f1f5f9; margin-bottom: 16px;
  max-width: 640px; margin-left: auto; margin-right: auto;
}
.hero-headline span { color: #5eead4; }
.hero-subtext {
  font-size: 16px; color: rgba(255,255,255,0.55);
  max-width: 520px; margin: 0 auto 32px; line-height: 1.65;
}
.hero-ctas { display: flex; align-items: center; justify-content: center; gap: 12px; }
.btn-landing-accent {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.15s; text-decoration: none;
}
.btn-landing-accent:hover { background: var(--accent-hover); }
.btn-landing-ghost {
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 14.5px; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background 0.15s; text-decoration: none;
}
.btn-landing-ghost:hover { background: rgba(255,255,255,0.09); }
.features-section {
  padding: 56px 60px; border-top: 1px solid rgba(255,255,255,0.06);
}
.features-label {
  text-align: center; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: rgba(255,255,255,0.3); margin-bottom: 32px;
}
.features-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; }
.feature-card {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--radius-lg); padding: 24px; transition: border-color 0.15s;
}
.feature-card:hover { border-color: rgba(15,118,110,0.35); }
.feature-icon {
  width: 40px; height: 40px; background: rgba(15,118,110,0.15);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 14px;
}
.feature-title { font-size: 14px; font-weight: 600; color: #f1f5f9; margin-bottom: 6px; }
.feature-desc { font-size: 13px; color: rgba(255,255,255,0.45); line-height: 1.55; }
.pricing-section { padding: 56px 60px; border-top: 1px solid rgba(255,255,255,0.06); }
.pricing-header { text-align: center; margin-bottom: 36px; }
.pricing-title { font-size: 30px; font-weight: 700; color: #f1f5f9; letter-spacing: -0.02em; margin-bottom: 8px; }
.pricing-sub { font-size: 14px; color: rgba(255,255,255,0.45); }
.pricing-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; align-items: start; }
.plan-dark {
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg); padding: 28px; position: relative;
}
.plan-dark.popular { border-color: var(--accent); background: rgba(15,118,110,0.06); }
.popular-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 600; padding: 3px 12px;
  border-radius: 20px; white-space: nowrap;
}
.plan-name { font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.6); margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.06em; }
.plan-price-dark { font-size: 34px; font-weight: 800; color: #f1f5f9; letter-spacing: -0.03em; margin-bottom: 2px; }
.plan-price-dark span { font-size: 14px; font-weight: 400; color: rgba(255,255,255,0.4); }
.plan-period-dark { font-size: 12px; color: rgba(255,255,255,0.3); margin-bottom: 20px; }
.plan-divider { height: 1px; background: rgba(255,255,255,0.08); margin: 18px 0; }
.plan-features-dark { list-style: none; margin-bottom: 24px; display: flex; flex-direction: column; gap: 9px; }
.plan-features-dark li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: rgba(255,255,255,0.6); }
.plan-features-dark li::before { content: '✓'; color: var(--accent); font-weight: 700; flex-shrink: 0; margin-top: 1px; }
.btn-plan {
  width: 100%; padding: 10px; border-radius: var(--radius);
  font-size: 13.5px; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05); color: rgba(255,255,255,0.8);
  transition: background 0.15s; text-align: center; font-family: var(--font);
}
.btn-plan:hover { background: rgba(255,255,255,0.09); }
.btn-plan.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-plan.accent:hover { background: var(--accent-hover); }
.landing-footer {
  padding: 24px 60px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: space-between;
}
.footer-copy { font-size: 12.5px; color: rgba(255,255,255,0.3); }
.footer-link { font-size: 12.5px; color: rgba(255,255,255,0.4); text-decoration: none; }
.footer-link:hover { color: rgba(255,255,255,0.7); }

/* ══ MOBILE BOTTOM NAV ════════════════════════════════════════════════════════ */
/* Hidden on desktop — enabled via @media below */
.mobile-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 58px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.mni {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; text-decoration: none; color: var(--text-3);
  font-size: 10px; font-weight: 500; line-height: 1;
  transition: color 0.12s;
  -webkit-tap-highlight-color: transparent;
}
.mni.active { color: var(--accent); }
.mni svg { transition: opacity 0.12s; }
.mni.active svg { opacity: 1 !important; }

/* ══ UTILITY ══════════════════════════════════════════════════════════════════ */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.text-sm { font-size: var(--font-size-sm); }
.text-xs { font-size: var(--font-size-xs); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.font-600 { font-weight: 600; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ══ RESPONSIVE ═══════════════════════════════════════════════════════════════ */

/* ── Tablet + Mobile (≤ 860px) ────────────────────────────── */
@media (max-width: 860px) {

  /* Hide desktop sidebar */
  .sidebar { display: none; }

  /* Prevent overflow bleed */
  .app, .main, .content { overflow-x: hidden; }

  /* Padding resets */
  .top-bar, .page-topbar { padding-left: 16px; padding-right: 16px; }
  .content { padding: 16px 16px 90px; }   /* 90px bottom clears the mobile nav */

  /* New topbar (Posts/Account/Admin) */
  .topbar { padding: 0 14px; gap: 8px; }
  .topbar-actions { gap: 6px; flex-wrap: wrap; }

  /* Onboarding & fullpage */
  .onboarding-topbar { padding: 0 16px; }
  .fullpage-topbar   { padding: 0 16px; }

  /* 2-col grids → single column */
  .grid-2                    { grid-template-columns: 1fr; }
  .usage-grid                { grid-template-columns: 1fr; }
  .plans-grid, .pricing-grid { grid-template-columns: 1fr; }
  .features-grid             { grid-template-columns: 1fr; }

  /* Slides → 2 col */
  .slides-grid { grid-template-columns: repeat(2, 1fr); }

  /* Stat boxes → wrap */
  .stat-row { flex-wrap: wrap; justify-content: flex-start; }
  .stat-box { min-width: 64px; }

  /* Admin stats: wrap into 2×2 grid on mobile */
  .admin-stats-row { flex-wrap: wrap; }
  .stat-box-wide { flex: 1 1 calc(50% - 8px); min-width: 120px; }

  /* Tables: horizontal scroll inside their container (no full-page bleed) */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table { min-width: 480px; }

  /* Post rows: 2-line title clamp instead of single-line cut-off */
  .post-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  /* Pagination: stack */
  .pagination { flex-direction: column; gap: 10px; align-items: center; padding: 14px 16px; }

  /* Landing page */
  .hero-headline { font-size: 30px; }
  .hero          { padding: 48px 20px 40px; }
  .hero-ctas     { flex-direction: column; align-items: stretch; max-width: 320px; margin: 0 auto; }
  .landing-nav-links { display: none; }
  .landing-nav, .features-section, .pricing-section, .landing-footer { padding-left: 20px; padding-right: 20px; }

  /* Post topic max-width (table column) */
  .post-topic { max-width: 180px; }

  /* Show mobile bottom nav */
  .mobile-nav { display: flex; }
}

/* ── Small phones (≤ 520px) ───────────────────────────────── */
@media (max-width: 520px) {

  /* Form rows → single column */
  .field-row, .form-row { grid-template-columns: 1fr; }

  /* Hide "Back" ghost button in topbar — saves space */
  .topbar-actions .btn-ghost { display: none; }

  /* Slides: keep 2 col */
  .slides-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tighter card padding */
  .card { padding: 16px 14px; }

  /* Topbar title/sub layout on narrow phones */
  .topbar-left { gap: 0; }
  .topbar-title { font-size: 13px; }

  /* Post topic even narrower */
  .post-topic { max-width: 130px; }

  /* Onboarding step card padding */
  .onboarding-topbar { gap: 8px; }
  .step-dot { width: 20px; }

  /* Post rows: hide "Done" badge — implicit at this size */
  .status-done { display: none; }
}

/* ══ GENERATE FORM — LIMIT REACHED STATE ════════════════════════════════════ */
.gen-card-locked {
  border-color: #fde68a;
  background: #fffdf5;
}
.gen-fields-locked select,
.gen-fields-locked textarea,
.gen-card-locked .textarea[disabled] {
  opacity: .45;
  pointer-events: none;
}
.gen-limit-banner {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 4px 0 14px;
}
.gen-btn-wrap {
  position: relative;
  display: inline-flex;
}
.gen-locked-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  white-space: nowrap;
  background: #1c1917;
  color: #fef3c7;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 11px;
  border-radius: 7px;
  pointer-events: none;
  z-index: 10;
}
.gen-locked-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 14px;
  border: 5px solid transparent;
  border-top-color: #1c1917;
}
.gen-btn-wrap:hover .gen-locked-tooltip {
  display: block;
}
