:root {
  /* Facebook-inspired palette — modern, friendly, FB-blue + warm whites */
  --fb-blue: #1877F2;
  --fb-blue-hover: #166FE5;
  --fb-blue-deep: #0866FF;
  --fb-light: #F0F2F5;
  --fb-card: #FFFFFF;
  --fb-text: #050505;
  --fb-text-2: #65676B;
  --fb-border: #CED0D4;

  /* Legacy honey vars kept as aliases pointing to the new blue scheme so
     every hard-coded reference still resolves consistently. */
  --honey: #1877F2;
  --honey-deep: #166FE5;
  --amber: #0866FF;
  --ink: #050505;
  --cream: #050505;
  --bg: #F0F2F5;
  --bg-soft: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-elev: #F7F8FA;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.14);
  --muted: rgba(5, 5, 5, 0.55);
  --muted-strong: rgba(5, 5, 5, 0.75);
  --success: #31A24C;
  --warning: #F7B928;
  --danger: #E41E3F;
  --info: #1877F2;
}

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

html, body {
  font-family: 'Noto Sans Thai', 'Noto Sans Lao', system-ui, sans-serif;
  background: var(--bg);
  color: var(--cream);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* === AUTH SCREEN === */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(circle at 20% 30%, rgba(255, 182, 39, 0.08), transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(230, 126, 34, 0.06), transparent 50%),
    var(--bg);
  position: relative;
}

.auth-screen::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52' viewBox='0 0 60 52'%3E%3Cpath d='M30 0L60 17.32V34.64L30 52L0 34.64V17.32L30 0z' fill='none' stroke='%23FFB627' stroke-width='0.5' opacity='0.1'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  opacity: 0.4;
  pointer-events: none;
}

.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 8px;
}

.auth-logo h1 {
  font-family: 'Fraunces', serif;
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  text-align: center;
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 15px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--muted-strong);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--cream);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.03);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.auth-error {
  color: var(--danger);
  font-size: 13px;
  margin-bottom: 16px;
  min-height: 18px;
}

.btn {
  padding: 12px 24px;
  border-radius: 100px;
  border: none;
  font-weight: 600;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(.2,.8,.2,1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary {
  background: var(--honey);
  color: var(--ink);
}

.btn-primary:hover:not(:disabled) {
  background: var(--cream);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(255, 182, 39, 0.3);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.05);
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.1);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 13px;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--honey);
  text-decoration: none;
  font-weight: 600;
  margin-left: 6px;
}

.demo-hint {
  margin-top: 24px;
  padding: 12px;
  background: rgba(255, 182, 39, 0.05);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  color: var(--muted-strong);
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
}

/* === APP LAYOUT === */
#app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--bg-soft);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 24px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--muted-strong);
  padding: 11px 14px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255, 182, 39, 0.05);
  color: var(--cream);
}

.nav-item.active {
  background: rgba(255, 182, 39, 0.1);
  color: var(--honey);
  font-weight: 500;
}

.sidebar-footer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  background: var(--honey);
  color: var(--ink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.user-details {
  min-width: 0;
  flex: 1;
}

.user-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-logout {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

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

.btn-lang {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-lang:hover {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.08);
}

.main-content {
  padding: 32px 40px;
  max-width: 1400px;
  width: 100%;
}

/* === VIEW HEADER === */
.view-header {
  margin-bottom: 32px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
}

.view-title {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.view-title .italic {
  font-style: italic;
  color: var(--honey);
}

.view-subtitle {
  color: var(--muted);
  font-size: 15px;
}

/* === CARDS === */
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
}

.card-title {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
}

.card-subtitle {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* === STATS GRID === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--honey), transparent);
  opacity: 0.5;
}

.stat-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 8px;
}

.stat-value {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-trend {
  font-size: 12px;
  color: var(--success);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.stat-trend.down { color: var(--danger); }

/* === GRID LAYOUTS === */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* === POSTS === */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.post-item {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  transition: all 0.2s;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: start;
}

.post-item:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}

.post-content {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}

.post-platforms {
  display: flex;
  gap: 4px;
}

.platform-badge {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
}

.platform-badge.facebook { background: #1877F2; }
.platform-badge.instagram { background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCAF45); }
.platform-badge.twitter { background: #000; }
.platform-badge.linkedin { background: #0A66C2; }
.platform-badge.tiktok { background: #000; }
.platform-badge.youtube { background: #FF0000; }

.status-badge {
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.draft { background: rgba(255, 255, 255, 0.1); color: var(--muted-strong); }
.status-badge.scheduled { background: rgba(96, 165, 250, 0.15); color: var(--info); }
.status-badge.published { background: rgba(74, 222, 128, 0.15); color: var(--success); }

.ai-tag {
  padding: 3px 8px;
  background: rgba(255, 182, 39, 0.15);
  color: var(--honey);
  border-radius: 6px;
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
}

.post-time {
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.post-actions {
  display: flex;
  gap: 6px;
  flex-direction: column;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--honey);
  color: var(--honey);
}

.icon-btn.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* === COMPOSER === */
.composer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 1000px) {
  .composer-grid { grid-template-columns: 1fr; }
}

.composer-form .form-group {
  margin-bottom: 18px;
}

.platform-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.platform-chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--muted-strong);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.platform-chip:hover {
  border-color: var(--line-strong);
}

.platform-chip.active {
  background: var(--honey);
  color: var(--ink);
  border-color: var(--honey);
  font-weight: 600;
}

.language-picker {
  display: flex;
  gap: 8px;
}

.lang-chip {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 13px;
}

.lang-chip.active {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.1);
  color: var(--honey);
}

.variants {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.variant {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px;
  transition: all 0.2s;
  cursor: pointer;
}

.variant:hover {
  border-color: var(--line-strong);
}

.variant.selected {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.03);
}

.variant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
}

.variant-content {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
}

.variant-hashtags {
  font-size: 13px;
  color: var(--honey);
  margin-bottom: 8px;
}

.variant-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  align-items: center;
  flex-wrap: wrap;
}

/* === EDITABLE AI VARIANTS — let users tweak caption before posting === */
textarea.variant-content-edit,
textarea.variant-hashtags-edit {
  display: block;
  width: 100%;
  font-family: inherit;
  background: var(--bg-soft, #fff);
  color: var(--fb-text, var(--cream, #050505));
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  resize: vertical;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
textarea.variant-content-edit {
  font-size: 14px;
  line-height: 1.6;
  min-height: 80px;
  white-space: pre-wrap;
}
textarea.variant-hashtags-edit {
  font-size: 13px;
  color: var(--fb-blue, var(--honey));
  min-height: 44px;
}
textarea.variant-content-edit:hover,
textarea.variant-hashtags-edit:hover {
  border-color: var(--fb-border, var(--line, rgba(0,0,0,0.12)));
}
textarea.variant-content-edit:focus,
textarea.variant-hashtags-edit:focus {
  outline: none;
  border-color: var(--fb-blue, var(--honey));
  background: var(--bg-soft, #fff);
  box-shadow: 0 0 0 3px rgba(24, 119, 242, 0.15);
}

.engagement-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 500;
}

.engagement-badge.high { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.engagement-badge.medium { background: rgba(255, 182, 39, 0.15); color: var(--honey); }
.engagement-badge.low { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* === COMPOSER — enhanced form === */
.topic-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-elev, rgba(0,0,0,0.04));
  border: 1px solid var(--line);
  border-radius: 100px;
  margin-bottom: 16px;
}

.topic-mode-btn {
  padding: 7px 18px;
  border: none;
  border-radius: 100px;
  background: transparent;
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.topic-mode-btn.active {
  background: var(--honey);
  color: var(--ink);
  font-weight: 600;
}

.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0;
}

/* === Settings — API keys / models / Meta === */
.settings-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.settings-row:last-of-type { border-bottom: none; }

.settings-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-row-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin: 4px 0 8px;
}

.cfg-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.cfg-badge.on { background: rgba(34, 160, 90, 0.15); color: #1f9d57; }
.cfg-badge.off { background: var(--line); color: var(--muted); }

.key-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.key-input-row input { flex: 1; }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted-strong);
}
.btn-ghost:hover { background: var(--line); }

.meta-guide {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
  background: var(--bg-soft, rgba(0,0,0,0.02));
}
.meta-guide summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
}
.meta-guide ol {
  margin: 12px 0 4px;
  padding-left: 20px;
}
.meta-guide li {
  font-size: 13px;
  margin-bottom: 8px;
  line-height: 1.6;
}
.meta-guide code {
  background: var(--line);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
  word-break: break-all;
}

/* === AI TOOLS === */
.aitools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1000px) {
  .aitools-grid { grid-template-columns: 1fr; }
}

.aitools-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.aitools-card-head .card-title { margin-bottom: 0; }

.aitools-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255, 182, 39, 0.12);
  color: var(--honey);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.aitools-result {
  margin-top: 14px;
}

.aitools-result:empty { display: none; }

.aitools-summary {
  font-size: 13px;
  color: var(--muted-strong);
  background: var(--bg-soft);
  border-left: 2px solid var(--honey);
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.aitools-list, .aitools-ideas {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.aitools-ideas { counter-reset: idea; padding-left: 0; }
.aitools-ideas li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  counter-increment: idea;
}
.aitools-ideas li::before {
  content: counter(idea);
  position: absolute;
  top: 10px;
  right: 12px;
  font-family: 'Fraunces', serif;
  font-size: 22px;
  color: var(--honey);
  opacity: 0.4;
  font-weight: 600;
}

.aitools-list li {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: auto auto auto;
  gap: 8px;
  align-items: baseline;
}

.aitools-list .aitools-reason {
  grid-column: 1 / -1;
  font-size: 12.5px;
  color: var(--muted-strong);
  margin-top: 4px;
}

.aitools-tag {
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 182, 39, 0.12);
  color: var(--honey);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.aitools-time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 600;
}

.aitools-platform {
  font-size: 12px;
  color: var(--muted);
  text-transform: capitalize;
}

.aitools-idea-head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 6px;
  padding-right: 28px;
}

.aitools-idea-head strong {
  font-size: 14px;
}

.aitools-ideas p {
  font-size: 13px;
  color: var(--muted-strong);
  line-height: 1.55;
}

.aitools-hashtags {
  font-size: 12px;
  color: var(--honey);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}

/* Vision drop zone */
.vision-drop {
  border: 2px dashed var(--line-strong);
  border-radius: 14px;
  padding: 28px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg-soft);
  margin-bottom: 12px;
}

.vision-drop:hover, .vision-drop.drag-over {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.04);
}

.vision-drop-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.vision-drop-inner strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.vision-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: 10px;
  margin-bottom: 8px;
}

.vision-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.vision-chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: transparent;
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.2s;
}

.vision-chip:hover { border-color: var(--line-strong); }

.vision-chip.active {
  background: var(--honey);
  color: var(--ink);
  border-color: var(--honey);
  font-weight: 600;
}

.vision-output { display: flex; flex-direction: column; gap: 14px; }

.vision-field strong {
  display: block;
  font-size: 12px;
  color: var(--honey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  font-family: 'JetBrains Mono', monospace;
}

.vision-field > div, .vision-field ul {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--cream);
}

.vision-field ul {
  padding-left: 18px;
  margin: 0;
}

.vision-field li { margin-bottom: 4px; }

.lang-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-option {
  flex: 1;
  min-width: 140px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.lang-option:hover {
  border-color: var(--line-strong);
}

.lang-option.active {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.1);
  color: var(--honey);
  font-weight: 600;
}

.section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--honey);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 20px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.section-label::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--honey);
}

.composer-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

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

.option-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.opt-check {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.opt-check:hover { border-color: var(--line-strong); }

.opt-check:has(input:checked) {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.08);
}

.image-options {
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 560px) {
  .style-grid { grid-template-columns: repeat(2, 1fr); }
}

.style-chip {
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--muted-strong);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.style-chip:hover { border-color: var(--line-strong); }

.style-chip.active {
  border-color: var(--honey);
  background: var(--honey);
  color: var(--ink);
  font-weight: 600;
}

.variant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.image-prompt-box {
  background: rgba(255, 182, 39, 0.06);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.image-prompt-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--honey);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.image-prompt-text {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted-strong);
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.image-headline {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 10px;
}

.image-prompt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.generated-image {
  display: block;
  width: 100%;
  border-radius: 10px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
}

.label-hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted);
  text-transform: none;
  margin-left: 6px;
}

.variant-platform {
  font-size: 12px;
  color: var(--muted-strong);
  margin-bottom: 8px;
}

.brand-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.brand-asset {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 10px;
  border: 2px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s;
}

.brand-asset:hover { border-color: var(--line-strong); }

.brand-asset.selected { border-color: var(--honey); }

.brand-asset img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-asset.selected::after {
  content: '✓';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--honey);
  color: var(--ink);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-asset-kind {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 9.5px;
  text-align: center;
  padding: 2px 0;
}

.brand-asset-del {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.brand-asset-del:hover { background: var(--danger); }

.brand-upload-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}

.empty-state svg {
  margin: 0 auto 16px;
  opacity: 0.3;
}

/* === CALENDAR === */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.calendar-nav {
  display: flex;
  gap: 8px;
  align-items: center;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
}

.cal-day-name {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  padding: 8px;
  letter-spacing: 0.05em;
}

.cal-day {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  min-height: 88px;
  position: relative;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-day:hover {
  border-color: var(--line-strong);
}

.cal-day.today {
  border-color: var(--honey);
  background: rgba(255, 182, 39, 0.05);
}

.cal-day.other-month {
  opacity: 0.3;
}

.cal-day-num {
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
  margin-bottom: 4px;
}

.cal-post {
  background: var(--bg-elev);
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
  border-left: 2px solid var(--info);
}

.cal-post.published { border-left-color: var(--success); }
.cal-post.draft { border-left-color: var(--muted); }

/* === PLATFORM PREVIEWS === */
.preview-section {
  margin-top: 24px;
}

.preview-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.preview-tab {
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 10px 16px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.preview-tab.active {
  color: var(--cream);
  border-bottom-color: var(--honey);
}

.preview-frame {
  background: white;
  color: #000;
  border-radius: 12px;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.preview-fb {
  padding: 12px 16px;
}

.preview-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.preview-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1877F2, #42A5F5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 18px;
}

.preview-author {
  font-weight: 600;
  font-size: 14px;
  color: #050505;
}

.preview-time {
  font-size: 12px;
  color: #65676B;
}

.preview-text {
  font-size: 15px;
  line-height: 1.4;
  color: #050505;
  white-space: pre-wrap;
  word-break: break-word;
}

.preview-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  margin-top: 12px;
  border-top: 1px solid #E4E6EB;
  color: #65676B;
  font-size: 13px;
  font-weight: 600;
}

.preview-actions span {
  padding: 6px 10px;
  flex: 1;
  text-align: center;
  border-radius: 6px;
}

.preview-ig {
  border: 1px solid #DBDBDB;
}

.preview-ig-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid #EFEFEF;
}

.preview-ig-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #833AB4, #FD1D1D, #FCAF45);
  padding: 2px;
}

.preview-ig-avatar > div {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
  font-weight: 700;
  font-size: 12px;
}

.preview-ig-name {
  font-weight: 600;
  font-size: 14px;
  color: #262626;
}

.preview-ig-image {
  background: linear-gradient(135deg, #FFB627, #E67E22);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
}

.preview-ig-actions {
  padding: 8px 12px;
  display: flex;
  gap: 12px;
  font-size: 22px;
}

.preview-ig-text {
  padding: 0 12px 12px;
  font-size: 14px;
  color: #262626;
  line-height: 1.4;
  white-space: pre-wrap;
}

.preview-ig-text strong {
  font-weight: 600;
  margin-right: 4px;
}

.preview-x {
  padding: 16px;
}

.preview-x-header {
  display: flex;
  gap: 10px;
}

.preview-x-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1A1410;
  color: var(--honey);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.preview-x-body {
  flex: 1;
}

.preview-x-meta {
  display: flex;
  gap: 4px;
  align-items: baseline;
  font-size: 14px;
  margin-bottom: 4px;
}

.preview-x-name {
  font-weight: 700;
  color: #0F1419;
}

.preview-x-handle {
  color: #536471;
}

.preview-x-text {
  font-size: 15px;
  line-height: 1.4;
  color: #0F1419;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.preview-x-actions {
  display: flex;
  justify-content: space-between;
  color: #536471;
  font-size: 13px;
}

/* === FORM EXTRAS === */
.compose-toolbar {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}

.char-count {
  margin-left: auto;
  font-family: 'JetBrains Mono', monospace;
}

.char-count.over {
  color: var(--danger);
}

/* === TOAST === */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--honey);
  padding: 12px 18px;
  border-radius: 10px;
  color: var(--cream);
  font-size: 14px;
  min-width: 260px;
  max-width: 400px;
  animation: toastIn 0.3s ease;
  pointer-events: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }

@keyframes toastIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === LOADING === */
.loading {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 182, 39, 0.3);
  border-top-color: var(--honey);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
  gap: 12px;
}

.loading-overlay .loading {
  width: 24px;
  height: 24px;
}

/* === ACCOUNTS === */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.account-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

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

.account-name {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-handle {
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

/* === RESPONSIVE — tablet === */
@media (max-width: 1100px) {
  .main-content { padding: 24px 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
}

/* === RESPONSIVE — mobile === */
@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    height: auto;
    flex-direction: row;
    padding: 6px 8px;
    z-index: 100;
    border-right: none;
    border-top: 1px solid var(--line);
    overflow: hidden;
  }
  .sidebar-logo, .sidebar-footer { display: none; }
  .sidebar-nav {
    flex-direction: row;
    gap: 2px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .nav-item {
    padding: 6px 10px;
    font-size: 10px;
    flex-direction: column;
    gap: 3px;
    min-width: 52px;
    text-align: center;
    border-radius: 8px;
  }
  .nav-item svg { flex-shrink: 0; }
  .main-content {
    padding: 16px;
    padding-bottom: 88px;
    max-width: 100%;
  }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .view-title { font-size: 26px; }
  .view-header { margin-bottom: 20px; gap: 12px; }
  .card { padding: 16px; }
  .composer-grid { grid-template-columns: 1fr; gap: 16px; }
  .composer-row { grid-template-columns: 1fr 1fr; }
  .calendar-grid { gap: 2px; padding: 8px; overflow-x: auto; }
  .cal-day { min-height: 52px; padding: 4px; font-size: 10px; }
  .accounts-grid { grid-template-columns: 1fr; }
  .post-item { grid-template-columns: 1fr; gap: 10px; }
  .post-actions { flex-direction: row; }
  .auth-card { padding: 28px 20px; border-radius: 16px; }
  .toast { min-width: auto; max-width: calc(100vw - 32px); }
  #toast-container { left: 16px; right: 16px; bottom: 16px; }
  .variant-actions { gap: 6px; }
  .btn { padding: 10px 18px; }
  .btn-sm { padding: 7px 12px; }
}

@media (max-width: 560px) {
  .composer-row { grid-template-columns: 1fr; }
  .style-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 28px; }
  .platform-picker { gap: 6px; }
  .platform-chip { padding: 7px 12px; font-size: 12px; }
}

/* === Modal === */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  animation: fadeIn .15s ease-out;
}
@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

/* === Tabs === */
.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-btn:hover { color: var(--text); }

/* === Check pill === */
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}
.check-pill:has(input:checked) {
  background: rgba(255, 184, 0, 0.12);
  border-color: var(--accent);
  color: var(--text);
}
.check-pill input {
  margin: 0;
  cursor: pointer;
}

/* === Badge === */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: rgb(74, 222, 128); }
.badge-warning { background: rgba(255, 184, 0, 0.15); color: var(--accent); }
.badge-muted { background: var(--bg-hover); color: var(--text-muted); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: rgb(248, 113, 113); }

/* === Button sizes & danger === */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: rgb(248, 113, 113);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* === Loading overlay === */
.loading-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 60px;
  color: var(--text-muted);
}

/* === LANDING + PRICING + BILLING + ADMIN === */
.auth-screen { align-items: flex-start; padding: 0; flex-direction: column; }
.landing-hero { width: 100%; padding: 24px 5vw 56px; max-width: 1200px; margin: 0 auto; }
.landing-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 56px; }
.landing-logo { display: flex; align-items: center; gap: 10px; font-size: 22px; color: var(--text); }
.landing-nav-actions { display: flex; gap: 20px; align-items: center; }
.landing-nav-actions a { color: var(--text-muted); text-decoration: none; }
.landing-nav-actions a:hover { color: var(--text); }
.landing-hero-content { text-align: center; padding: 40px 0 64px; }
.landing-hero-content h1 { font-size: clamp(2rem, 5vw, 3.5rem); line-height: 1.15; margin: 0 0 20px; }
.hero-accent { background: linear-gradient(135deg, #FFB627, #E67E22); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { font-size: 1.15rem; color: var(--text-muted); max-width: 640px; margin: 0 auto 32px; line-height: 1.6; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn-lg { padding: 14px 28px; font-size: 1.05rem; }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-outline { background: transparent; border: 1px solid var(--border, #2a3441); color: var(--text); }
.btn-outline:hover { background: var(--card-bg, rgba(255,255,255,0.04)); }
.btn-block { width: 100%; display: block; }

.landing-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin: 48px 0 80px; }
.landing-feature { background: var(--card-bg, rgba(255,255,255,0.03)); border: 1px solid var(--border, #2a3441); border-radius: 12px; padding: 24px; }
.feat-icon { font-size: 32px; margin-bottom: 12px; }
.landing-feature h3 { margin: 0 0 8px; font-size: 1.05rem; }
.landing-feature p { margin: 0; color: var(--text-muted); font-size: 0.92rem; line-height: 1.5; }

.landing-pricing { text-align: center; margin: 32px 0; }
.landing-pricing h2 { font-size: 2rem; margin-bottom: 8px; }
.pricing-sub { color: var(--text-muted); margin-bottom: 32px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; max-width: 1000px; margin: 0 auto; }
.pricing-card { background: var(--card-bg, rgba(255,255,255,0.03)); border: 1px solid var(--border, #2a3441); border-radius: 16px; padding: 28px 22px; text-align: left; transition: transform 0.15s, border-color 0.15s; }
.pricing-card:hover { transform: translateY(-3px); border-color: #FFB627; }
.pricing-highlight { border-color: #FFB627; box-shadow: 0 0 0 1px rgba(255,182,39,0.2), 0 8px 24px rgba(255,182,39,0.08); }
.pricing-head { margin-bottom: 20px; }
.pricing-head h3 { margin: 0 0 6px; font-size: 1.4rem; }
.pricing-price { color: var(--text); }
.price-num { font-size: 2rem; font-weight: 700; }
.price-unit { color: var(--text-muted); margin-left: 6px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 24px; }
.pricing-features li { padding: 8px 0; border-bottom: 1px dashed var(--border, #2a3441); font-size: 0.92rem; }
.pricing-features li:last-child { border-bottom: none; }
.feat-li.off { color: var(--text-muted); opacity: 0.55; }
.feat-li.on { color: var(--text); }

.auth-screen .auth-card { margin: 0 auto 48px; }

/* === SUBSCRIPTION VIEW === */
.sub-current { padding: 24px; margin-bottom: 24px; }
.sub-current-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; }
.sub-current-head h2 { margin: 4px 0 0; }
.sub-meta { text-align: right; font-size: 0.9rem; color: var(--text-muted); }
.sub-meta button { margin-top: 8px; }
.pending-payment { padding: 20px; border-left: 4px solid #FFB627; margin-bottom: 24px; }
.section-title { margin: 32px 0 16px; font-size: 1.2rem; }

/* === MODAL === */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal-box { background: var(--bg, #1a1f2e); border: 1px solid var(--border, #2a3441); border-radius: 16px; padding: 28px; max-width: 460px; width: 100%; max-height: 90vh; overflow-y: auto; }
.modal-box h2 { margin: 0 0 8px; }
.pay-methods { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.pay-methods button { text-align: left; line-height: 1.4; }
.pay-methods .small { font-size: 0.78rem; margin-top: 4px; opacity: 0.85; }
.qr-wrap { display: flex; justify-content: center; padding: 16px; background: #fff; border-radius: 12px; margin: 16px 0; min-height: 260px; }

/* === ADMIN VIEW === */
.admin-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border, #2a3441); margin-bottom: 24px; }
.admin-tab { background: none; border: none; padding: 12px 20px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; font-size: 0.95rem; }
.admin-tab.active { color: #FFB627; border-bottom-color: #FFB627; }
.admin-tab .badge { margin-left: 6px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--card-bg, rgba(255,255,255,0.03)); border: 1px solid var(--border, #2a3441); border-radius: 12px; padding: 20px; text-align: center; }
.stat-num { font-size: 1.8rem; font-weight: 700; color: #FFB627; }
.stat-label { color: var(--text-muted); font-size: 0.85rem; margin-top: 6px; }
.plan-dist { list-style: none; padding: 0; margin: 0; display: flex; gap: 24px; flex-wrap: wrap; }

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border, #2a3441); }
.data-table th { color: var(--text-muted); font-weight: 500; font-size: 0.85rem; }
.data-table tr.row-pending { background: rgba(255,182,39,0.05); }
.data-table .small { font-size: 0.78rem; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,0.08); font-size: 0.78rem; }
.badge-pending { background: rgba(255,182,39,0.18); color: #FFB627; }
.badge-paid { background: rgba(46,204,113,0.18); color: #2ecc71; }
.badge-rejected { background: rgba(231,76,60,0.18); color: #e74c3c; }
.badge-admin { background: rgba(155,89,182,0.18); color: #9b59b6; }
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.plan-select { padding: 4px 8px; background: var(--card-bg, rgba(255,255,255,0.05)); color: var(--text); border: 1px solid var(--border, #2a3441); border-radius: 6px; }

@media (max-width: 700px) {
  .landing-nav { flex-direction: column; gap: 12px; align-items: stretch; }
  .landing-nav-actions { justify-content: center; }
  .sub-current-head { flex-direction: column; align-items: flex-start; }
  .sub-meta { text-align: left; }
}

.usage-card { padding: 20px; }
.usage-row { margin: 10px 0; }
.usage-head { display: flex; justify-content: space-between; font-size: 0.9rem; margin-bottom: 4px; }
.usage-track { background: rgba(255,255,255,0.06); height: 6px; border-radius: 3px; overflow: hidden; }
.usage-fill { background: #2ecc71; height: 100%; transition: width 0.3s; }
.usage-fill.warn { background: #FFB627; }
.usage-fill.danger { background: #e74c3c; }
.data-table input[type=number], .data-table input[type=text] {
  padding: 4px 8px; background: var(--card-bg, rgba(255,255,255,0.05));
  border: 1px solid var(--border, #2a3441); border-radius: 6px; color: var(--text); font-size: 0.9rem;
}

/* === AUTH MODAL === */
.auth-modal { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.auth-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.72); backdrop-filter: blur(4px); }
.auth-modal .auth-card {
  position: relative; z-index: 1; max-width: 440px; width: 100%; max-height: 90vh; overflow-y: auto;
  animation: authIn 0.22s ease-out;
}
.auth-modal-close {
  position: absolute; top: 12px; right: 12px; background: transparent; border: none;
  color: var(--text-muted); font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 10px; border-radius: 8px;
}
.auth-modal-close:hover { background: rgba(255,255,255,0.06); color: var(--text); }
@keyframes authIn {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* === POSTS TOOLBAR (list + calendar tabs) === */
.posts-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-soft, rgba(255,255,255,0.04));
  border: 1px solid var(--line, #2a3441);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.view-mode-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: none; color: var(--text-muted);
  padding: 7px 14px; border-radius: 8px; font-size: 14px; cursor: pointer;
  transition: all 0.15s; font-family: inherit;
}
.view-mode-btn:hover { color: var(--text); }
.view-mode-btn.active {
  background: var(--honey, #FFB627);
  color: #1a1f2e;
  font-weight: 600;
}
.view-mode-btn svg { flex-shrink: 0; }
.posts-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.posts-toolbar .calendar-nav {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-soft, rgba(255,255,255,0.04));
  border: 1px solid var(--line, #2a3441);
  border-radius: 10px;
  padding: 3px 6px;
}
.cal-month-label {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 500;
  min-width: 140px;
  text-align: center;
}
.cal-day.has-posts { border-color: rgba(255,182,39,0.35); }
.cal-day-count {
  display: inline-flex;
  align-items: center; justify-content: center;
  background: var(--honey, #FFB627);
  color: #1a1f2e;
  font-size: 10px;
  font-weight: 700;
  border-radius: 10px;
  padding: 1px 6px;
  margin-left: 6px;
  font-family: inherit;
  min-width: 18px;
}
.cal-day-num { display: flex; align-items: center; justify-content: space-between; }
.cal-post { cursor: pointer; transition: transform 0.1s; }
.cal-post:hover { transform: translateX(2px); }
.cal-more {
  font-size: 10px;
  color: var(--text-muted);
  padding: 2px 6px;
  font-style: italic;
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
  .posts-toolbar { gap: 8px; }
  .cal-month-label { min-width: 110px; font-size: 15px; }
  .calendar-grid { gap: 4px; padding: 10px; }
  .cal-day { min-height: 72px; padding: 6px; }
  .cal-post { font-size: 9px; padding: 2px 4px; }
}
@media (max-width: 640px) {
  .posts-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .view-mode-toggle { width: 100%; }
  .view-mode-btn { flex: 1; justify-content: center; }
  .posts-filters { justify-content: flex-start; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .posts-filters .platform-chip { flex-shrink: 0; }
  .posts-toolbar .calendar-nav {
    display: flex;
    width: 100%;
    justify-content: space-between;
  }
  .cal-month-label { flex: 1; min-width: 0; }
  .calendar-grid { gap: 2px; padding: 6px; border-radius: 12px; }
  .cal-day-name { font-size: 9px; padding: 4px 2px; }
  .cal-day {
    min-height: 60px;
    padding: 4px 3px;
    border-radius: 6px;
    gap: 2px;
  }
  .cal-day-num { font-size: 11px; }
  .cal-day-count { font-size: 8px; padding: 0 4px; min-width: 14px; }
  .cal-post {
    font-size: 0;
    padding: 0;
    height: 4px;
    border-radius: 2px;
    border-left: none;
    background: var(--info);
  }
  .cal-post.published { background: var(--success); }
  .cal-post.draft { background: var(--muted); }
  .cal-post.scheduled { background: var(--honey, #FFB627); }
  .cal-more { font-size: 8px; padding: 0; }
}


.autosave-banner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  margin-bottom: 8px;
  background: rgba(255,182,39,0.08);
  border: 1px solid rgba(255,182,39,0.3);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.autosave-banner button {
  background: transparent;
  border: 1px solid var(--line, #2a3441);
  color: var(--text);
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.autosave-banner button:hover { border-color: var(--honey, #FFB627); }

/* === BULK SELECT === */
.bulk-bar {
  position: sticky;
  top: 12px;
  z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--honey, #FFB627);
  color: #1a1f2e;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(255,182,39,0.25);
  animation: bulkSlide 0.2s ease-out;
}
@keyframes bulkSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}
.bulk-bar strong { font-size: 16px; }
.bulk-bar-actions { display: flex; gap: 8px; align-items: center; }
.bulk-bar .btn-outline {
  background: rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.2);
  color: #1a1f2e;
}
.bulk-bar .btn-outline:hover { background: rgba(0,0,0,0.18); }
.bulk-bar .btn-outline.danger { border-color: rgba(180,30,30,0.3); }
.bulk-bar .btn-icon {
  background: rgba(0,0,0,0.1);
  border: none;
  width: 28px; height: 28px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  color: #1a1f2e;
}
.bulk-bar .btn-icon:hover { background: rgba(0,0,0,0.2); }

.post-list-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 4px 12px;
  font-size: 13px;
}
.post-select-all {
  display: inline-flex; align-items: center; gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
}
.post-select-all input { cursor: pointer; }

.post-item {
  grid-template-columns: auto 1fr auto !important;
}
.post-item .post-checkbox {
  align-self: start;
  width: 18px; height: 18px;
  margin-top: 2px;
  cursor: pointer;
  accent-color: var(--honey, #FFB627);
}
.post-item.selected {
  background: rgba(255,182,39,0.08);
  border-color: var(--honey, #FFB627);
}

@media (max-width: 640px) {
  .bulk-bar { flex-direction: column; gap: 8px; align-items: stretch; }
  .bulk-bar-actions { justify-content: flex-end; }
  .post-item { grid-template-columns: auto 1fr !important; }
  .post-item .post-actions { grid-column: 2 / -1; flex-direction: row; }
}

/* === ADMIN PAYMENT FILTERS + DRAWER === */
.payment-filters {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px;
  background: var(--bg-soft, rgba(255,255,255,0.03));
  border: 1px solid var(--line, #2a3441);
  border-radius: 10px;
  margin-bottom: 16px;
}
.payment-filters select, .payment-filters input {
  padding: 7px 10px;
  background: var(--bg-card, rgba(255,255,255,0.04));
  border: 1px solid var(--line, #2a3441);
  border-radius: 7px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}
.payment-filters .flex-grow { flex: 1; min-width: 160px; }
.payments-summary { padding: 8px 4px; text-align: right; }
.payments-table tr.selected { background: rgba(255,182,39,0.08); }
.payments-table tr.row-pending td { font-weight: 500; }

.drawer-overlay { position: fixed; inset: 0; z-index: 1300; display: flex; justify-content: flex-end; }
.drawer-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); backdrop-filter: blur(4px); }
.drawer-panel {
  position: relative; z-index: 1;
  width: min(560px, 96vw);
  height: 100vh;
  background: var(--bg-card, #1a1f2e);
  border-left: 1px solid var(--line, #2a3441);
  display: flex; flex-direction: column;
  animation: drawerIn 0.2s ease-out;
}
@keyframes drawerIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line, #2a3441);
}
.drawer-head h2 { margin: 0; font-size: 1.1rem; }
.drawer-body { padding: 20px; overflow-y: auto; flex: 1; }
.drawer-section { margin-bottom: 18px; }
.drawer-section textarea {
  width: 100%; box-sizing: border-box;
  background: var(--bg-soft, rgba(255,255,255,0.04));
  border: 1px solid var(--line, #2a3441); border-radius: 8px; padding: 8px 10px;
  color: var(--text); font-family: inherit; font-size: 13px; resize: vertical;
  margin: 6px 0;
}
.drawer-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line, #2a3441);
  margin-bottom: 14px;
}
.drawer-grid > div { font-size: 13px; }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.drawer-actions .danger { color: #e74c3c; border-color: rgba(231,76,60,0.4); }
.slip-thumb {
  display: block;
  border: 1px solid var(--line, #2a3441);
  border-radius: 10px;
  overflow: hidden;
  max-height: 320px;
  background: #000;
}
.slip-thumb img { width: 100%; height: auto; max-height: 320px; object-fit: contain; display: block; }

.user-history { list-style: none; padding: 0; margin: 0; }
.user-history li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line, #2a3441);
  font-size: 13px;
}
.user-history li:last-child { border-bottom: none; }

.kv-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line, #2a3441);
}
.kv-row:last-child { border-bottom: none; }
.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; }

@media (max-width: 700px) {
  .payment-filters select, .payment-filters input { flex: 1; min-width: 100px; font-size: 12px; }
  .drawer-grid { grid-template-columns: 1fr; }
}

.post-errors {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(231,76,60,0.08);
  border-left: 3px solid #e74c3c;
  border-radius: 6px;
  color: #e74c3c;
  font-size: 12px;
  line-height: 1.5;
}
.post-errors strong { color: #e74c3c; }
.cell-trunc { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-badge.publishing { background: rgba(255,182,39,0.18); color: #FFB627; }

/* ======================================================================
   ✨ UI POLISH LAYER — refines visual identity without breaking existing
   layouts. Loaded last so selectors win the cascade.
   ====================================================================== */

:root {
  --honey-grad: linear-gradient(135deg, #FFB627 0%, #F39C12 100%);
  --honey-soft: rgba(255, 182, 39, 0.08);
  --honey-glow: 0 8px 32px rgba(255, 182, 39, 0.18);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 16px rgba(0,0,0,0.35);
  --shadow-lift: 0 12px 32px rgba(0,0,0,0.5), 0 1px 0 rgba(255,182,39,0.08) inset;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Typography rhythm ---------- */
body { font-feature-settings: 'ss01', 'ss02'; letter-spacing: -0.005em; }
h1, h2, h3, .view-title { letter-spacing: -0.02em; }
.view-title { font-weight: 500; }
.view-subtitle { color: var(--muted); }

/* ---------- Custom scrollbar (subtle) ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(255,182,39,0.25) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(255,182,39,0.18);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(255,182,39,0.35); background-clip: padding-box; }

/* ---------- Body ambient background ---------- */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(800px 600px at 10% -10%, rgba(255,182,39,0.06), transparent 60%),
    radial-gradient(700px 500px at 95% 10%, rgba(230,126,34,0.04), transparent 55%);
}
#app, #auth-screen, #toast-container { position: relative; z-index: 1; }

/* ---------- Buttons — gradient primary + cleaner secondary ---------- */
.btn { font-weight: 500; letter-spacing: 0.005em; will-change: transform, box-shadow; }
.btn-primary {
  background: var(--honey-grad);
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset, 0 4px 14px rgba(255,182,39,0.25);
  border: none;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #FFC44A 0%, #FFAA1F 100%);
  transform: translateY(-1px);
  box-shadow: 0 1px 0 rgba(255,255,255,0.3) inset, 0 10px 28px rgba(255,182,39,0.35);
}
.btn-primary:active:not(:disabled) { transform: translateY(0); }
.btn-secondary:hover:not(:disabled),
.btn-outline:hover:not(:disabled) {
  border-color: var(--honey);
  background: var(--honey-soft);
}

/* ---------- Cards — glass + lift ---------- */
.card, .pricing-card, .stat-card, .landing-feature, .auth-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0) 60%),
    var(--bg-card);
  box-shadow: var(--shadow-card);
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), border-color 0.2s var(--ease);
}
.pricing-card:hover, .landing-feature:hover, .stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
  border-color: rgba(255,182,39,0.35);
}

/* "POPULAR" ribbon on the highlighted pricing card */
.pricing-highlight { position: relative; overflow: hidden; }
.pricing-highlight::before {
  content: 'แนะนำ';
  position: absolute; top: 14px; right: -34px;
  background: var(--honey-grad);
  color: var(--ink);
  font-size: 11px; font-weight: 700;
  padding: 4px 40px;
  transform: rotate(35deg);
  letter-spacing: 0.06em;
  box-shadow: 0 4px 12px rgba(255,182,39,0.4);
}
.pricing-card { border-radius: 18px; }
.price-num { background: var(--honey-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Stat cards — gradient border ---------- */
.stat-card {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0)),
    var(--bg-card);
  overflow: hidden;
}
.stat-card::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 0;
  height: 2px;
  background: var(--honey-grad);
  opacity: 0.7;
}
.stat-num {
  background: var(--honey-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 700;
}

/* ---------- Form inputs — better focus + filled look ---------- */
input, textarea, select {
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--honey) !important;
  box-shadow: 0 0 0 3px rgba(255,182,39,0.15);
}
.form-group label { font-weight: 500; color: var(--muted-strong); font-size: 13px; margin-bottom: 6px; display: block; }
.form-group input::placeholder, .form-group textarea::placeholder { color: rgba(255,248,236,0.3); }

/* ---------- Sidebar refinement ---------- */
.sidebar { background: linear-gradient(180deg, var(--bg-soft), var(--bg) 60%); }
.nav-item {
  position: relative;
  font-weight: 500;
  border-radius: 10px;
  margin: 1px 0;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), padding-left 0.15s var(--ease);
}
.nav-item:hover { background: var(--honey-soft); color: var(--cream); padding-left: 14px; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(255,182,39,0.18), rgba(255,182,39,0.04));
  color: var(--honey);
}
.nav-item.active::before {
  content: '';
  position: absolute; left: -10px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 2px;
  background: var(--honey-grad);
  box-shadow: 0 0 12px rgba(255,182,39,0.5);
}
.sidebar-logo { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }

.user-info { padding: 10px; background: var(--bg-card); border-radius: 12px; }
.user-avatar {
  background: var(--honey-grad);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(255,182,39,0.25);
}

/* ---------- Landing hero — animated ambient blobs ---------- */
.landing-hero { position: relative; }
.landing-hero::before, .landing-hero::after {
  content: ''; position: absolute; border-radius: 50%; pointer-events: none; z-index: -1;
  filter: blur(80px); opacity: 0.5;
}
.landing-hero::before {
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(255,182,39,0.35), transparent 70%);
  top: -80px; left: -120px;
  animation: float1 14s ease-in-out infinite;
}
.landing-hero::after {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(230,126,34,0.28), transparent 70%);
  top: 120px; right: -100px;
  animation: float2 18s ease-in-out infinite;
}
@keyframes float1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(40px, 30px); }
}
@keyframes float2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-30px, 40px); }
}

.landing-hero-content h1 { letter-spacing: -0.035em; font-weight: 600; }
.hero-sub { font-size: 1.2rem; max-width: 680px; }

/* Pricing section spacing */
.landing-pricing h2 { font-size: 2.25rem; letter-spacing: -0.025em; }

/* ---------- Landing features — soft icon plate ---------- */
.landing-feature { padding: 28px 22px; border-radius: 16px; }
.feat-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px;
  background: var(--honey-soft);
  border: 1px solid rgba(255,182,39,0.2);
  border-radius: 14px;
  font-size: 26px;
  margin-bottom: 14px;
}

/* ---------- Auth card — subtle gradient frame ---------- */
.auth-card {
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 1px 0 rgba(255,182,39,0.15) inset;
  background:
    radial-gradient(circle at top, rgba(255,182,39,0.06), transparent 60%),
    var(--bg-card);
}
.auth-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-logo h1 { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 500; }
.auth-subtitle { color: var(--muted); margin-bottom: 18px; }

/* ---------- Badges + status colors ---------- */
.badge {
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
}
.badge-paid { background: rgba(74,222,128,0.12); color: var(--success); border-color: rgba(74,222,128,0.25); }
.badge-pending { background: rgba(255,182,39,0.14); color: var(--honey); border-color: rgba(255,182,39,0.28); }
.badge-rejected { background: rgba(248,113,113,0.14); color: var(--danger); border-color: rgba(248,113,113,0.28); }
.badge-admin { background: rgba(167,139,250,0.14); color: #a78bfa; border-color: rgba(167,139,250,0.28); }
.status-badge { font-size: 10px; padding: 2px 8px; border-radius: 999px; text-transform: lowercase; font-weight: 600; letter-spacing: 0.05em; }
.status-badge.draft { background: rgba(255,248,236,0.08); color: var(--muted-strong); }
.status-badge.scheduled { background: rgba(96,165,250,0.14); color: var(--info); }
.status-badge.published { background: rgba(74,222,128,0.14); color: var(--success); }
.status-badge.failed { background: rgba(248,113,113,0.14); color: var(--danger); }
.status-badge.publishing { background: rgba(255,182,39,0.18); color: var(--honey); }

/* ---------- Tables — subtle zebra + sticky head ---------- */
.data-table thead th {
  position: sticky; top: 0;
  background: var(--bg-card);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}
.data-table tbody tr { transition: background 0.12s var(--ease); }
.data-table tbody tr:hover { background: var(--honey-soft); }
.data-table tbody td { border-bottom: 1px solid rgba(255,255,255,0.04); }

/* ---------- Post list refinement ---------- */
.post-item { border-radius: 14px; padding: 18px 20px; }
.post-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--honey); }
.post-content { font-size: 14.5px; line-height: 1.65; }
.ai-tag {
  background: var(--honey-soft);
  color: var(--honey);
  border: 1px solid rgba(255,182,39,0.25);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ---------- Platform chip pills ---------- */
.platform-chip {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s var(--ease);
}
.platform-chip.active {
  background: var(--honey-grad);
  color: var(--ink);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255,182,39,0.25);
}

/* ---------- Modals — better depth ---------- */
.modal-overlay { backdrop-filter: blur(8px); background: rgba(15,11,7,0.7); }
.modal-box {
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 1px 0 rgba(255,182,39,0.1) inset;
  background:
    linear-gradient(180deg, rgba(255,182,39,0.04), transparent 30%),
    var(--bg-card);
}

/* ---------- View mount transition ---------- */
#view-container > * {
  animation: viewIn 0.3s var(--ease);
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Empty state — gentler ---------- */
.empty-state {
  padding: 56px 24px;
  color: var(--muted);
  text-align: center;
}
.empty-state svg { opacity: 0.4; margin-bottom: 12px; }

/* ---------- Toast — refined ---------- */
.toast {
  border-radius: 12px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  padding: 12px 16px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }

/* ---------- Loading spinner — nicer ---------- */
.loading {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,182,39,0.2);
  border-top-color: var(--honey);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Landing nav blur on scroll ---------- */
.landing-nav {
  position: sticky; top: 0; z-index: 10;
  padding: 12px 0;
  backdrop-filter: blur(12px);
  background: rgba(15,11,7,0.6);
  margin: -24px -5vw 56px;
  padding: 16px 5vw;
  border-bottom: 1px solid var(--line);
}

/* ---------- Selected post highlight ---------- */
.post-item.selected {
  background: linear-gradient(90deg, rgba(255,182,39,0.12), rgba(255,182,39,0.02));
  border-color: var(--honey);
  box-shadow: 0 0 0 1px rgba(255,182,39,0.25);
}

/* ---------- Reduce motion for users who prefer it ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Mobile polish ---------- */
@media (max-width: 700px) {
  .auth-card { padding: 28px 22px; border-radius: 18px; }
  .landing-hero-content h1 { font-size: clamp(1.8rem, 9vw, 2.4rem); }
  .hero-sub { font-size: 1rem; }
  .landing-pricing h2 { font-size: 1.6rem; }
  .pricing-card { padding: 22px 18px; }
  .price-num { font-size: 1.7rem; }
}

/* ======================================================================
   📱 MOBILE — hamburger drawer, full-screen modals, card-style tables.
   Overrides earlier @media rules; loaded last.
   ====================================================================== */

.mobile-topbar { display: none; }
.sidebar-scrim { display: none; }

/* Mobile breakpoint */
@media (max-width: 900px) {
  /* App turns into a single column with a top bar */
  #app { grid-template-columns: 1fr; }

  /* === Top bar === */
  .mobile-topbar {
    display: flex; align-items: center; gap: 12px;
    position: sticky; top: 0; z-index: 60;
    padding: 12px 16px;
    padding-top: max(12px, env(safe-area-inset-top));
    background: rgba(15,11,7,0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
  }
  .mobile-menu-btn {
    background: transparent; border: none; color: var(--cream);
    width: 40px; height: 40px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.15s;
  }
  .mobile-menu-btn:hover, .mobile-menu-btn:focus { background: var(--honey-soft); outline: none; }
  .mobile-topbar-logo {
    display: flex; align-items: center; gap: 8px;
    font-family: 'Fraunces', serif; font-weight: 500; font-size: 17px;
  }
  .mobile-topbar-spacer { flex: 1; }

  /* === Sidebar becomes a slide-in drawer === */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: 80vw; max-width: 320px;
    height: 100vh;
    flex-direction: column;
    padding: 18px 14px;
    padding-top: max(18px, env(safe-area-inset-top));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    z-index: 200;
    border-right: 1px solid var(--line);
    border-top: none;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.28s var(--ease);
    box-shadow: 8px 0 32px rgba(0,0,0,0.5);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  /* Show logo + footer inside the drawer */
  .sidebar-logo, .sidebar-footer { display: flex; }
  .sidebar-nav {
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow-x: visible;
    overflow-y: auto;
  }
  .nav-item {
    padding: 12px 14px;
    font-size: 14px;
    flex-direction: row;
    gap: 12px;
    min-width: auto;
    text-align: left;
    justify-content: flex-start;
    border-radius: 10px;
  }
  .nav-item.active::before {
    left: -14px; top: 8px; bottom: 8px; right: auto;
    width: 3px; height: auto;
  }

  /* Backdrop */
  .sidebar-scrim {
    display: block;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(4px);
    z-index: 150;
    opacity: 0; pointer-events: none;
    transition: opacity 0.25s;
  }
  body.nav-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  body.nav-open { overflow: hidden; }

  /* Main content takes full width */
  .main-content {
    padding: 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    max-width: 100%;
  }

  /* Headings + spacing */
  .view-header { margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
  .view-title { font-size: 22px; }
  .view-subtitle { font-size: 13px; }
  .section-title { font-size: 1rem; margin: 20px 0 12px; }

  /* Cards */
  .card { padding: 14px; border-radius: 12px; }

  /* Grids → 1 column on mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .composer-grid { grid-template-columns: 1fr; gap: 14px; }
  .composer-row { grid-template-columns: 1fr; }
  .accounts-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }

  /* Buttons */
  .btn { padding: 10px 16px; font-size: 14px; min-height: 44px; }
  .btn-sm { padding: 7px 12px; font-size: 12px; min-height: 36px; }
  .btn-lg { padding: 12px 22px; font-size: 15px; }

  /* Touch targets */
  .icon-btn, .platform-chip, .view-mode-btn, button {
    min-height: 36px;
  }
  .icon-btn { width: 36px; height: 36px; }

  /* === Posts list mobile === */
  .post-item { grid-template-columns: auto 1fr !important; gap: 10px; padding: 14px; }
  .post-item .post-actions {
    grid-column: 1 / -1;
    flex-direction: row;
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--line);
    margin-top: 4px;
  }
  .post-content { font-size: 14px; line-height: 1.55; }
  .post-meta { flex-wrap: wrap; gap: 6px 10px; font-size: 12px; }

  /* === Modals → full-screen sheets === */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box {
    max-width: 100%; width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    animation: sheetUp 0.25s var(--ease);
  }
  @keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
  /* Pull handle */
  .modal-box::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: rgba(255,248,236,0.2);
    border-radius: 2px;
    margin: -8px auto 14px;
  }

  /* === Auth modal — keep centered === */
  .auth-modal { padding: 16px; }
  .auth-modal .auth-card { max-height: 88vh; padding: 24px 20px; }

  /* === Admin drawer → bottom sheet on mobile === */
  .drawer-panel {
    width: 100% !important;
    max-width: 100%;
    height: 92vh; top: auto; bottom: 0;
    border-left: none;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    animation: sheetUp 0.25s var(--ease);
  }
  .drawer-overlay { align-items: flex-end; }
  .drawer-grid { grid-template-columns: 1fr; gap: 12px; }
  .drawer-actions { flex-direction: column; align-items: stretch; }
  .drawer-actions .btn { width: 100%; }

  /* === Admin tables → card stacks === */
  .data-table {
    display: block;
    border-collapse: separate;
  }
  .data-table thead { display: none; }
  .data-table tbody { display: block; }
  .data-table tr {
    display: block;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .data-table tr.row-pending { border-color: rgba(255,182,39,0.35); }
  .data-table td {
    display: flex; justify-content: space-between; align-items: center;
    padding: 6px 0;
    border: none !important;
    text-align: right;
    gap: 12px;
    min-height: 28px;
  }
  .data-table td::before {
    content: attr(data-label);
    text-transform: uppercase;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.06em;
    font-weight: 600;
    text-align: left;
    flex-shrink: 0;
  }
  .data-table tbody tr:hover { background: var(--bg-card); }
  .cell-trunc { max-width: 60vw; }

  /* === Filters bar → wrap === */
  .payment-filters {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }
  .payment-filters select, .payment-filters input { width: 100%; min-width: 0; }
  .payment-filters .flex-grow { flex: none; width: 100%; }

  /* === Bulk action bar (posts + payments) === */
  .bulk-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    border-radius: 12px;
    margin: 0 -4px 14px;
    top: 0;
  }
  .bulk-bar-actions { justify-content: flex-end; }

  /* === Landing — refined mobile === */
  .landing-nav {
    margin: -16px -5vw 32px;
    padding: 12px 5vw;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .landing-nav-actions { gap: 6px; }
  .landing-nav-actions a:not(.btn) { display: none; }
  .landing-hero { padding: 16px 5vw 48px; }
  .landing-hero-content { padding: 24px 0 40px; }
  .landing-hero-content h1 { font-size: clamp(1.9rem, 8vw, 2.5rem); }
  .hero-sub { font-size: 1rem; padding: 0 4px; }
  .hero-cta { flex-direction: column; gap: 10px; }
  .hero-cta .btn { width: 100%; }
  .landing-features { grid-template-columns: 1fr; gap: 12px; margin: 32px 0 56px; }
  .landing-feature { padding: 20px 18px; }
  .pricing-card { padding: 24px 18px; }
  .pricing-highlight::before { font-size: 10px; padding: 3px 32px; top: 12px; right: -28px; }

  /* === Composer mobile === */
  .platform-picker { flex-wrap: wrap; gap: 6px; }
  .style-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .field-hint { font-size: 11px; }

  /* === Subscription cards === */
  .sub-current-head { flex-direction: column; align-items: stretch; gap: 12px; }
  .sub-meta { text-align: left; }

  /* === Settings header CTA button stacks below title === */
  .view-header .btn { width: 100%; margin-top: 4px; }
  .view-header { flex-direction: column; align-items: stretch; }

  /* === Calendar mobile (already styled, refine) === */
  .calendar-grid { gap: 3px; padding: 8px; }
  .cal-day { min-height: 58px; padding: 4px; font-size: 10px; }
  .cal-day-name { font-size: 10px; padding: 4px 2px; }
  .posts-toolbar { gap: 8px; }

  /* === Toast positioned above safe area === */
  #toast-container {
    left: 12px; right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
  }
  .toast { min-width: auto; max-width: 100%; font-size: 13px; }

  /* === Form inputs grow to full width === */
  .form-group input, .form-group textarea, .form-group select { font-size: 16px; }
  /* (font-size:16px prevents iOS auto-zoom on focus) */
}

/* Even narrower phones */
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .view-title { font-size: 20px; }
  .auth-card { padding: 22px 18px; }
  .auth-logo h1 { font-size: 24px; }
  .nav-item { padding: 11px 12px; font-size: 13px; }
  .pricing-card { padding: 20px 16px; }
  .price-num { font-size: 1.6rem; }
  .landing-features { margin: 24px 0 40px; }
  .data-table tr { padding: 10px 12px; }
}

/* Landscape phones — adjust hero spacing */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .landing-hero-content { padding: 16px 0 24px; }
  .landing-hero-content h1 { font-size: 1.8rem; }
  .hero-sub { font-size: 0.95rem; margin-bottom: 16px; }
}

/* ======================================================================
   ✦ FINAL POLISH — skeletons, focus-visible, safe-area, install hints
   ====================================================================== */

/* === Skeleton shimmer (use class="skeleton" on any element while loading) === */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elev) 0%, rgba(255,182,39,0.06) 50%, var(--bg-elev) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === Better :focus-visible for keyboard users (not click) === */
*:focus { outline: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--honey);
  outline-offset: 2px;
  border-radius: 6px;
}

/* === Safe area at page edges === */
.auth-screen, #app, .main-content {
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

/* === Forgot password link === */
#forgot-row { text-align: center; margin-top: 4px; font-size: 13px; }
#forgot-row a { color: var(--muted); text-decoration: none; }
#forgot-row a:hover { color: var(--honey); text-decoration: underline; }

/* === Standalone (installed PWA) tweaks === */
@media (display-mode: standalone) {
  .landing-nav { padding-top: max(16px, env(safe-area-inset-top)); }
  .mobile-topbar { padding-top: max(16px, env(safe-area-inset-top)); }
}

/* === Selection color === */
::selection { background: rgba(255, 182, 39, 0.35); color: var(--cream); }

/* === Smooth image loading === */
img { transition: opacity 0.3s; }
img[loading="lazy"] { opacity: 0; }
img[loading="lazy"].loaded, img:not([loading="lazy"]) { opacity: 1; }

/* === Slip thumbnail uses lazy === */
.slip-thumb img { background: #000; }

/* === Disabled buttons softer === */
.btn:disabled, button:disabled { cursor: not-allowed; opacity: 0.55; transform: none !important; box-shadow: none !important; }

/* === Required-field asterisk === */
.form-group label .req { color: var(--danger); margin-left: 3px; }

/* === Google Sign-In === */
.google-signin-wrap { margin-bottom: 16px; }
#google-btn-container {
  display: flex;
  justify-content: center;
  min-height: 44px;
}
#google-btn-container > div { width: 100% !important; max-width: 100%; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 14px 0 4px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* === MARKETING SUITE === */
.mkt-section { margin-bottom: 28px; }

/* Top performers cards */
.top-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.top-card {
  display: grid; grid-template-columns: 56px 1fr; gap: 14px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0) 60%), var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.top-card:hover { transform: translateY(-2px); border-color: var(--honey); }
.top-rank {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 600;
  background: var(--honey-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  align-self: start;
  text-align: center;
}
.top-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.top-content { font-size: 14px; line-height: 1.6; }
.top-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted-strong); }
.top-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }

/* Hashtag library */
.ht-out-box {
  margin-top: 10px; padding: 12px;
  background: rgba(255,182,39,0.05);
  border: 1px dashed rgba(255,182,39,0.3);
  border-radius: 10px;
}
.ht-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ht-pill {
  display: inline-block; padding: 4px 10px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12px;
  color: var(--honey);
  font-family: 'JetBrains Mono', monospace;
}
.ht-card {
  padding: 14px 16px; margin-bottom: 10px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
}
.ht-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ht-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ht-tags-inline .ht-pill { font-size: 11px; padding: 2px 8px; }

/* Templates */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.tpl-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
  min-height: 180px;
}
.tpl-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tpl-body { flex: 1; font-size: 13px; line-height: 1.6; color: var(--muted-strong); white-space: pre-wrap; }
.tpl-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }

/* UTM result */
.utm-out { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: rgba(0,0,0,0.2); border-radius: 10px; }
.utm-row { display: flex; align-items: center; gap: 10px; }
.utm-row code { flex: 1; font-family: 'JetBrains Mono', monospace; font-size: 12px; word-break: break-all; padding: 6px 10px; background: var(--bg-card); border-radius: 6px; }

/* A/B testing */
.ab-card {
  padding: 16px; margin-bottom: 12px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 14px;
}
.ab-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ab-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.ab-variant {
  padding: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.ab-variant.winner { border-color: var(--success); background: rgba(74,222,128,0.05); }
.ab-label { font-size: 10px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.ab-content { font-size: 13px; line-height: 1.5; flex: 1; }
.ab-score { font-size: 16px; font-weight: 600; color: var(--honey); font-family: 'JetBrains Mono', monospace; }
.ab-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }

@media (max-width: 700px) {
  .ab-grid { grid-template-columns: 1fr; }
  .top-card { grid-template-columns: 44px 1fr; padding: 12px; }
  .top-rank { font-size: 22px; }
  .tpl-grid { grid-template-columns: 1fr; }
}

/* === Content check (real-time on composer) === */
.cc-box { margin: 12px 0; padding: 12px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; }
.cc-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.cc-score { font-size: 28px; font-weight: 700; font-family: 'JetBrains Mono', monospace; }
.cc-score span { font-size: 14px; opacity: 0.5; margin-left: 2px; }
.cc-stats { display: flex; gap: 12px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.cc-issues { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.cc-issue { padding: 3px 10px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 500; background: rgba(0,0,0,0.15); }
.cc-warn { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.cc-tips { list-style: '💡 '; padding-left: 18px; font-size: 12px; color: var(--muted-strong); }
.cc-tips li { padding: 2px 0; }

/* AI prediction dialog */
.predict-overall {
  font-size: 64px; font-weight: 700; text-align: center; line-height: 1;
  font-family: 'JetBrains Mono', monospace;
  margin: 8px 0 4px;
}
.predict-overall span { font-size: 20px; opacity: 0.5; }
.predict-bars { display: flex; flex-direction: column; gap: 10px; padding: 12px 0; }
.predict-bar-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 4px; text-transform: capitalize; }
.predict-bar-track { background: rgba(255,255,255,0.06); height: 6px; border-radius: 3px; overflow: hidden; }
.predict-bar-fill { background: var(--honey-grad); height: 100%; transition: width 0.3s; }
.predict-improved {
  padding: 10px 12px;
  background: rgba(255,182,39,0.06);
  border: 1px dashed rgba(255,182,39,0.3);
  border-radius: 8px;
  font-size: 13px; line-height: 1.6;
  white-space: pre-wrap;
}

/* Content plan grid */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.plan-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--line);
  border-left: 4px solid #666;
  border-radius: 10px;
}
.plan-day { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.plan-type { font-size: 12px; text-transform: capitalize; }
.plan-title { font-size: 15px; font-weight: 600; line-height: 1.4; margin: 2px 0; }
.plan-idea { font-size: 13px; color: var(--muted-strong); line-height: 1.5; }
.plan-hook, .plan-cta { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 4px; }
.plan-use { margin-top: 8px; }

/* Saved replies */
.rep-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.rep-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px;
  background: var(--bg-card); border: 1px solid var(--line); border-radius: 12px;
}
.rep-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; }
.rep-shortcut {
  background: var(--honey-soft); color: var(--honey);
  padding: 2px 8px; border-radius: 6px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px;
}
.rep-body { font-size: 13px; line-height: 1.6; white-space: pre-wrap; flex: 1; }
.rep-foot { display: flex; gap: 6px; align-items: center; padding-top: 8px; border-top: 1px solid var(--line); }

.m-content-check { margin-top: 8px; }

@media (max-width: 700px) {
  .plan-grid, .rep-grid { grid-template-columns: 1fr; }
  .predict-overall { font-size: 48px; }
}

/* ======================================================================
   📘 FACEBOOK-STYLE LIGHT THEME — overrides loaded last, wins the cascade
   ====================================================================== */

:root {
  --fb-shadow: 0 1px 2px rgba(0,0,0,0.1), 0 1px 0 rgba(0,0,0,0.04);
  --fb-shadow-card: 0 1px 2px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --fb-shadow-lift: 0 8px 20px rgba(24,119,242,0.12), 0 2px 6px rgba(0,0,0,0.06);
  --fb-blue-soft: rgba(24,119,242,0.08);
  --fb-blue-tint: rgba(24,119,242,0.04);
  --honey-grad: linear-gradient(135deg, #1877F2 0%, #0866FF 100%);
  --honey-soft: rgba(24,119,242,0.08);
  --honey-glow: 0 8px 24px rgba(24,119,242,0.18);
  --shadow-card: var(--fb-shadow-card);
  --shadow-lift: var(--fb-shadow-lift);
}

html, body {
  background: var(--fb-light);
  color: var(--fb-text);
}

/* Body ambient — subtle blue mist (was honey) */
body::before {
  background:
    radial-gradient(800px 600px at 10% -10%, rgba(24,119,242,0.06), transparent 60%),
    radial-gradient(700px 500px at 95% 10%, rgba(8,102,255,0.04), transparent 55%) !important;
}

/* === BUTTONS === */
.btn-primary {
  background: var(--fb-blue);
  color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}
.btn-primary:hover:not(:disabled) {
  background: var(--fb-blue-hover);
  box-shadow: 0 2px 8px rgba(24,119,242,0.3);
}
.btn-secondary {
  background: var(--fb-light);
  color: var(--fb-text);
  border: 1px solid var(--fb-border);
}
.btn-secondary:hover:not(:disabled) {
  background: #E4E6EB;
  border-color: var(--fb-border);
}
.btn-outline {
  background: transparent;
  border: 1px solid var(--fb-border);
  color: var(--fb-blue);
}
.btn-outline:hover:not(:disabled) {
  background: var(--fb-blue-soft);
  border-color: var(--fb-blue);
}

/* === CARDS === */
.card, .pricing-card, .stat-card, .landing-feature, .auth-card,
.top-card, .tpl-card, .rep-card, .plan-card, .ab-card, .ht-card {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  box-shadow: var(--fb-shadow-card);
}
.card:hover, .stat-card:hover, .landing-feature:hover, .pricing-card:hover,
.top-card:hover {
  box-shadow: var(--fb-shadow-lift);
  border-color: var(--fb-blue);
}

/* === SIDEBAR === */
.sidebar {
  background: var(--fb-card) !important;
  border-right: 1px solid var(--fb-border);
}
.sidebar-logo { border-bottom: 1px solid var(--fb-border); }
.nav-item { color: var(--fb-text); }
.nav-item:hover { background: var(--fb-blue-soft); color: var(--fb-blue); }
.nav-item.active {
  background: var(--fb-blue-soft) !important;
  color: var(--fb-blue) !important;
  font-weight: 600;
}
.nav-item.active::before {
  background: var(--fb-blue) !important;
  box-shadow: 0 0 8px rgba(24,119,242,0.4);
}
.user-info { background: var(--fb-light); }
.user-avatar { background: var(--fb-blue); color: #fff; }
.user-name, .user-email { color: var(--fb-text); }

/* === FORMS === */
input, textarea, select {
  background: var(--fb-light) !important;
  border: 1px solid var(--fb-border) !important;
  color: var(--fb-text) !important;
  border-radius: 8px;
}
input:focus, textarea:focus, select:focus {
  background: #fff !important;
  border-color: var(--fb-blue) !important;
  box-shadow: 0 0 0 3px rgba(24,119,242,0.15) !important;
}
input::placeholder, textarea::placeholder { color: var(--fb-text-2) !important; opacity: 0.7; }
.form-group label { color: var(--fb-text); }

/* === HEADINGS === */
.view-title, h1, h2, h3 { color: var(--fb-text); }
.view-subtitle, .muted { color: var(--fb-text-2) !important; }

/* === BADGES === */
.badge { background: var(--fb-light); border: 1px solid var(--fb-border); color: var(--fb-text-2); }
.badge-paid { background: #E8F5E9; color: var(--success); border-color: rgba(49,162,76,0.3); }
.badge-pending { background: #FFF7E6; color: #E89B07; border-color: rgba(247,185,40,0.4); }
.badge-rejected, .badge-refunded { background: #FDECEF; color: var(--danger); border-color: rgba(228,30,63,0.3); }
.badge-admin { background: #EDE9FE; color: #7C3AED; border-color: rgba(124,58,237,0.3); }

.status-badge { font-weight: 600; }
.status-badge.draft { background: #E4E6EB; color: var(--fb-text-2); }
.status-badge.scheduled { background: var(--fb-blue-soft); color: var(--fb-blue); }
.status-badge.published { background: #E8F5E9; color: var(--success); }
.status-badge.failed { background: #FDECEF; color: var(--danger); }
.status-badge.publishing { background: #FFF7E6; color: #E89B07; }

/* === MODALS / DRAWERS === */
.modal-overlay { background: rgba(0,0,0,0.45); }
.modal-box {
  background: var(--fb-card);
  border: 1px solid var(--fb-border);
  box-shadow: 0 16px 48px rgba(0,0,0,0.18);
}
.modal-box::before { background: rgba(0,0,0,0.15); }
.drawer-panel { background: var(--fb-card); border-left: 1px solid var(--fb-border); }
.drawer-head { border-bottom: 1px solid var(--fb-border); }
.auth-modal-close { color: var(--fb-text-2); }
.auth-modal-close:hover { background: var(--fb-light); color: var(--fb-text); }

/* === LANDING === */
.landing-nav { background: rgba(255,255,255,0.85); border-bottom: 1px solid var(--fb-border); }
.landing-nav-actions a { color: var(--fb-text-2); }
.landing-nav-actions a:hover { color: var(--fb-blue); }
.landing-logo { color: var(--fb-text); }
.landing-hero-content h1 { color: var(--fb-text); }
.hero-accent {
  background: linear-gradient(135deg, #1877F2, #0866FF);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--fb-text-2); }
.feat-icon {
  background: var(--fb-blue-soft);
  border: 1px solid rgba(24,119,242,0.2);
  color: var(--fb-blue);
}
.landing-feature h3 { color: var(--fb-text); }
.landing-feature p { color: var(--fb-text-2); }

/* Pricing */
.price-num {
  background: linear-gradient(135deg, #1877F2, #0866FF) !important;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.price-unit { color: var(--fb-text-2); }
.pricing-card { border-radius: 14px; }
.pricing-highlight {
  border-color: var(--fb-blue) !important;
  box-shadow: 0 0 0 2px rgba(24,119,242,0.15), 0 8px 20px rgba(24,119,242,0.12);
}
.pricing-highlight::before {
  background: linear-gradient(135deg, #1877F2, #0866FF);
  color: #fff;
}
.pricing-features li { border-bottom-color: var(--fb-border); }
.feat-li.on { color: var(--fb-text); }
.feat-li.off { color: var(--fb-text-2); opacity: 0.6; }

/* === Stat cards === */
.stat-card { color: var(--fb-text); }
.stat-card::after { background: var(--fb-blue) !important; }
.stat-num {
  color: var(--fb-blue) !important;
  background: none !important;
  -webkit-text-fill-color: var(--fb-blue) !important;
}
.stat-label { color: var(--fb-text-2); }

/* === Tables === */
.data-table thead th {
  background: var(--fb-light);
  color: var(--fb-text-2);
  border-bottom-color: var(--fb-border);
}
.data-table tbody tr:hover { background: var(--fb-blue-tint); }
.data-table tbody td { border-bottom-color: var(--fb-border); color: var(--fb-text); }
.data-table tr.row-pending { background: #FFF7E6; }
.payment-filters { background: var(--fb-light); border-color: var(--fb-border); }
.payment-filters select, .payment-filters input { background: #fff !important; }

/* === Toasts === */
.toast { background: var(--fb-card); border: 1px solid var(--fb-border); color: var(--fb-text); }

/* === Posts list === */
.post-item { background: var(--fb-card); border-color: var(--fb-border); }
.post-item:hover { border-color: var(--fb-blue); }
.post-content { color: var(--fb-text); }
.post-meta { color: var(--fb-text-2); }
.post-time { color: var(--fb-text-2); }
.ai-tag { background: var(--fb-blue-soft); color: var(--fb-blue); border-color: rgba(24,119,242,0.25); }
.post-item.selected {
  background: var(--fb-blue-soft);
  border-color: var(--fb-blue);
}
.post-errors {
  background: #FDECEF;
  border-left-color: var(--danger);
  color: var(--danger);
}

/* === Platform chips === */
.platform-chip {
  background: var(--fb-card);
  border-color: var(--fb-border);
  color: var(--fb-text);
}
.platform-chip:hover { border-color: var(--fb-blue); color: var(--fb-blue); }
.platform-chip.active {
  background: var(--fb-blue) !important;
  color: #fff !important;
  border-color: var(--fb-blue) !important;
  box-shadow: 0 2px 6px rgba(24,119,242,0.3);
}

/* === Admin / Marketing tabs === */
.admin-tabs { border-bottom-color: var(--fb-border); }
.admin-tab { color: var(--fb-text-2); }
.admin-tab.active { color: var(--fb-blue); border-bottom-color: var(--fb-blue); }
.admin-tab:hover { color: var(--fb-blue); }

/* === Bulk action bar === */
.bulk-bar {
  background: var(--fb-blue) !important;
  color: #fff !important;
  box-shadow: 0 8px 24px rgba(24,119,242,0.25);
}
.bulk-bar .btn-outline { background: rgba(255,255,255,0.15); border-color: rgba(255,255,255,0.3); color: #fff; }
.bulk-bar .btn-outline:hover { background: rgba(255,255,255,0.25); }
.bulk-bar .btn-icon { background: rgba(255,255,255,0.15); color: #fff; }

/* === Marketing UI === */
.ht-pill {
  background: var(--fb-blue-soft);
  border-color: rgba(24,119,242,0.25);
  color: var(--fb-blue);
}
.ht-out-box { background: var(--fb-blue-tint); border-color: rgba(24,119,242,0.3); }
.rep-shortcut { background: var(--fb-blue-soft); color: var(--fb-blue); }
.top-rank {
  background: linear-gradient(135deg, #1877F2, #0866FF) !important;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.plan-card { border-left-width: 4px; }
.utm-row code { background: var(--fb-light); color: var(--fb-text); }
.ab-variant { background: var(--fb-light); border-color: var(--fb-border); }
.ab-variant.winner { background: #E8F5E9; border-color: var(--success); }
.ab-score { color: var(--fb-blue) !important; }
.predict-improved { background: var(--fb-blue-tint); border-color: rgba(24,119,242,0.3); }
.predict-bar-fill { background: linear-gradient(135deg, #1877F2, #0866FF) !important; }
.usage-fill { background: var(--success); }
.usage-fill.warn { background: #F7B928; }
.usage-fill.danger { background: var(--danger); }

/* Content check */
.cc-box { background: var(--fb-light); border-color: var(--fb-border); }
.cc-issue { background: #fff; }

/* === MOBILE === */
.mobile-topbar {
  background: rgba(255,255,255,0.9) !important;
  border-bottom: 1px solid var(--fb-border);
}
.mobile-menu-btn { color: var(--fb-text); }
.mobile-menu-btn:hover { background: var(--fb-blue-soft); color: var(--fb-blue); }

/* === SVG icons === */
.landing-logo svg path,
.auth-logo svg path,
.mobile-topbar-logo svg path,
.sidebar-logo svg path {
  stroke: var(--fb-blue) !important;
  fill: var(--fb-blue) !important;
}
.landing-logo svg path[fill="none"],
.auth-logo svg path[fill="none"],
.mobile-topbar-logo svg path[fill="none"],
.sidebar-logo svg path[fill="none"] {
  fill: none !important;
}

/* === Scrollbar — blue tint === */
* { scrollbar-color: rgba(24,119,242,0.3) transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(24,119,242,0.25);
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background: rgba(24,119,242,0.45); background-clip: padding-box; }

/* === Selection === */
::selection { background: rgba(24,119,242,0.25); color: var(--fb-text); }

/* === Loading spinner === */
.loading {
  border-color: rgba(24,119,242,0.2);
  border-top-color: var(--fb-blue);
}

/* === Auth modal === */
.auth-card { background: var(--fb-card); border: 1px solid var(--fb-border); box-shadow: 0 16px 48px rgba(0,0,0,0.12); }
.auth-card h1 { color: var(--fb-text); }
.auth-subtitle { color: var(--fb-text-2); }
.auth-divider { color: var(--fb-text-2); }
.auth-divider::before, .auth-divider::after { background: var(--fb-border); }

/* === Misc === */
code { background: var(--fb-light); color: var(--fb-text); padding: 2px 6px; border-radius: 4px; font-size: 0.9em; }
hr { border-color: var(--fb-border); }
a { color: var(--fb-blue); }
kbd {
  background: var(--fb-light);
  border: 1px solid var(--fb-border);
  color: var(--fb-text);
}

/* Field hint */
.field-hint { color: var(--fb-text-2); font-size: 12px; margin-top: 4px; }

/* === Header / view-header === */
.view-header { color: var(--fb-text); }

/* === Empty state === */
.empty-state { color: var(--fb-text-2); }
.empty-state svg { stroke: var(--fb-text-2); opacity: 0.5; }

/* Subscription page */
.usage-track { background: var(--fb-border); }
.pending-payment { background: #FFF7E6; border-color: rgba(247,185,40,0.4); }

/* Calendar */
.cal-day { background: var(--fb-light); border-color: var(--fb-border); color: var(--fb-text); }
.cal-day:hover { border-color: var(--fb-blue); }
.cal-day.today { border-color: var(--fb-blue); background: var(--fb-blue-soft); }
.cal-day-num { color: var(--fb-text); }
.cal-day-count { background: var(--fb-blue); color: #fff; }
.cal-post { background: var(--fb-card); border-left-color: var(--fb-blue); }
.cal-post.published { border-left-color: var(--success); background: #E8F5E9; }
.cal-post.scheduled { border-left-color: var(--fb-blue); }
.cal-post.draft { border-left-color: var(--fb-text-2); background: var(--fb-light); }
.calendar-grid { background: var(--fb-card); border-color: var(--fb-border); }
.cal-day-name { color: var(--fb-text-2); }
.view-mode-toggle { background: var(--fb-light); border-color: var(--fb-border); }
.view-mode-btn { color: var(--fb-text-2); }
.view-mode-btn:hover { color: var(--fb-blue); }
.view-mode-btn.active { background: var(--fb-blue) !important; color: #fff !important; }

/* ======================================================================
   ✨ MOTION + SPACING + RESPONSIVE — final polish layer
   ====================================================================== */

:root {
  /* Spacing scale — consistent 4px-based grid */
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radii scale */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 999px;

  /* Motion */
  --dur-fast: 120ms;
  --dur-med: 220ms;
  --dur-slow: 360ms;
  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0.05, 0.55, 0.95);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-snap: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* === GLOBAL TRANSITIONS === */
button, a, .btn, .card, .nav-item, .platform-chip, .post-item,
.pricing-card, .stat-card, .landing-feature, .top-card, .tpl-card,
.rep-card, .plan-card, .ab-card, input, textarea, select, .badge {
  transition:
    transform var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    border-color var(--dur-fast) var(--ease-out),
    background-color var(--dur-fast) var(--ease-out),
    color var(--dur-fast) var(--ease-out);
}

/* === BUTTON PRESS FEEDBACK === */
.btn:active:not(:disabled),
button:active:not(:disabled) {
  transform: scale(0.97);
  transition-duration: var(--dur-fast);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); }
.btn-primary:active:not(:disabled) { transform: translateY(0) scale(0.98); }

/* === RIPPLE on primary buttons === */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at var(--rx, 50%) var(--ry, 50%), rgba(255,255,255,0.4) 0%, transparent 50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-slow);
}
.btn-primary:active::after { opacity: 1; transition-duration: 0ms; }

/* === ICON HOVER WIGGLE === */
.nav-item svg { transition: transform var(--dur-med) var(--ease-spring); }
.nav-item:hover svg { transform: scale(1.15) rotate(-4deg); }
.nav-item.active svg { transform: scale(1.1); }

/* === HEADING REVEAL === */
.view-header { animation: revealUp var(--dur-slow) var(--ease-out) both; }
@keyframes revealUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === STAGGERED CARD REVEAL === */
.stats-grid > *,
.pricing-grid > *,
.landing-features > *,
.top-grid > *,
.tpl-grid > *,
.rep-grid > *,
.plan-grid > *,
.accounts-grid > *,
.post-list > * {
  animation: cardIn var(--dur-slow) var(--ease-out) both;
}
.stats-grid > *:nth-child(1), .pricing-grid > *:nth-child(1),
.landing-features > *:nth-child(1), .top-grid > *:nth-child(1),
.tpl-grid > *:nth-child(1), .rep-grid > *:nth-child(1),
.plan-grid > *:nth-child(1), .accounts-grid > *:nth-child(1),
.post-list > *:nth-child(1) { animation-delay: 0ms; }
.stats-grid > *:nth-child(2), .pricing-grid > *:nth-child(2),
.landing-features > *:nth-child(2), .top-grid > *:nth-child(2),
.tpl-grid > *:nth-child(2), .rep-grid > *:nth-child(2),
.plan-grid > *:nth-child(2), .accounts-grid > *:nth-child(2),
.post-list > *:nth-child(2) { animation-delay: 60ms; }
.stats-grid > *:nth-child(3), .pricing-grid > *:nth-child(3),
.landing-features > *:nth-child(3), .top-grid > *:nth-child(3),
.tpl-grid > *:nth-child(3), .rep-grid > *:nth-child(3),
.plan-grid > *:nth-child(3), .accounts-grid > *:nth-child(3),
.post-list > *:nth-child(3) { animation-delay: 120ms; }
.stats-grid > *:nth-child(4), .pricing-grid > *:nth-child(4),
.landing-features > *:nth-child(4), .top-grid > *:nth-child(4),
.tpl-grid > *:nth-child(4), .rep-grid > *:nth-child(4),
.plan-grid > *:nth-child(4), .accounts-grid > *:nth-child(4),
.post-list > *:nth-child(4) { animation-delay: 180ms; }
.stats-grid > *:nth-child(n+5), .pricing-grid > *:nth-child(n+5),
.top-grid > *:nth-child(n+5), .tpl-grid > *:nth-child(n+5),
.rep-grid > *:nth-child(n+5), .plan-grid > *:nth-child(n+5),
.post-list > *:nth-child(n+5) { animation-delay: 240ms; }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === FLOATING SHADOW on important CTAs === */
.btn-primary.btn-lg, .hero-cta .btn-primary {
  animation: pulseGlow 2.4s ease-in-out infinite;
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 4px 14px rgba(24,119,242,0.25); }
  50% { box-shadow: 0 4px 24px rgba(24,119,242,0.45); }
}

/* === MODAL POP === */
.modal-box { animation: modalPop var(--dur-slow) var(--ease-spring); }
@keyframes modalPop {
  from { opacity: 0; transform: translateY(20px) scale(0.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === DRAWER SLIDE === */
.drawer-panel { animation: drawerSlide var(--dur-slow) var(--ease-out); }
@keyframes drawerSlide {
  from { opacity: 0.6; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* === TOAST SLIDE === */
.toast { animation: toastIn var(--dur-med) var(--ease-spring); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* === BADGE PULSE on pending === */
.badge-pending, .row-pending td:first-child::before {
  position: relative;
}
.badge-pending::after {
  content: '';
  position: absolute; inset: 0;
  background: inherit;
  border-radius: inherit;
  animation: badgePulse 2s ease-in-out infinite;
  opacity: 0;
}
@keyframes badgePulse {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.15); }
}

/* === INPUT FOCUS LIFT === */
input:focus, textarea:focus, select:focus { transform: translateY(-1px); }

/* === LINK UNDERLINE GROW === */
a:not(.btn):not(.nav-item) { position: relative; text-decoration: none; }
a:not(.btn):not(.nav-item)::after {
  content: '';
  position: absolute; left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform var(--dur-med) var(--ease-out);
}
a:not(.btn):not(.nav-item):hover::after {
  transform: scaleX(1); transform-origin: left;
}

/* === SHIMMER on loading === */
.loading-overlay { animation: shimmerFade var(--dur-slow) ease-out; }
@keyframes shimmerFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* === FLOATING ICONS on landing === */
.feat-icon { transition: transform var(--dur-slow) var(--ease-spring); }
.landing-feature:hover .feat-icon { transform: scale(1.15) rotate(-6deg); }

/* === BULK BAR ENTRY === */
.bulk-bar { animation: bulkSlide var(--dur-med) var(--ease-spring); }
@keyframes bulkSlide {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === SUCCESS CHECKMARK ANIMATION === */
.badge-paid::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--success);
  border-radius: 50%;
  margin-right: 4px;
  animation: dotPulse 1.6s ease-in-out infinite;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 var(--success); }
  50% { opacity: 0.6; box-shadow: 0 0 0 4px transparent; }
}

/* ======================================================================
   📐 SPACING RHYTHM — consistent breathing room across the app
   ====================================================================== */

.view-header { margin-bottom: var(--space-xl); }
.card { padding: var(--space-lg); border-radius: var(--radius-lg); margin-bottom: var(--space-md); }
.section-title { margin: var(--space-xl) 0 var(--space-md); }
.form-group { margin-bottom: var(--space-md); }
.form-group label { display: block; margin-bottom: var(--space-2xs); }

/* Consistent grid gaps */
.stats-grid, .pricing-grid, .landing-features,
.top-grid, .tpl-grid, .rep-grid, .plan-grid, .accounts-grid {
  gap: var(--space-md);
}

/* ======================================================================
   📱 RESPONSIVE — clean PC ↔ Tablet ↔ Mobile separation
   ====================================================================== */

/* === DESKTOP (>= 1100px): the default — generous spacing === */
@media (min-width: 1100px) {
  .main-content { padding: var(--space-xl) var(--space-2xl); max-width: 1400px; }
  .view-header { gap: var(--space-md); margin-bottom: var(--space-2xl); }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }
  .landing-features { grid-template-columns: repeat(4, 1fr); gap: var(--space-lg); }
  .composer-grid { grid-template-columns: 1fr 1fr; }
  .top-card { grid-template-columns: 80px 1fr; }
}

/* === TABLET (901px – 1099px): comfortable in-between === */
@media (min-width: 901px) and (max-width: 1099px) {
  .main-content { padding: var(--space-lg) var(--space-xl); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
  .landing-features { grid-template-columns: repeat(2, 1fr); }
  .tpl-grid, .rep-grid, .plan-grid { grid-template-columns: repeat(2, 1fr); }
  .composer-grid { grid-template-columns: 1fr; }
  .view-title { font-size: 26px; }
  /* PWA prompt + topbar stays hidden on tablet (sidebar visible) */
}

/* === MOBILE (<= 900px): stack everything, tight spacing === */
@media (max-width: 900px) {
  /* Tighter page spacing */
  .main-content { padding: var(--space-md); }
  .view-header { margin-bottom: var(--space-md); flex-direction: column; align-items: flex-start; }
  .view-header .btn { width: 100%; }
  .view-title { font-size: 22px; }
  .view-subtitle { font-size: 13px; }
  .section-title { margin: var(--space-lg) 0 var(--space-sm); font-size: 15px; }
  .card { padding: var(--space-md); margin-bottom: var(--space-sm); border-radius: var(--radius-md); }

  /* All grids collapse to single column with comfortable spacing */
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-xs); }
  .pricing-grid, .landing-features,
  .tpl-grid, .rep-grid, .plan-grid, .accounts-grid,
  .top-grid { grid-template-columns: 1fr; gap: var(--space-sm); }
  .composer-grid { grid-template-columns: 1fr; gap: var(--space-md); }
  .composer-row { grid-template-columns: 1fr !important; }

  /* Big-touch buttons */
  .btn { min-height: 44px; padding: 11px 18px; font-size: 14px; border-radius: var(--radius-md); }
  .btn-sm { min-height: 38px; padding: 8px 14px; font-size: 12px; }
  .btn-lg { min-height: 52px; padding: 14px 24px; font-size: 15px; }

  /* Stack admin/marketing tabs into scrollable strip */
  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    padding-bottom: 2px;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .admin-tab { flex-shrink: 0; white-space: nowrap; }

  /* Filter chips horizontal scroll, no wrap */
  .posts-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .posts-filters::-webkit-scrolling { display: none; }
  .posts-filters .platform-chip { flex-shrink: 0; }

  /* Posts toolbar stacks */
  .posts-toolbar { flex-direction: column; align-items: stretch; gap: var(--space-sm); }
  .view-mode-toggle { width: 100%; }
  .view-mode-btn { flex: 1; justify-content: center; }

  /* Disable hover-lift on mobile (no hover, just looks broken) */
  .card:hover, .post-item:hover, .pricing-card:hover, .stat-card:hover,
  .landing-feature:hover, .top-card:hover { transform: none; }

  /* Heavier-pulse CTA on mobile so it stands out */
  .hero-cta .btn-primary { animation: pulseGlow 1.8s ease-in-out infinite; }

  /* Reduce stagger delays on mobile (already in viewport) */
  .stats-grid > *, .post-list > * { animation-duration: 280ms; }

  /* Reduce ambient blob intensity */
  body::before { opacity: 0.5; }
  .landing-hero::before, .landing-hero::after { opacity: 0.3; }
}

/* === COMPACT MOBILE (<= 480px) === */
@media (max-width: 480px) {
  .main-content { padding: var(--space-sm) var(--space-md); }
  .stats-grid { grid-template-columns: 1fr; }
  .view-title { font-size: 20px; }
  .card { padding: var(--space-sm); }
  .auth-card { padding: var(--space-lg) var(--space-md); border-radius: var(--radius-lg); }
  .auth-logo h1 { font-size: 22px; }
  .modal-box { padding: var(--space-md); }

  /* Cut animation distance on small screens (less viewport = looks janky if big) */
  @keyframes cardIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

/* === REDUCED MOTION — accessibility first === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .hero-cta .btn-primary, .btn-primary.btn-lg, .badge-pending::after { animation: none !important; }
}

/* === SMOOTH SCROLL === */
html { scroll-behavior: smooth; }

/* === PRINT === */
@media print {
  .sidebar, .mobile-topbar, .sidebar-scrim, .toast { display: none !important; }
  .main-content { padding: 0 !important; }
  body { background: white; }
}

/* ======================================================================
   ⚙ SETTINGS + 🛠 AI TOOLS — PC-friendly responsive layout
   ====================================================================== */

/* === SETTINGS: 2-column masonry on PC, single column on tablet/mobile === */
@media (min-width: 1100px) {
  /* Container that holds all setting cards */
  #view-container { container-type: inline-size; }

  /* Settings cards drop the inline max-width:760 and join a 2-col grid */
  .view-container-settings,
  body:has(.view-title:first-child) #view-container > .card {
    /* fallback if :has unsupported — handled below by JS class */
  }

  /* When marked with class, switch to 2-col masonry-ish layout */
  .settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: start;
  }
  .settings-layout > .card {
    max-width: none !important;
    margin-bottom: 0;
  }
  /* Full-width cards (brand/account info typically) */
  .settings-layout > .card.full-row { grid-column: 1 / -1; }
}

@media (min-width: 1400px) {
  /* Ultra-wide — let settings use 3 columns */
  .settings-layout { grid-template-columns: repeat(3, 1fr); }
}

/* Tablet — 1 column with comfortable spacing */
@media (max-width: 1099px) {
  .settings-layout { display: flex; flex-direction: column; gap: var(--space-md); }
  .settings-layout > .card { max-width: 720px !important; width: 100%; }
}

/* Mobile — full width */
@media (max-width: 900px) {
  .settings-layout > .card { max-width: 100% !important; }
}

/* === AI TOOLS: better PC use of horizontal space === */
@media (min-width: 1100px) {
  .aitools-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    max-width: 1280px;
  }
  .aitools-grid .card {
    padding: var(--space-lg);
  }
}

@media (min-width: 1400px) {
  /* On very wide screens, give the Vision section a side-by-side
     input/result layout instead of stacking */
  .aitools-grid + .view-header + .aitools-grid { grid-template-columns: 1fr 1fr; }
  .vision-result-side { display: block; }
}

/* Tablet — 1 column AI Tools cards, full width */
@media (min-width: 901px) and (max-width: 1099px) {
  .aitools-grid { grid-template-columns: 1fr; gap: var(--space-md); }
}

/* AI Tools result block — tighter type rhythm */
.aitools-result { margin-top: var(--space-md); }
.aitools-result:not(:empty) {
  padding: var(--space-md);
  background: var(--fb-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--fb-border);
}

/* Vision drop zone — bigger + more inviting on PC */
@media (min-width: 1100px) {
  .vision-drop { min-height: 200px; }
  .vision-drop-icon { font-size: 56px; }
}

/* === Page max-width guards across all views === */
@media (min-width: 1100px) {
  .view-header,
  .posts-toolbar,
  .bulk-bar,
  .admin-tabs,
  .payment-filters,
  .post-list,
  .data-table,
  .settings-layout,
  .aitools-grid,
  .top-grid,
  .pricing-grid,
  .stats-grid,
  .landing-features,
  .composer-grid,
  .accounts-grid,
  .tpl-grid,
  .rep-grid,
  .plan-grid {
    max-width: 1280px;
  }
}

/* ======================================================================
   ⚙ SETTINGS — equal-height uniform cards on PC
   ====================================================================== */

@media (min-width: 1100px) {
  .settings-layout {
    align-items: stretch;           /* every card in a row matches the tallest */
    grid-auto-rows: 1fr;            /* rows themselves are equal height too */
  }

  /* Make each card a flex column so the Save button can stick to the
     bottom regardless of how much content above it has */
  .settings-layout > .card {
    display: flex;
    flex-direction: column;
    min-height: 280px;              /* short cards (lang switch) won't look empty */
  }

  /* Push the last primary button / save row to the bottom of the card */
  .settings-layout > .card > .btn:last-child,
  .settings-layout > .card > .btn-primary:last-of-type {
    margin-top: auto;
  }

  /* Headings + paragraphs at the top of each card share consistent spacing */
  .settings-layout > .card > h3.card-title {
    margin-bottom: var(--space-2xs);
  }
  .settings-layout > .card > p.card-subtitle {
    margin-bottom: var(--space-md);
  }

  /* Form groups inside settings cards — uniform spacing */
  .settings-layout > .card .form-group {
    margin-bottom: var(--space-md);
  }
  .settings-layout > .card .form-group:last-of-type {
    margin-bottom: var(--space-md);
  }
}

/* ======================================================================
   🌌 NAVY DARK THEME v2 — final override (winning the cascade)
   #0a0f1c bg · #121a2a surface · mint→sky accent · slate buttons
   ====================================================================== */

:root {
  --bg-deep: #0a0f1c;
  --bg-surface: #121a2a;
  --bg-elev2: #1a2438;
  --line2: rgba(148, 163, 184, 0.18);
  --line2-strong: rgba(148, 163, 184, 0.32);
  --slate: #94a3b8;
  --slate-deep: #64748b;
  --text2: #e2e8f0;
  --text2-muted: rgba(226, 232, 240, 0.6);
  --accent-mint: #13DEB9;
  --accent-sky: #49BEFF;
  --accent-grad: linear-gradient(135deg, #13DEB9 0%, #49BEFF 100%);
  --accent-soft: rgba(73, 190, 255, 0.10);
  --accent-tint: rgba(73, 190, 255, 0.04);
  --shadow-deep: 0 2px 4px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.2);
  --shadow-glow: 0 8px 32px rgba(19, 222, 185, 0.18);

  /* Re-alias every legacy token */
  --honey: #49BEFF;
  --honey-deep: #13DEB9;
  --honey-grad: var(--accent-grad);
  --honey-soft: var(--accent-soft);
  --honey-glow: var(--shadow-glow);
  --amber: #13DEB9;
  --ink: #ffffff;
  --cream: #e2e8f0;
  --bg: var(--bg-deep);
  --bg-soft: var(--bg-surface);
  --bg-card: var(--bg-surface);
  --bg-elev: var(--bg-elev2);
  --fb-blue: #49BEFF;
  --fb-blue-hover: #13DEB9;
  --fb-blue-deep: #13DEB9;
  --fb-light: var(--bg-elev2);
  --fb-card: var(--bg-surface);
  --fb-text: var(--text2);
  --fb-text-2: var(--text2-muted);
  --fb-border: var(--line2);
  --fb-blue-soft: var(--accent-soft);
  --fb-blue-tint: var(--accent-tint);
  --fb-shadow: 0 2px 4px rgba(0,0,0,0.25);
  --fb-shadow-card: var(--shadow-deep);
  --fb-shadow-lift: 0 8px 24px rgba(19, 222, 185, 0.18), 0 4px 12px rgba(0,0,0,0.4);
  --line: var(--line2);
  --line-strong: var(--line2-strong);
  --muted: var(--text2-muted);
  --muted-strong: rgba(226, 232, 240, 0.78);
}

html, body { background: var(--bg-deep); color: var(--text2); }

/* Soft ambient halos in the background */
body::before {
  background:
    radial-gradient(900px 700px at 12% -10%, rgba(19,222,185,0.10), transparent 60%) !important,
    radial-gradient(800px 600px at 95% 10%, rgba(73,190,255,0.10), transparent 55%) !important,
    radial-gradient(600px 400px at 50% 110%, rgba(167,139,250,0.06), transparent 60%) !important;
}

/* === SURFACES === */
.sidebar,
.card, .pricing-card, .stat-card, .landing-feature, .auth-card,
.top-card, .tpl-card, .rep-card, .plan-card, .ab-card, .ht-card,
.modal-box, .drawer-panel, .toast, .post-item, .ab-variant,
.mobile-topbar, .landing-nav, .payment-filters {
  background: var(--bg-surface) !important;
  border-color: var(--line2) !important;
  color: var(--text2) !important;
}
.mobile-topbar { background: rgba(18, 26, 42, 0.92) !important; backdrop-filter: blur(16px); }
.landing-nav { background: rgba(18, 26, 42, 0.85) !important; }

/* Cards lift to glow on hover */
.card:hover, .stat-card:hover, .pricing-card:hover, .landing-feature:hover,
.top-card:hover, .post-item:hover {
  border-color: var(--accent-sky) !important;
  box-shadow: var(--shadow-glow) !important;
  transform: translateY(-3px);
}

/* === TEXT === */
.view-title, h1, h2, h3, h4, .card-title, .top-content, .plan-title {
  color: var(--text2) !important;
}
.view-subtitle, .muted, .card-subtitle, .field-hint, .plan-day {
  color: var(--text2-muted) !important;
}

/* Gradient headings — auto applied to the .italic accent already in view-titles */
.view-title .italic,
.hero-accent,
.price-num,
.stat-num,
.top-rank,
.cmdk-icon,
.ab-score {
  background: var(--accent-grad) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}

/* === BUTTONS === */
.btn-primary {
  background: var(--accent-grad) !important;
  color: #062029 !important;
  border: none !important;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(19, 222, 185, 0.28);
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #20EBC5 0%, #5FC8FF 100%) !important;
  box-shadow: 0 6px 24px rgba(19, 222, 185, 0.42);
}
.btn-secondary {
  background: var(--slate) !important;
  color: var(--bg-deep) !important;
  border: 1px solid var(--slate) !important;
  font-weight: 600;
}
.btn-secondary:hover:not(:disabled) {
  background: var(--slate-deep) !important;
  border-color: var(--slate-deep) !important;
  color: #ffffff !important;
}
.btn-outline {
  background: transparent !important;
  border: 1px solid var(--slate) !important;
  color: var(--slate) !important;
}
.btn-outline:hover:not(:disabled) {
  background: var(--accent-soft) !important;
  border-color: var(--accent-sky) !important;
  color: var(--accent-sky) !important;
}
.btn-icon, .icon-btn {
  background: var(--bg-elev2) !important;
  color: var(--text2-muted) !important;
  border: 1px solid var(--line2) !important;
}
.btn-icon:hover, .icon-btn:hover {
  background: var(--accent-soft) !important;
  color: var(--accent-sky) !important;
  border-color: var(--accent-sky) !important;
}
.icon-btn.danger, .btn-icon.danger { color: #fca5a5 !important; }
.icon-btn.danger:hover, .btn-icon.danger:hover {
  background: rgba(248,113,113,0.12) !important;
  color: #fca5a5 !important;
  border-color: #fca5a5 !important;
}

/* === SIDEBAR === */
.sidebar { background: linear-gradient(180deg, #242d45, var(--bg-surface)) !important; border-right: 1px solid var(--line2); }
.sidebar-logo { border-bottom: 1px solid var(--line2); }
.sidebar-logo span,
.mobile-topbar-logo span,
.landing-logo strong { color: var(--text2) !important; }
.nav-item { color: var(--text2-muted) !important; border-radius: 10px; }
.nav-item:hover {
  background: var(--accent-soft) !important;
  color: var(--text2) !important;
}
.nav-item.active {
  background: linear-gradient(90deg, rgba(19,222,185,0.18), rgba(73,190,255,0.04)) !important;
  color: var(--accent-mint) !important;
  font-weight: 600;
}
.nav-item.active::before {
  background: var(--accent-grad) !important;
  box-shadow: 0 0 12px rgba(19, 222, 185, 0.6);
}

/* === COLORFUL NAV ICONS === */
.nav-item[data-view="dashboard"]   svg { color: #60a5fa; }
.nav-item[data-view="composer"]    svg { color: #f59e0b; }
.nav-item[data-view="posts"]       svg { color: #34d399; }
.nav-item[data-view="analytics"]   svg { color: #a78bfa; }
.nav-item[data-view="campaigns"]   svg { color: #fb7185; }
.nav-item[data-view="autopilot"]   svg { color: #fbbf24; }
.nav-item[data-view="engagement"]  svg { color: #f472b6; }
.nav-item[data-view="aitools"]     svg { color: #c084fc; }
.nav-item[data-view="marketing"]   svg { color: #13DEB9; }
.nav-item[data-view="settings"]    svg { color: #94a3b8; }
.nav-item[data-view="subscription"] svg { color: #fde047; }
.nav-item[data-view="admin"]       svg { color: #fb923c; }

/* When active, icons shift to the brand mint so they stand out */
.nav-item.active svg { color: var(--accent-mint) !important; }

/* User avatar */
.user-info { background: var(--bg-elev2) !important; border: 1px solid var(--line2); }
.user-avatar {
  background: var(--accent-grad) !important;
  color: var(--bg-deep) !important;
  box-shadow: 0 4px 12px rgba(19, 222, 185, 0.32);
}
.user-name, .user-email { color: var(--text2) !important; }
.user-email { color: var(--text2-muted) !important; }

/* === FORMS === */
input, textarea, select {
  background: var(--bg-deep) !important;
  border: 1px solid var(--line2) !important;
  color: var(--text2) !important;
}
input:focus, textarea:focus, select:focus {
  background: var(--bg-deep) !important;
  border-color: var(--accent-sky) !important;
  box-shadow: 0 0 0 3px rgba(73, 190, 255, 0.18) !important;
}
input::placeholder, textarea::placeholder { color: rgba(148, 163, 184, 0.55) !important; }
.form-group label { color: var(--text2-muted) !important; font-weight: 500; }

/* === PLATFORM CHIPS / VIEW MODE TOGGLES === */
.platform-chip {
  background: var(--bg-elev2) !important;
  border: 1px solid var(--line2) !important;
  color: var(--text2-muted) !important;
}
.platform-chip:hover { border-color: var(--accent-sky) !important; color: var(--accent-sky) !important; }
.platform-chip.active {
  background: var(--accent-grad) !important;
  color: var(--bg-deep) !important;
  border-color: transparent !important;
}
.view-mode-toggle { background: var(--bg-elev2) !important; border: 1px solid var(--line2) !important; }
.view-mode-btn { color: var(--text2-muted) !important; }
.view-mode-btn:hover { color: var(--accent-sky) !important; }
.view-mode-btn.active {
  background: var(--accent-grad) !important;
  color: var(--bg-deep) !important;
}

/* === TABS === */
.admin-tabs { border-bottom-color: var(--line2) !important; }
.admin-tab { color: var(--text2-muted) !important; }
.admin-tab.active { color: var(--accent-mint) !important; border-bottom-color: var(--accent-mint) !important; }
.admin-tab:hover { color: var(--accent-sky) !important; }

/* === BADGES === */
.badge { background: var(--bg-elev2) !important; border: 1px solid var(--line2) !important; color: var(--text2-muted) !important; }
.badge-paid { background: rgba(19,222,185,0.14) !important; color: var(--accent-mint) !important; border-color: rgba(19,222,185,0.32) !important; }
.badge-pending { background: rgba(253,224,71,0.14) !important; color: #fde047 !important; border-color: rgba(253,224,71,0.32) !important; }
.badge-rejected, .badge-refunded { background: rgba(248,113,113,0.14) !important; color: #fca5a5 !important; border-color: rgba(248,113,113,0.32) !important; }
.badge-admin { background: rgba(192,132,252,0.14) !important; color: #c084fc !important; border-color: rgba(192,132,252,0.32) !important; }

.status-badge.draft { background: rgba(148,163,184,0.14) !important; color: var(--slate) !important; }
.status-badge.scheduled { background: rgba(73,190,255,0.16) !important; color: var(--accent-sky) !important; }
.status-badge.published { background: rgba(19,222,185,0.16) !important; color: var(--accent-mint) !important; }
.status-badge.failed { background: rgba(248,113,113,0.16) !important; color: #fca5a5 !important; }
.status-badge.publishing { background: rgba(253,224,71,0.16) !important; color: #fde047 !important; }

/* === STAT CARDS === */
.stat-card::after { background: var(--accent-grad) !important; }

/* === PRICING === */
.pricing-highlight {
  border-color: var(--accent-mint) !important;
  box-shadow: 0 0 0 1px rgba(19,222,185,0.25), 0 12px 32px rgba(19,222,185,0.18) !important;
}
.pricing-highlight::before {
  background: var(--accent-grad) !important;
  color: var(--bg-deep) !important;
}
.pricing-features li { border-bottom-color: var(--line2) !important; color: var(--text2-muted); }
.feat-li.on { color: var(--text2) !important; }
.feat-li.off { color: var(--text2-muted) !important; opacity: 0.5; }

/* === LANDING === */
.landing-features .feat-icon {
  background: var(--accent-soft) !important;
  border: 1px solid rgba(73, 190, 255, 0.28) !important;
}
/* Colourful feature icons */
.landing-features .landing-feature:nth-child(1) .feat-icon { background: rgba(96,165,250,0.14) !important; border-color: rgba(96,165,250,0.32) !important; }
.landing-features .landing-feature:nth-child(2) .feat-icon { background: rgba(19,222,185,0.14) !important; border-color: rgba(19,222,185,0.32) !important; }
.landing-features .landing-feature:nth-child(3) .feat-icon { background: rgba(244,114,182,0.14) !important; border-color: rgba(244,114,182,0.32) !important; }
.landing-features .landing-feature:nth-child(4) .feat-icon { background: rgba(251,191,36,0.14) !important; border-color: rgba(251,191,36,0.32) !important; }
.landing-features .landing-feature h3 { color: var(--text2) !important; }
.landing-features .landing-feature p { color: var(--text2-muted) !important; }

/* === TABLES === */
.data-table thead th { background: var(--bg-elev2) !important; color: var(--text2-muted) !important; border-bottom-color: var(--line2) !important; }
.data-table tbody tr:hover { background: var(--accent-tint) !important; }
.data-table tbody td { border-bottom-color: var(--line2) !important; color: var(--text2) !important; }
.data-table tr.row-pending { background: rgba(253,224,71,0.06) !important; }
.payment-filters select, .payment-filters input { background: var(--bg-deep) !important; }

/* === MODALS === */
.modal-overlay { background: rgba(0,0,0,0.65) !important; backdrop-filter: blur(8px); }
.modal-box { box-shadow: 0 24px 64px rgba(0,0,0,0.5), 0 1px 0 rgba(19,222,185,0.12) inset !important; }
.modal-box::before { background: rgba(148, 163, 184, 0.3); }
.drawer-head { border-bottom-color: var(--line2) !important; }
.auth-modal-close { color: var(--text2-muted) !important; }
.auth-modal-close:hover { background: var(--accent-soft) !important; color: var(--accent-sky) !important; }

/* === POSTS === */
.post-content { color: var(--text2) !important; }
.post-meta { color: var(--text2-muted) !important; }
.ai-tag {
  background: var(--accent-soft) !important;
  color: var(--accent-sky) !important;
  border: 1px solid rgba(73,190,255,0.32) !important;
}
.post-item.selected {
  background: rgba(19,222,185,0.06) !important;
  border-color: var(--accent-mint) !important;
  box-shadow: 0 0 0 1px rgba(19,222,185,0.25) !important;
}
.post-errors { background: rgba(248,113,113,0.10) !important; border-left-color: #fca5a5 !important; color: #fca5a5 !important; }

/* === BULK BAR === */
.bulk-bar {
  background: var(--accent-grad) !important;
  color: var(--bg-deep) !important;
  box-shadow: 0 8px 28px rgba(19,222,185,0.32) !important;
}
.bulk-bar .btn-outline {
  background: rgba(10,15,28,0.12) !important;
  border-color: rgba(10,15,28,0.18) !important;
  color: var(--bg-deep) !important;
}
.bulk-bar .btn-outline:hover { background: rgba(10,15,28,0.22) !important; color: var(--bg-deep) !important; }
.bulk-bar .btn-icon { background: rgba(10,15,28,0.12) !important; color: var(--bg-deep) !important; border-color: transparent !important; }

/* === CALENDAR === */
.calendar-grid { background: var(--bg-surface) !important; border-color: var(--line2) !important; }
.cal-day { background: var(--bg-elev2) !important; border-color: var(--line2) !important; color: var(--text2) !important; }
.cal-day:hover { border-color: var(--accent-sky) !important; }
.cal-day.today { border-color: var(--accent-mint) !important; background: rgba(19,222,185,0.06) !important; }
.cal-day-num { color: var(--text2) !important; }
.cal-day-count { background: var(--accent-grad) !important; color: var(--bg-deep) !important; }
.cal-post { background: var(--bg-deep) !important; border-left-color: var(--accent-sky) !important; }
.cal-post.published { border-left-color: var(--accent-mint) !important; background: rgba(19,222,185,0.08) !important; }
.cal-post.scheduled { border-left-color: var(--accent-sky) !important; }
.cal-post.draft { border-left-color: var(--slate) !important; }
.cal-day-name { color: var(--text2-muted) !important; }

/* === MARKETING UI === */
.ht-pill { background: var(--accent-soft) !important; color: var(--accent-sky) !important; border-color: rgba(73,190,255,0.32) !important; }
.ht-out-box { background: var(--accent-tint) !important; border-color: rgba(73,190,255,0.32) !important; }
.rep-shortcut { background: var(--accent-soft) !important; color: var(--accent-sky) !important; }
.utm-row code { background: var(--bg-deep) !important; color: var(--text2) !important; }
.ab-variant { background: var(--bg-elev2) !important; border-color: var(--line2) !important; }
.ab-variant.winner { background: rgba(19,222,185,0.08) !important; border-color: var(--accent-mint) !important; }
.predict-improved { background: var(--accent-tint) !important; border-color: rgba(73,190,255,0.32) !important; }
.predict-bar-fill { background: var(--accent-grad) !important; }
.usage-fill { background: var(--accent-mint) !important; }
.usage-fill.warn { background: #fde047 !important; }
.usage-fill.danger { background: #fca5a5 !important; }
.cc-box { background: var(--bg-elev2) !important; border-color: var(--line2) !important; }
.cc-issue { background: var(--bg-deep) !important; }

/* Marketing tab icons (already emoji — keep) */

/* === ICONS — colour the inline SVGs === */
svg { color: currentColor; }

/* Logo SVGs — accent mint stroke + sky fill */
.landing-logo svg path,
.auth-logo svg path,
.mobile-topbar-logo svg path,
.sidebar-logo svg path {
  stroke: var(--accent-sky) !important;
  fill: var(--accent-mint) !important;
}
.landing-logo svg path[fill="none"],
.auth-logo svg path[fill="none"],
.mobile-topbar-logo svg path[fill="none"],
.sidebar-logo svg path[fill="none"] {
  fill: none !important;
}

/* Scrollbar / selection / spinner */
* { scrollbar-color: rgba(73,190,255,0.3) transparent; }
*::-webkit-scrollbar-thumb { background: rgba(73,190,255,0.25); background-clip: padding-box; }
*::-webkit-scrollbar-thumb:hover { background: rgba(19,222,185,0.5); background-clip: padding-box; }
::selection { background: rgba(73,190,255,0.35); color: var(--text2); }
.loading { border-color: rgba(73,190,255,0.2); border-top-color: var(--accent-mint); }

/* === AUTH MODAL === */
.auth-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--line2) !important;
  box-shadow: 0 24px 64px rgba(0,0,0,0.55), 0 1px 0 rgba(19,222,185,0.18) inset !important;
}
.auth-card h1 { color: var(--text2) !important; }
.auth-subtitle { color: var(--text2-muted) !important; }
.auth-divider { color: var(--text2-muted); }
.auth-divider::before, .auth-divider::after { background: var(--line2); }

/* Misc */
code, kbd { background: var(--bg-elev2) !important; color: var(--accent-mint) !important; border-color: var(--line2) !important; }
a { color: var(--accent-sky); }
a:hover { color: var(--accent-mint); }
hr { border-color: var(--line2) !important; }

/* Field hint */
.field-hint { color: var(--text2-muted) !important; }

/* Empty state */
.empty-state { color: var(--text2-muted) !important; }
.empty-state svg { stroke: var(--text2-muted) !important; }

/* Toast accents */
.toast { background: var(--bg-surface) !important; border: 1px solid var(--line2) !important; color: var(--text2) !important; }
.toast.success { border-left: 3px solid var(--accent-mint) !important; }
.toast.error { border-left: 3px solid #fca5a5 !important; }
.toast.info { border-left: 3px solid var(--accent-sky) !important; }

/* Subscription page */
.usage-track { background: var(--bg-elev2) !important; }
.pending-payment { background: rgba(253,224,71,0.08) !important; border-color: rgba(253,224,71,0.32) !important; }

/* Force the body fonts smooth on dark */
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

/* Subtle highlight on h1 italic accent to emphasize gradient */
.view-title .italic, .view-title span.italic {
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* === Combined Meta Integration card (with language switch on top) === */
.meta-integration-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}
.meta-int-section { display: flex; flex-direction: column; }
.meta-int-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2-strong), transparent);
  margin: var(--space-2xs) 0;
}

/* On PC ≥1100px the Meta card spans the full grid row (two columns)
   so the integration guide isn't cramped beside other settings */
@media (min-width: 1100px) {
  .settings-layout .meta-integration-card {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: stretch;
    gap: var(--space-2xl);
  }
  .settings-layout .meta-integration-card .meta-int-section:first-child {
    flex: 0 0 320px;
    border-right: 1px solid var(--line2);
    padding-right: var(--space-xl);
  }
  .settings-layout .meta-integration-card .meta-int-section:last-child {
    flex: 1;
    min-width: 0;
  }
  .settings-layout .meta-integration-card .meta-int-divider { display: none; }
}

@media (min-width: 1400px) {
  .settings-layout .meta-integration-card .meta-int-section:first-child {
    flex: 0 0 380px;
  }
}

/* Language switch redesigned for the combined card */
.lang-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}
.lang-option {
  padding: 12px 14px;
  background: var(--bg-elev2) !important;
  border: 1px solid var(--line2) !important;
  border-radius: var(--radius-md);
  color: var(--text2) !important;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--dur-fast) var(--ease-out);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.lang-option:hover { border-color: var(--accent-sky) !important; color: var(--accent-sky) !important; }
.lang-option.active {
  background: var(--accent-grad) !important;
  color: var(--bg-deep) !important;
  border-color: transparent !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(19,222,185,0.32);
}

/* === PAGE ACCESS TOKEN GUIDE === */
.token-guide {
  background: var(--bg-elev2);
  border: 1px solid var(--line2);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin: var(--space-md) 0;
}
.token-guide summary {
  cursor: pointer;
  color: var(--text2);
  font-size: 14px;
  user-select: none;
  list-style: none;
  display: flex; align-items: center; gap: 8px;
}
.token-guide summary::before {
  content: '▸';
  display: inline-block;
  color: var(--accent-mint);
  transition: transform var(--dur-fast) var(--ease-out);
}
.token-guide[open] summary::before { transform: rotate(90deg); }
.token-guide summary::-webkit-details-marker { display: none; }
.token-steps {
  list-style: none;
  counter-reset: tstep;
  margin: var(--space-md) 0 var(--space-sm);
  padding: 0;
}
.token-steps li {
  counter-increment: tstep;
  position: relative;
  padding: var(--space-sm) var(--space-sm) var(--space-sm) 52px;
  margin-bottom: var(--space-xs);
  background: var(--bg-deep);
  border: 1px solid var(--line2);
  border-radius: var(--radius-md);
  font-size: 13px;
}
.token-steps li::before {
  content: counter(tstep);
  position: absolute;
  left: var(--space-sm);
  top: var(--space-sm);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent-grad);
  color: var(--bg-deep);
  font-weight: 700;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}
.token-steps strong { color: var(--text2); display: block; margin-bottom: 4px; }
.token-steps .step-detail {
  color: var(--text2-muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.token-steps code {
  font-size: 11px;
  padding: 1px 6px;
  background: var(--bg-elev2);
  color: var(--accent-mint);
  border-radius: 4px;
  border: 1px solid var(--line2);
  margin: 0 2px;
}
.token-warn {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(248,113,113,0.10);
  border: 1px solid rgba(248,113,113,0.32);
  border-radius: var(--radius-md);
  color: #fca5a5;
  font-size: 12.5px;
  line-height: 1.55;
}
.token-warn strong { color: #fca5a5; }

/* Token preview card */
.pt-preview { margin: var(--space-md) 0; }
.pt-card {
  display: flex; align-items: center; gap: 12px;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-elev2);
  border: 1px solid var(--accent-mint);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(19,222,185,0.18);
}
.pt-card img { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.pt-noimg {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent-grad);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--bg-deep);
}
.pt-name { font-weight: 600; color: var(--text2); font-size: 15px; }
.pt-handle { font-size: 12px; color: var(--text2-muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.pt-hint {
  padding: 10px 14px;
  background: rgba(73,190,255,0.08);
  border: 1px dashed rgba(73,190,255,0.32);
  border-radius: var(--radius-md);
  color: var(--accent-sky);
  font-size: 12px;
}

@media (max-width: 700px) {
  .token-steps li { padding-left: 46px; }
  .token-steps li::before { width: 24px; height: 24px; font-size: 11px; left: 10px; top: 10px; }
}

/* === Image prompt empty state (when AI didn't auto-generate one) === */
.image-prompt-box.image-prompt-empty {
  background: rgba(73,190,255,0.06);
  border: 1px dashed rgba(73,190,255,0.32);
}
.image-prompt-box.image-prompt-empty p { margin-bottom: var(--space-sm); color: var(--text2-muted); }

/* === Generated image wrapper with fail-safe link === */
.gen-image-wrap { margin: 10px 0; }
.gen-image-link {
  display: inline-block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--accent-sky, #49BEFF);
  text-decoration: none;
}
.gen-image-link:hover { text-decoration: underline; }
.img-fail {
  padding: 14px 16px;
  background: rgba(248,113,113,0.10);
  border: 1px dashed rgba(248,113,113,0.4);
  border-radius: 10px;
  color: #fca5a5;
  font-size: 13px;
  text-align: center;
  margin-bottom: 10px;
}
.img-fail a { color: #fca5a5; text-decoration: underline; word-break: break-all; }

/* === CREDIT PILL (sidebar) === */
.credit-pill {
  display: flex; align-items: center; gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(19,222,185,0.10), rgba(73,190,255,0.10));
  border: 1px solid rgba(19,222,185,0.3);
  border-radius: 10px;
  color: var(--text2);
  cursor: pointer;
  margin-bottom: 8px;
  font-family: inherit;
  transition: all var(--dur-fast) var(--ease-out);
}
.credit-pill:hover { border-color: var(--accent-mint, #13DEB9); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(19,222,185,0.2); }
.credit-pill svg { color: var(--accent-mint, #13DEB9); flex-shrink: 0; }
.credit-pill .credit-label { font-size: 12px; color: var(--text2-muted); flex: 1; text-align: left; }
.credit-pill .credit-balance {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  background: linear-gradient(135deg, #13DEB9 0%, #49BEFF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* === CREDIT CARD (subscription view) === */
.credit-card { padding: 20px; }
.credit-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.credit-big {
  font-size: 36px; font-weight: 700; line-height: 1.1;
  background: linear-gradient(135deg, #13DEB9 0%, #49BEFF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-family: 'JetBrains Mono', monospace;
  margin: 4px 0;
}
.credit-history { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line2); }
.credit-history summary { cursor: pointer; padding: 4px 0; }
.credit-plus { color: var(--accent-mint, #13DEB9); font-weight: 600; }
.credit-minus { color: #fca5a5; font-weight: 600; }

/* === PACK GRID (buy credits modal) === */
.pack-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
  margin: 14px 0;
}
.pack-card {
  padding: 18px 14px;
  background: var(--bg-elev2);
  border: 1px solid var(--line2);
  border-radius: 14px;
  text-align: center;
  transition: all var(--dur-fast) var(--ease-out);
}
.pack-card:hover { border-color: var(--accent-sky, #49BEFF); transform: translateY(-2px); }
.pack-card.pack-highlight {
  border-color: var(--accent-mint, #13DEB9);
  box-shadow: 0 0 0 2px rgba(19,222,185,0.15);
}
.pack-credits {
  font-size: 32px; font-weight: 700;
  background: linear-gradient(135deg, #13DEB9 0%, #49BEFF 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-family: 'JetBrains Mono', monospace;
  line-height: 1;
}
.pack-credits-label { font-size: 11px; color: var(--text2-muted); margin: 4px 0 12px; text-transform: uppercase; letter-spacing: 0.08em; }
.pack-price { font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.pack-actions { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

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

/* === DASHBOARD QUICK ACTIONS + ONBOARDING === */
.dash-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
.dash-qa {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-surface) !important;
  border: 1px solid var(--line2) !important;
  border-radius: var(--radius-md);
  color: var(--text2) !important;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all var(--dur-fast) var(--ease-out);
}
.dash-qa:hover { border-color: var(--accent-sky) !important; transform: translateY(-2px); box-shadow: var(--shadow-deep); }
.dash-qa > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-qa strong { font-size: 14px; }
.dash-qa-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius-md);
  font-size: 22px;
  flex-shrink: 0;
}

.onboarding-card {
  display: grid; grid-template-columns: 80px 1fr; gap: var(--space-lg);
  padding: var(--space-lg);
  background: linear-gradient(135deg, rgba(19,222,185,0.10), rgba(73,190,255,0.06));
  border: 1px solid rgba(19,222,185,0.32);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
}
.onb-icon { font-size: 64px; text-align: center; line-height: 1; }
.onb-body h3 { margin: 0 0 4px; }
.onb-body p { margin: 0 0 var(--space-md); color: var(--text2-muted); }
.onb-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-sm); }
.onb-step {
  display: flex; align-items: center; gap: 12px;
  padding: 14px;
  background: var(--bg-surface);
  border: 1px solid var(--line2);
  border-radius: var(--radius-md);
  color: var(--text2);
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: all var(--dur-fast) var(--ease-out);
}
.onb-step:hover { border-color: var(--accent-mint); transform: translateX(2px); }
.onb-step > div { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.onb-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: var(--accent-grad);
  color: var(--bg-deep);
  font-weight: 700;
  border-radius: 50%;
  font-family: 'JetBrains Mono', monospace;
  flex-shrink: 0;
}

@media (max-width: 700px) {
  .onboarding-card { grid-template-columns: 1fr; text-align: center; }
  .onb-icon { font-size: 48px; }
  .dash-quick-actions { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .dash-quick-actions { grid-template-columns: 1fr; }
}

/* === SIDEBAR ROW (credit + bell) === */
.sidebar-row { display: flex; gap: 6px; align-items: stretch; margin-bottom: 8px; }
.bell-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px;
  background: var(--bg-elev2);
  border: 1px solid var(--line2);
  border-radius: 10px;
  color: var(--text2-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.bell-btn:hover { border-color: var(--accent-sky); color: var(--accent-sky); }
.bell-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-surface), 0 0 8px rgba(19,222,185,0.6);
  animation: bellPulse 1.6s ease-in-out infinite;
}
@keyframes bellPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* === NOTIFICATION POPOVER === */
.notif-popover {
  position: fixed; z-index: 1500;
  width: 360px; max-width: calc(100vw - 32px);
  background: var(--bg-surface);
  border: 1px solid var(--line2);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  max-height: 60vh; overflow: hidden;
  display: flex; flex-direction: column;
  animation: notifIn 0.18s var(--ease-spring);
}
@keyframes notifIn { from { opacity: 0; transform: translateY(-92%) scale(0.96); } to { opacity: 1; transform: translateY(-100%) scale(1); } }
.notif-head { padding: 14px 16px; border-bottom: 1px solid var(--line2); }
.notif-body { padding: 4px; overflow-y: auto; flex: 1; }
.notif-row {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line2);
  font-size: 13px;
}
.notif-row:last-child { border-bottom: none; }
.notif-msg { color: var(--text2); }
.notif-time { font-size: 11px; color: var(--text2-muted); margin-top: 2px; font-family: 'JetBrains Mono', monospace; }
.notif-empty { padding: 32px 16px; text-align: center; color: var(--text2-muted); font-size: 13px; }

/* === Account card — security section inside === */
.account-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2-strong), transparent);
  margin: var(--space-lg) 0 var(--space-md);
}
.account-sub-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text2);
  margin: 0 0 var(--space-sm);
}
.account-security-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}
.account-security-row .btn { width: 100%; min-height: 44px; }
.account-security-row .danger-btn {
  border-color: rgba(248,113,113,0.4) !important;
  color: #fca5a5 !important;
}
.account-security-row .danger-btn:hover {
  background: rgba(248,113,113,0.08) !important;
  border-color: #fca5a5 !important;
}

@media (max-width: 600px) {
  .account-security-row { grid-template-columns: 1fr; }
}

/* === Settings layout — even rhythm across all cards === */
@media (min-width: 1100px) {
  .settings-layout {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    align-items: stretch;
  }
  /* Meta integration card spans full row at top */
  .settings-layout > .card.meta-integration-card { grid-column: 1 / -1; }
  /* Account card spans full row too (it has the most content) */
  .settings-layout > .card:nth-of-type(2) { grid-column: 1 / -1; }
  /* Account + Security inside one card, but display in 2 columns of content */
  .settings-layout > .card:nth-of-type(2) .form-group:not(:has(textarea)) {
    /* nothing — let them stack natively */
  }
}

@media (min-width: 1400px) {
  .settings-layout { grid-template-columns: 1fr 1fr 1fr; }
  .settings-layout > .card.meta-integration-card { grid-column: 1 / -1; }
  .settings-layout > .card:nth-of-type(2) { grid-column: 1 / 3; }   /* Account spans 2 of 3 cols */
}

/* Force form-groups inside cards to flow naturally without lonely whitespace */
.settings-layout > .card .form-group input,
.settings-layout > .card .form-group textarea,
.settings-layout > .card .form-group select {
  width: 100%;
}

/* On PC ≥1100px, render account + brand in 2 columns inside the card */
@media (min-width: 1100px) {
  .settings-layout > .card:nth-of-type(2) > .form-group:nth-child(3),
  .settings-layout > .card:nth-of-type(2) > .form-group:nth-child(4),
  .settings-layout > .card:nth-of-type(2) > .form-group:nth-child(5),
  .settings-layout > .card:nth-of-type(2) > .form-group:nth-child(6) {
    /* placeholder for future 2-col adjustments — currently linear */
  }
}

/* === SETTINGS TABS === */
.settings-tabs {
  display: flex;
  gap: var(--space-2xs);
  margin-bottom: var(--space-lg);
  padding: var(--space-2xs);
  background: var(--bg-elev2);
  border: 1px solid var(--line2);
  border-radius: 14px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab {
  flex-shrink: 0;
  padding: 10px 18px;
  background: transparent;
  border: none;
  border-radius: 10px;
  color: var(--text2-muted);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--dur-fast) var(--ease-out);
}
.settings-tab:hover { color: var(--text2); background: rgba(255,255,255,0.03); }
.settings-tab.active {
  background: var(--accent-grad);
  color: var(--bg-deep) !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(19,222,185,0.25);
}

/* Settings tab panes — hide nested renderAccounts header (it's redundant
   when nested inside Settings) */
.settings-tab-pane > .view-header,
.settings-tab-pane .view-header { display: none; }

/* The accounts mount point can grow naturally */
#settings-accounts-mount { min-height: 200px; }

/* Spacing inside tab panes — settings-layout already handles columns */
.settings-tab-pane { padding-top: var(--space-xs); }

/* Mobile — tabs scroll horizontally with a soft fade hint */
@media (max-width: 700px) {
  .settings-tabs {
    border-radius: 10px;
    padding: 3px;
    position: relative;
  }
  .settings-tab { padding: 8px 14px; font-size: 13px; }
}

/* ======================================================================
   📌 SIDEBAR FOOTER — final responsive layout
   ====================================================================== */

.sidebar-footer {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  padding: 12px !important;
  margin-top: auto;
  background: var(--bg-surface);
  border: 1px solid var(--line2);
  border-radius: 14px;
}

/* Credit pill — full width across the footer top */
.sidebar-footer .credit-pill {
  width: 100%;
  margin-bottom: 0 !important;
  padding: 9px 12px !important;
}

/* User info — compact card */
.sidebar-footer .user-info {
  display: flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px !important;
  background: var(--bg-elev2) !important;
  border: 1px solid var(--line2);
  border-radius: 10px;
}
.sidebar-footer .user-avatar {
  width: 36px; height: 36px;
  font-size: 14px;
  flex-shrink: 0;
}
.sidebar-footer .user-details {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sidebar-footer .user-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-footer .user-email {
  font-size: 11px;
  color: var(--text2-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action row — equal-width icon buttons */
.footer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}
.footer-icon-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px;
  padding: 8px;
  background: var(--bg-elev2);
  border: 1px solid var(--line2);
  border-radius: 8px;
  color: var(--text2-muted);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.footer-icon-btn:hover {
  border-color: var(--accent-sky);
  color: var(--accent-sky);
  background: var(--accent-soft);
}
.footer-icon-btn.danger:hover {
  border-color: #fca5a5;
  color: #fca5a5;
  background: rgba(248,113,113,0.10);
}
.footer-icon-btn .bell-dot {
  position: absolute; top: 6px; right: 6px;
  width: 8px; height: 8px;
  background: var(--accent-mint);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--bg-elev2), 0 0 6px rgba(19,222,185,0.6);
  animation: bellPulse 1.6s ease-in-out infinite;
}

/* Hide legacy classes that may still be in older browser caches */
.btn-lang, .btn-logout, .bell-btn:not(.footer-icon-btn) {
  display: none !important;
}
.sidebar-row { display: contents; } /* kill old wrapper if present */

/* === Mobile / drawer view (<= 900px) === */
@media (max-width: 900px) {
  .sidebar-footer {
    margin-top: auto;
    padding: 10px !important;
    gap: 6px;
  }
  .footer-actions { gap: 5px; }
  .footer-icon-btn { min-height: 38px; }
}

/* === Compact phone (≤ 380px wide drawer) === */
@media (max-width: 400px) {
  .sidebar-footer .credit-pill { padding: 7px 10px !important; font-size: 12px; }
  .sidebar-footer .user-info { padding: 8px !important; }
  .sidebar-footer .user-avatar { width: 32px; height: 32px; font-size: 13px; }
}

/* ======================================================================
   🔒 LANDING PAGE — lock horizontal scroll + contain ambient blobs
   ====================================================================== */

/* Hard lock horizontal overflow everywhere on the landing screen */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Body itself never scrolls horizontally — even from rogue children */
body { width: 100%; }

/* Auth screen (landing wrapper) is the scroll context */
.auth-screen {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Landing hero clips its decorative blobs so they can't extend past
   the viewport and create horizontal swipe space */
.landing-hero {
  width: 100% !important;
  max-width: 100vw !important;
  overflow-x: hidden;
  box-sizing: border-box;
  padding-left: clamp(16px, 5vw, 48px) !important;
  padding-right: clamp(16px, 5vw, 48px) !important;
}

/* Ambient blob safety — keep them inside the viewport on mobile.
   These were the main culprit of "swipeable" landing pages: width:480px
   with left:-120px overflows on screens <360px wide. */
.landing-hero::before {
  max-width: 80vw;
  max-height: 80vw;
  left: clamp(-160px, -10vw, -40px);
}
.landing-hero::after {
  max-width: 80vw;
  max-height: 80vw;
  right: clamp(-160px, -10vw, -40px);
}

/* Every section inside the hero respects the container width */
.landing-nav,
.landing-hero-content,
.landing-features,
.landing-pricing,
.pricing-grid,
.hero-cta {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

/* Make sure long hero headlines don't push the viewport */
.landing-hero-content h1,
.landing-hero-content p,
.hero-sub {
  max-width: 100%;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Auth modal never causes horizontal scroll either */
.auth-modal {
  max-width: 100vw;
  box-sizing: border-box;
}

/* Fix the sticky landing-nav background so the blur covers full width */
.landing-nav {
  margin-left: calc(-1 * clamp(16px, 5vw, 48px));
  margin-right: calc(-1 * clamp(16px, 5vw, 48px));
  padding-left: clamp(16px, 5vw, 48px);
  padding-right: clamp(16px, 5vw, 48px);
  width: auto;
}

/* === Mobile (<= 700px) — tighter still === */
@media (max-width: 700px) {
  .landing-hero {
    padding-left: 16px !important;
    padding-right: 16px !important;
  }
  .landing-nav {
    margin-left: -16px;
    margin-right: -16px;
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .landing-nav-actions { gap: 6px; flex-wrap: nowrap; }
  .landing-nav-actions a:not(.btn) { display: none; }
  .landing-nav-actions .btn { flex: 1; min-width: 0; padding: 8px 12px; font-size: 13px; }
  .landing-logo { font-size: 18px; gap: 6px; }
  .landing-logo svg { width: 28px; height: 28px; }

  .landing-hero-content { padding: 32px 0 40px; }
  .landing-hero-content h1 {
    font-size: clamp(1.65rem, 7vw, 2.2rem);
    line-height: 1.2;
    letter-spacing: -0.02em;
  }
  .hero-sub { font-size: 0.95rem; padding: 0; margin-bottom: 24px; }
  .hero-cta { flex-direction: column; gap: 10px; padding: 0; }
  .hero-cta .btn { width: 100%; }

  .landing-features { gap: 12px; margin: 32px 0 48px; grid-template-columns: 1fr; }
  .landing-feature { padding: 20px 16px; }

  .landing-pricing h2 { font-size: 1.5rem; }
  .pricing-sub { font-size: 0.9rem; }
  .pricing-grid { grid-template-columns: 1fr; gap: 12px; }
  .pricing-card { padding: 22px 18px; }

  /* Reduce blob brightness on mobile so they don't look like the page is glitching */
  .landing-hero::before, .landing-hero::after { opacity: 0.25; filter: blur(60px); }
}

/* === Tiny phones (<= 380px) === */
@media (max-width: 380px) {
  .landing-hero {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .landing-hero-content h1 { font-size: 1.5rem; }
  .landing-nav-actions .btn { padding: 7px 10px; font-size: 12px; }
}

/* === Safe area insets (iPhone notch) === */
.auth-screen {
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ======================================================================
   🔑 GOOGLE SIGN-IN — custom-styled button stacked over the real one
   ====================================================================== */

/* Stack container: our pretty button on top, real Google button below
   (invisible but interactive, handles Google's security checks) */
.google-btn-stack {
  position: relative;
  height: 50px;
  margin-bottom: 14px;
}

/* The button users actually see — fully themed to match navy + accent */
.custom-google-btn {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  gap: 12px;
  padding: 0 18px;
  background: var(--bg-elev2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  color: var(--text2);
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  user-select: none;
  pointer-events: none;       /* clicks pass through to the real button */
  transition: all 0.18s var(--ease-out);
  z-index: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* React to hover/active on the stack so the styling animates naturally
   when the user hovers (the real Google button below catches the events) */
.google-btn-stack:hover .custom-google-btn {
  border-color: var(--accent-sky);
  background: linear-gradient(135deg, rgba(19,222,185,0.08), rgba(73,190,255,0.08));
  box-shadow: 0 6px 18px rgba(19,222,185,0.18);
  transform: translateY(-1px);
}
.google-btn-stack:active .custom-google-btn {
  transform: translateY(0) scale(0.99);
  box-shadow: 0 2px 6px rgba(19,222,185,0.18);
}

.custom-google-btn svg { flex-shrink: 0; }
.custom-google-btn span { letter-spacing: 0.01em; }

/* The real Google button — invisible but receives clicks. Stretched to
   fill the stack so any click on the visible custom button is captured. */
.google-btn-real {
  position: absolute; inset: 0;
  z-index: 2;
  opacity: 0;
  cursor: pointer;
}
.google-btn-real > div,
.google-btn-real iframe {
  width: 100% !important;
  height: 100% !important;
  min-width: 100% !important;
}
/* On mobile some viewports the inner iframe is narrower than the wrapper —
   stretch it so the whole visual area is clickable */
.google-btn-real * { width: 100% !important; }

/* Divider style refresh — match the brand */
.auth-divider {
  display: flex; align-items: center;
  gap: 12px;
  margin: 12px 0;
  color: var(--text2-muted);
  font-size: 11px;
  text-transform: lowercase;
  letter-spacing: 0.08em;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line2-strong), transparent);
}
.auth-divider span { padding: 0 4px; }

@media (max-width: 480px) {
  .google-btn-stack { height: 48px; }
  .custom-google-btn { font-size: 14px; padding: 0 14px; gap: 10px; }
}

/* ======================================================================
   🏁 LANDING PAGE — Complete responsive rebuild (mobile-first)
   This is the canonical layer — overrides all prior landing styles
   ====================================================================== */

/* === Page scroll lock + safe areas === */
html, body {
  overflow-x: clip;
  max-width: 100vw;
  scroll-behavior: smooth;
}

/* === Landing screen container === */
.auth-screen {
  width: 100% !important;
  max-width: 100vw !important;
  min-height: 100vh;
  min-height: 100dvh;        /* honor mobile dynamic viewport (notch/url bar) */
  overflow-x: clip !important;
  padding: 0 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-deep);
}

/* === Hero section — full-bleed background, contained content === */
.landing-hero {
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: clip;
  isolation: isolate;        /* contain z-index of ambient blobs */
}

/* Inner content uses a sensible max-width so it doesn't sprawl on 4K */
.landing-hero > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 4vw, 40px);
  padding-right: clamp(16px, 4vw, 40px);
  box-sizing: border-box;
  width: 100%;
}

/* === STICKY NAV BAR === */
.landing-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 2vw, 24px);
  padding-top: max(12px, env(safe-area-inset-top));
  padding-bottom: 12px;
  background: rgba(10, 15, 28, 0.88);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--line2);
  max-width: 100% !important;            /* nav goes edge-to-edge */
}
.landing-nav > * { margin: 0; }

.landing-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(16px, 2.5vw, 20px);
  color: var(--text2);
}
.landing-logo svg {
  width: clamp(28px, 4vw, 36px);
  height: clamp(28px, 4vw, 36px);
  flex-shrink: 0;
}

.landing-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: clamp(6px, 1.5vw, 18px);
}
.landing-nav-actions a:not(.btn) {
  color: var(--text2-muted);
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.15s;
}
.landing-nav-actions a:not(.btn):hover { color: var(--accent-sky); }
.landing-nav-actions .btn {
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  min-height: 38px;
}

/* === HERO HEADING === */
.landing-hero-content {
  text-align: center;
  padding-top: clamp(40px, 8vh, 96px);
  padding-bottom: clamp(48px, 10vh, 96px);
  position: relative;
  z-index: 1;
}
.landing-hero-content h1 {
  font-size: clamp(1.75rem, 6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(16px, 3vw, 24px);
  color: var(--text2);
}
.landing-hero-content h1 br + .hero-accent { display: inline-block; }
.hero-accent {
  background: var(--accent-grad) !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  color: transparent !important;
}
.hero-sub {
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  line-height: 1.55;
  color: var(--text2-muted);
  max-width: 640px;
  margin: 0 auto clamp(24px, 4vw, 40px);
}

/* === CTA buttons === */
.hero-cta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
}
.hero-cta .btn {
  flex: 1 1 auto;
  min-width: 200px;
  min-height: 50px;
  padding: 14px 24px;
  font-size: clamp(14px, 1.6vw, 15px);
}

/* === FEATURES GRID === */
.landing-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(12px, 2vw, 20px);
  margin-top: clamp(32px, 6vw, 56px);
  margin-bottom: clamp(48px, 8vw, 80px);
}

.landing-feature {
  padding: clamp(20px, 3vw, 28px);
  background: var(--bg-surface);
  border: 1px solid var(--line2);
  border-radius: 16px;
  text-align: left;
  transition: transform 0.25s var(--ease-out), border-color 0.2s, box-shadow 0.25s;
}
.landing-feature:hover {
  transform: translateY(-4px);
  border-color: var(--accent-sky);
  box-shadow: var(--shadow-glow);
}
.landing-feature .feat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px; height: 52px;
  border-radius: 14px;
  font-size: 26px;
  margin-bottom: 14px;
  background: var(--accent-soft);
  border: 1px solid rgba(73, 190, 255, 0.25);
}
.landing-feature h3 {
  margin: 0 0 8px;
  font-size: clamp(1rem, 2vw, 1.15rem);
  font-weight: 600;
  color: var(--text2);
}
.landing-feature p {
  margin: 0;
  font-size: clamp(0.85rem, 1.6vw, 0.95rem);
  line-height: 1.55;
  color: var(--text2-muted);
}

/* === PRICING === */
.landing-pricing {
  text-align: center;
  padding-top: clamp(24px, 5vw, 48px);
  padding-bottom: clamp(64px, 10vh, 120px);
}
.landing-pricing h2 {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--text2);
}
.pricing-sub {
  color: var(--text2-muted);
  margin-bottom: clamp(24px, 4vw, 40px);
  font-size: clamp(0.9rem, 1.6vw, 1rem);
}
.pricing-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(14px, 2vw, 20px);
  max-width: 980px;
  margin: 0 auto;
}

/* === AMBIENT BLOBS — fully contained, mobile-safe === */
.landing-hero::before,
.landing-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: -1;
  will-change: transform;
}
.landing-hero::before {
  width: clamp(280px, 50vw, 480px);
  height: clamp(280px, 50vw, 480px);
  top: -10vh;
  left: -10vw;
  background: radial-gradient(circle, rgba(19, 222, 185, 0.30), transparent 70%);
  opacity: 0.5;
  animation: blobFloat1 18s ease-in-out infinite;
}
.landing-hero::after {
  width: clamp(260px, 45vw, 420px);
  height: clamp(260px, 45vw, 420px);
  top: 15vh;
  right: -10vw;
  background: radial-gradient(circle, rgba(73, 190, 255, 0.26), transparent 70%);
  opacity: 0.5;
  animation: blobFloat2 22s ease-in-out infinite;
}
@keyframes blobFloat1 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(3vw, 2vh); }
}
@keyframes blobFloat2 {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(-3vw, 3vh); }
}

/* === BREAKPOINTS === */

/* Small phones (≤480px) — tight & vertical */
@media (max-width: 480px) {
  .landing-nav-actions a:not(.btn) { display: none; }
  .landing-nav-actions .btn { padding: 7px 12px; font-size: 12px; min-height: 36px; }
  .hero-cta { flex-direction: column; max-width: 100%; }
  .hero-cta .btn { width: 100%; min-width: 0; }
  .landing-hero-content { padding-top: 32px; padding-bottom: 40px; }
  .landing-hero::before, .landing-hero::after {
    opacity: 0.22;
    filter: blur(50px);
  }
}

/* Tablet portrait (481-768) — 2-col features */
@media (min-width: 481px) and (max-width: 768px) {
  .landing-features { grid-template-columns: repeat(2, 1fr); }
}

/* Tablet landscape / small laptop (769-1023) — 2-col features, 3-col pricing */
@media (min-width: 769px) {
  .landing-features { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Desktop (≥1024px) — 4-col features */
@media (min-width: 1024px) {
  .landing-features { grid-template-columns: repeat(4, 1fr); }
}

/* Ultra-wide (≥1600px) — cap container even larger */
@media (min-width: 1600px) {
  .landing-hero > * { max-width: 1320px; }
}

/* === LANDSCAPE PHONES (short height, compact hero) === */
@media (max-width: 900px) and (orientation: landscape) and (max-height: 500px) {
  .landing-hero-content { padding-top: 20px; padding-bottom: 28px; }
  .landing-hero-content h1 { font-size: 1.8rem; margin-bottom: 12px; }
  .hero-sub { font-size: 0.9rem; margin-bottom: 18px; }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .landing-hero::before, .landing-hero::after { animation: none !important; }
  .landing-feature { transition: none !important; }
}

/* === Hide stale rules that conflicted with the rebuild === */
.landing-hero { padding-left: 0 !important; padding-right: 0 !important; }

/* ======================================================================
   🔍 COMPETITOR TRACKING
   ====================================================================== */
.comp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.comp-card {
  background: var(--fb-card, #fff);
  border: 1px solid var(--fb-border, #ced0d4);
  border-radius: var(--radius-lg, 14px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.comp-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  border-color: var(--fb-blue, #1877f2);
}
.comp-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.comp-head strong { display: block; font-size: 1.02rem; color: var(--fb-text, #050505); }
.comp-head .badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  font-size: 0.72rem;
  background: var(--fb-light, #f0f2f5);
  border-radius: 999px;
  color: var(--fb-text-2, #65676b);
}
.comp-actions { display: flex; gap: 4px; flex-shrink: 0; }
.comp-actions .btn-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  border: 1px solid var(--fb-border, #ced0d4);
  background: transparent;
  color: var(--fb-text-2, #65676b);
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.comp-actions .btn-icon:hover { background: var(--fb-light, #f0f2f5); }
.comp-actions .btn-icon.danger:hover { background: #fde8ea; color: var(--danger, #e41e3f); border-color: var(--danger, #e41e3f); }
.comp-url {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
  color: var(--fb-blue, #1877f2);
}
.comp-stats {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-top: 1px dashed var(--fb-border, #ced0d4);
  border-bottom: 1px dashed var(--fb-border, #ced0d4);
}
.comp-stats strong { font-size: 1.1rem; color: var(--fb-text, #050505); }
.comp-foot { display: flex; gap: 8px; flex-wrap: wrap; }
.comp-foot .btn { flex: 1; min-width: 120px; }

/* Competitor posts list inside dialog */
.cp-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--fb-border, #ced0d4);
  border-radius: 8px;
  margin-bottom: 8px;
}
.cp-content {
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--fb-text, #050505);
}
.cp-stats {
  display: flex;
  gap: 10px;
  font-size: 0.85rem;
  white-space: nowrap;
  color: var(--fb-text-2, #65676b);
}
@media (max-width: 600px) {
  .cp-row { grid-template-columns: 1fr; }
}

/* AI Insights blocks */
.insight-block {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--fb-blue, #1877f2);
  background: var(--fb-light, #f0f2f5);
  border-radius: 0 8px 8px 0;
}
.insight-block h4 { margin: 0 0 6px; font-size: 0.95rem; color: var(--fb-text, #050505); }
.insight-block ul { margin: 0; padding-left: 18px; }
.insight-block li { margin: 4px 0; line-height: 1.45; }
.insight-block p { margin: 0; line-height: 1.5; }
.insight-wins { border-left-color: var(--success, #31a24c); }
.insight-gaps { border-left-color: var(--warning, #f7b928); }
.insight-recs { border-left-color: var(--fb-blue, #1877f2); background: rgba(24, 119, 242, 0.08); }

/* ======================================================================
   🎨 IMAGE EDITOR
   ====================================================================== */
.image-editor-box {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}
.ie-toolbar {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--fb-light, #f0f2f5);
  border-bottom: 1px solid var(--fb-border, #ced0d4);
  align-items: center;
}
.ie-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.ie-group label {
  font-size: 0.82rem;
  color: var(--fb-text-2, #65676b);
  white-space: nowrap;
  margin: 0;
}
.ie-group select,
.ie-group input[type="text"] {
  padding: 6px 10px;
  border: 1px solid var(--fb-border, #ced0d4);
  border-radius: 6px;
  background: #fff;
  color: var(--fb-text, #050505);
  font-size: 0.9rem;
  font-family: inherit;
}
.ie-group input[type="color"] {
  width: 32px;
  height: 32px;
  border: 1px solid var(--fb-border, #ced0d4);
  border-radius: 6px;
  cursor: pointer;
  padding: 2px;
  background: #fff;
}
.ie-canvas {
  display: block;
  margin: 16px auto;
  background: repeating-conic-gradient(#e5e7eb 0% 25%, #f3f4f6 0% 50%) 50% / 20px 20px;
  border-radius: 6px;
  cursor: move;
  max-width: 100%;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}
.ie-footer {
  display: flex;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid var(--fb-border, #ced0d4);
  background: var(--fb-light, #f0f2f5);
  justify-content: flex-end;
  flex-wrap: wrap;
}
.ie-footer .btn { min-width: 120px; }
@media (max-width: 600px) {
  .ie-toolbar { gap: 10px; padding: 10px; }
  .ie-group input[type="text"] { width: 140px !important; }
  .ie-footer .btn { flex: 1; min-width: 0; }
}

/* ======================================================================
   ✨ LANDING HERO — AI Digital animated headline (constant motion)
   ====================================================================== */

/* Animated flowing gradient on the accent line */
.hero-accent {
  background: linear-gradient(
    90deg,
    #1877F2 0%,
    #0EA5E9 20%,
    #8B5CF6 40%,
    #EC4899 60%,
    #F59E0B 80%,
    #1877F2 100%
  ) !important;
  background-size: 300% 100% !important;
  -webkit-background-clip: text !important;
  background-clip: text !important;
  color: transparent !important;
  animation: aiHueFlow 7s linear infinite;
  position: relative;
  display: inline-block;
  text-shadow: 0 0 30px rgba(24, 119, 242, 0.25);
  filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.3));
}
@keyframes aiHueFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* Subtle "breathing" lift on the headline */
.landing-hero-content h1 {
  position: relative;
  animation: heroFloat 6s ease-in-out infinite;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.landing-hero-content h1:hover {
  transform: translateY(-10px) scale(1.015);
}
.landing-hero-content h1:hover .hero-accent {
  animation-duration: 2.5s;
  filter: drop-shadow(0 0 22px rgba(139, 92, 246, 0.6))
          drop-shadow(0 0 8px rgba(236, 72, 153, 0.4));
}

/* Animated "scan line" sweep across the headline */
.landing-hero-content h1::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 30%,
    rgba(255, 255, 255, 0.45) 50%,
    transparent 70%
  );
  background-size: 200% 100%;
  background-position: -100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  pointer-events: none;
  animation: heroScan 4.5s ease-in-out infinite;
}
@keyframes heroScan {
  0%        { background-position: -120% 0; }
  60%, 100% { background-position: 220% 0; }
}

/* Subhead — soft pulse on opacity + tiny float */
.hero-sub {
  animation: heroSubPulse 5s ease-in-out infinite;
  transition: color 0.3s ease, transform 0.3s ease, letter-spacing 0.4s ease;
}
@keyframes heroSubPulse {
  0%, 100% { opacity: 0.85; transform: translateY(0); }
  50%      { opacity: 1;    transform: translateY(-2px); }
}
.hero-sub:hover {
  color: var(--fb-blue);
  transform: translateY(-2px);
  letter-spacing: 0.012em;
}

/* Animated platform-name pills inside subhead text (Facebook / IG / TikTok / X / LINE)
   — we wrap them via a ::selection-like glow; here we just give the whole sub a
   shimmering underline that appears on hover */
.hero-sub::after {
  content: '';
  display: block;
  height: 2px;
  width: 0;
  margin: 10px auto 0;
  background: linear-gradient(90deg, transparent, #1877F2, #8B5CF6, #EC4899, transparent);
  background-size: 200% 100%;
  border-radius: 2px;
  transition: width 0.5s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1));
  animation: heroUnderlineFlow 4s linear infinite;
}
.landing-hero-content:hover .hero-sub::after {
  width: 72%;
}
@keyframes heroUnderlineFlow {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

/* Floating AI orbs in the hero background — pure CSS, GPU-friendly */
.landing-hero-content {
  position: relative;
  overflow: visible;
}
.landing-hero-content::before,
.landing-hero-content::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.55;
}
.landing-hero-content::before {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(24, 119, 242, 0.55), transparent 70%);
  top: 10%; left: 8%;
  animation: orbDrift1 12s ease-in-out infinite;
}
.landing-hero-content::after {
  width: 260px; height: 260px;
  background: radial-gradient(circle, rgba(236, 72, 153, 0.45), transparent 70%);
  bottom: 5%; right: 6%;
  animation: orbDrift2 14s ease-in-out infinite;
}
@keyframes orbDrift1 {
  0%, 100% { transform: translate(0, 0)         scale(1); }
  33%      { transform: translate(40px, -30px)  scale(1.1); }
  66%      { transform: translate(-30px, 25px)  scale(0.95); }
}
@keyframes orbDrift2 {
  0%, 100% { transform: translate(0, 0)         scale(1); }
  33%      { transform: translate(-40px, 30px)  scale(1.08); }
  66%      { transform: translate(35px, -20px)  scale(0.95); }
}

/* Keep text crisply on top of the orbs */
.landing-hero-content h1,
.hero-sub,
.hero-cta { position: relative; z-index: 1; }

/* Hero CTA buttons — magnetic hover with neon shadow */
.hero-cta .btn-primary {
  position: relative;
  box-shadow: 0 6px 24px rgba(24, 119, 242, 0.35);
  transition:
    transform 0.25s var(--ease-out, cubic-bezier(0.22, 0.61, 0.36, 1)),
    box-shadow 0.3s ease;
}
.hero-cta .btn-primary:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow:
    0 12px 32px rgba(24, 119, 242, 0.5),
    0 0 24px rgba(139, 92, 246, 0.35);
}
.hero-cta .btn-outline {
  transition:
    transform 0.25s ease,
    border-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease;
}
.hero-cta .btn-outline:hover {
  transform: translateY(-3px);
  border-color: #8B5CF6;
  color: #8B5CF6;
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.25);
}

/* Reduced-motion friendliness — turn off the infinite animations only */
@media (prefers-reduced-motion: reduce) {
  .hero-accent,
  .landing-hero-content h1,
  .landing-hero-content h1::after,
  .hero-sub,
  .hero-sub::after,
  .landing-hero-content::before,
  .landing-hero-content::after {
    animation: none !important;
  }
}

/* ======================================================================
   🇱🇦 LAO LANGUAGE MODE — force Noto Sans Lao everywhere
   When the user switches to Lao, i18n sets <html lang="lo">. The default
   theme uses 'Fraunces' (serif) for headings/logo and 'JetBrains Mono' for
   code/numbers — neither renders Lao glyphs. Override every element so all
   text uses Noto Sans Lao.
   ====================================================================== */
html[lang="lo"],
html[lang="lo"] body,
html[lang="lo"] *,
html[lang="lo"] *::before,
html[lang="lo"] *::after {
  font-family: 'Noto Sans Lao', 'Noto Sans Thai', system-ui, sans-serif !important;
}

/* === Autopilot page — compact layout === */
.autopilot-wrap {
  max-width: 640px;
  margin: 0 auto;
}
.autopilot-wrap .view-header-compact {
  margin-bottom: 12px;
}
.autopilot-wrap .view-header-compact .view-title {
  font-size: clamp(1.4rem, 3.5vw, 1.8rem);
  margin-bottom: 2px;
}
.autopilot-wrap .view-header-compact .view-subtitle {
  font-size: 0.88rem;
}
.autopilot-wrap .card {
  padding: 14px 16px;
}
.autopilot-wrap .form-group { margin-bottom: 0; }
.autopilot-wrap .form-group label {
  font-size: 12.5px;
  margin-bottom: 4px;
}
.autopilot-wrap .form-group input[type="text"],
.autopilot-wrap .form-group input[type="number"],
.autopilot-wrap .form-group select,
.autopilot-wrap .form-group textarea {
  padding: 8px 10px;
  font-size: 13px;
}
.autopilot-wrap .form-group small {
  font-size: 11.5px;
  margin-top: 4px;
  display: block;
  line-height: 1.45;
}
.autopilot-wrap .check-pill {
  padding: 4px 10px;
  font-size: 13px;
}
@media (max-width: 600px) {
  .autopilot-wrap { max-width: 100%; }
  .autopilot-wrap .card { padding: 12px; }
}

/* === Facebook login button (auth modal) === */
.fb-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: #1877F2;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  margin-top: 10px;
  transition: background-color .15s ease, transform .12s ease, box-shadow .2s ease;
}
.fb-login-btn:hover {
  background: #166FE5;
  box-shadow: 0 4px 14px rgba(24, 119, 242, 0.4);
}
.fb-login-btn:active { transform: scale(0.98); }
.fb-login-btn svg { flex-shrink: 0; }
