/* Mobile-first subscriber panel */
.sub-layout { display: flex; flex-direction: column; min-height: 100vh; padding-bottom: 70px; }

/* Top nav */
.sub-topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}
.sub-topnav-brand { font-size: 18px; font-weight: 800; color: var(--primary); flex: 1; }
.sub-topnav-actions { display: flex; align-items: center; gap: 6px; }

/* Bottom nav */
.sub-bottomnav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 64px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}
.sub-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
  color: var(--text-light);
  font-size: 10px;
  font-weight: 600;
  transition: all var(--transition);
  text-decoration: none;
  position: relative;
}
.sub-nav-item .nav-icon { font-size: 22px; line-height: 1; }
.sub-nav-item.active { color: var(--primary); }
.sub-nav-item.active .nav-icon { transform: scale(1.1); }
.sub-nav-badge { position: absolute; top: 4px; right: calc(50% - 18px); background: var(--danger); color: #fff; font-size: 9px; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }

/* Feed */
.sub-feed { padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.post-item { background: var(--bg-card); border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.post-item-header { padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.post-item-author { flex: 1; }
.post-item-author-name { font-size: 14px; font-weight: 700; }
.post-item-author-time { font-size: 12px; color: var(--text-light); }
.post-item-cover { width: 100%; max-height: 300px; object-fit: cover; }
.post-item-body { padding: 14px; }
.post-item-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; line-height: 1.4; }
.post-item-excerpt { font-size: 14px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-item-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.tag { font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-light); padding: 3px 8px; border-radius: 20px; }
[data-theme="dark"] .tag { background: rgba(99,102,241,.2); }
.post-item-actions { padding: 4px 14px 12px; display: flex; gap: 16px; align-items: center; }
.action-btn { display: flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 14px; font-weight: 600; padding: 6px 0; transition: color var(--transition); }
.action-btn:hover, .action-btn.liked { color: var(--danger); }
.action-btn.bookmarked { color: var(--warning); }
.action-btn .icon { font-size: 20px; }
.share-btn { margin-left: auto; }

/* Stories */
.stories-bar { display: flex; gap: 12px; padding: 12px 16px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border-light); }
.stories-bar::-webkit-scrollbar { display: none; }
.story-item { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; flex-shrink: 0; }
.story-avatar-wrap { padding: 3px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.story-avatar-wrap.seen { background: var(--border); }
.story-avatar { display: block; border-radius: 50%; border: 2px solid var(--bg-card); width: 56px; height: 56px; object-fit: cover; }
.story-name { font-size: 11px; color: var(--text-muted); max-width: 60px; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Profile */
.profile-header { padding: 20px 16px; text-align: center; border-bottom: 1px solid var(--border); background: var(--bg-card); }
.profile-stats { display: flex; justify-content: center; gap: 32px; margin-top: 14px; }
.profile-stat { text-align: center; }
.profile-stat-value { font-size: 20px; font-weight: 800; }
.profile-stat-label { font-size: 12px; color: var(--text-muted); }
.profile-bio { font-size: 14px; color: var(--text-muted); margin-top: 8px; }

/* Messages */
.chat-list { display: flex; flex-direction: column; }
.chat-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background var(--transition); }
.chat-item:hover { background: var(--border-light); }
.chat-item.unread .chat-item-preview { font-weight: 700; color: var(--text); }
.chat-item.unread .chat-item-name { font-weight: 700; }
.chat-item-info { flex: 1; min-width: 0; }
.chat-item-name { font-size: 15px; font-weight: 600; }
.chat-item-preview { font-size: 13px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.chat-item-meta { text-align: right; flex-shrink: 0; }
.chat-item-time { font-size: 11px; color: var(--text-light); }
.chat-unread-badge { background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-top: 4px; padding: 0 4px; }

/* Chat view */
.chat-view { display: flex; flex-direction: column; height: calc(100vh - 120px); }
.chat-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.message { max-width: 75%; border-radius: 16px; padding: 10px 14px; font-size: 14px; line-height: 1.5; }
.message.mine { background: var(--primary); color: #fff; border-radius: 16px 4px 16px 16px; align-self: flex-end; }
.message.theirs { background: var(--bg-card); border: 1px solid var(--border); border-radius: 4px 16px 16px 16px; align-self: flex-start; }
.message-time { font-size: 11px; opacity: .6; margin-top: 3px; }
.chat-input-bar { padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg-card); display: flex; gap: 8px; }
.chat-input-bar .form-control { flex: 1; border-radius: 24px; padding: 10px 16px; }
.chat-send-btn { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; border: none; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Notifications */
.notif-item { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer; transition: background var(--transition); }
.notif-item:hover { background: var(--border-light); }
.notif-item.unread { background: var(--primary-light); }
[data-theme="dark"] .notif-item.unread { background: rgba(99,102,241,.1); }
.notif-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--border); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.notif-body { flex: 1; }
.notif-title { font-size: 14px; font-weight: 600; }
.notif-text { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.notif-time { font-size: 12px; color: var(--text-light); margin-top: 4px; }

/* Login page */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; background: var(--bg-card); border-radius: var(--radius-lg); border: 1px solid var(--border); box-shadow: var(--shadow-lg); padding: 32px 28px; }
.login-logo { text-align: center; font-size: 32px; font-weight: 900; color: var(--primary); margin-bottom: 6px; }
.login-subtitle { text-align: center; font-size: 14px; color: var(--text-muted); margin-bottom: 28px; }
.otp-inputs { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.otp-input { width: 44px; height: 52px; text-align: center; font-size: 22px; font-weight: 700; border: 2px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); }
.otp-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.login-switch { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-muted); }
.login-switch a { color: var(--primary); font-weight: 600; }
.resend-timer { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 10px; }

/* Payments */
.plan-card { border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; transition: all var(--transition); cursor: pointer; }
.plan-card.selected, .plan-card:hover { border-color: var(--primary); background: var(--primary-light); }
[data-theme="dark"] .plan-card.selected { background: rgba(99,102,241,.15); }
.plan-price { font-size: 28px; font-weight: 800; color: var(--primary); margin: 8px 0; }
.plan-price span { font-size: 14px; color: var(--text-muted); font-weight: 400; }
.plan-features { list-style: none; margin: 12px 0; text-align: left; }
.plan-features li { font-size: 13px; padding: 4px 0; display: flex; gap: 6px; align-items: center; }
.plan-features li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* Desktop enhancements */
@media (min-width: 768px) {
  .sub-layout { max-width: 600px; margin: 0 auto; padding-bottom: 70px; }
  .sub-bottomnav { max-width: 600px; left: 50%; transform: translateX(-50%); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
  body { background: var(--bg); }
  .login-page { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); }
  [data-theme="dark"] .login-page { background: linear-gradient(135deg, #1e293b, #0f172a); }
}
