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

:root {
  --bg: #000000;
  --card: #141418;
  --surface: #1a1a1a;
  --surface-hover: #2a2a2a;
  --text: #f5f5f7;
  --text-dim: #a09a90;
  --text-label: #e8e4dc;
  --accent: #34d399;
  --accent-glow: rgba(52, 211, 153, 0.2);
  --accent-hover: #2cc489;
  --danger: #ff7a7a;
  --danger-glow: rgba(255, 122, 122, 0.2);
  --danger-hover: #e06a6a;
  --blue: #7ab8ff;
  --purple: #bf5af2;
  --border: rgba(232, 228, 220, 0.1);
  --border-strong: rgba(232, 228, 220, 0.2);
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  --accent-dim: rgba(52, 211, 153, 0.15);
  --danger-dim: rgba(255, 122, 122, 0.15);
  --accent-warning: #F59E0B;
  --nav-height: 54px;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============ Nav ============ */
#nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.nav-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 500;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  min-height: 44px;
  transition: color 0.2s;
  position: relative;
}

.nav-tab.active {
  color: var(--accent);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: var(--accent);
}

.nav-settings {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.2s;
}

.nav-settings:active {
  color: var(--text);
}

.badge {
  background: var(--accent);
  color: #000;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  min-width: 20px;
  text-align: center;
}

/* ============ Screens ============ */
.screen {
  padding-top: calc(var(--nav-height) + 20px);
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 40px;
  min-height: 100dvh;
  max-width: 600px;
  margin: 0 auto;
}

.empty-state {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  text-align: center;
  flex-direction: column;
  gap: 8px;
}

.empty-state.visible {
  display: flex;
}

.empty-state p {
  color: var(--text-dim);
  font-size: 1.1rem;
}

/* ============ Inbox Card ============ */
#inbox-card-container {
  position: relative;
  display: flex;
  justify-content: center;
}

.reel-card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 400px;
  touch-action: pan-y;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  border: 1px solid var(--border);
}

.reel-card:active {
  cursor: grabbing;
}

/* Swipe indicators */
.swipe-indicator {
  position: absolute;
  top: 20px;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  opacity: 0;
  z-index: 10;
  pointer-events: none;
  text-transform: uppercase;
}

.swipe-indicator-left {
  right: 20px;
  color: var(--danger);
  border: 2px solid var(--danger);
  transform: rotate(20deg);
  background: var(--danger-dim);
}

.swipe-indicator-right {
  left: 20px;
  color: var(--accent);
  border: 2px solid var(--accent);
  transform: rotate(-20deg);
  background: var(--accent-dim);
}

/* Video */
.reel-video-wrap {
  position: relative;
  background: #000;
}

.reel-video {
  width: 100%;
  height: auto;
  max-height: 70vh;
  display: block;
  background: #000;
  object-fit: contain;
}

.sound-toggle {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background 0.15s;
}

.sound-toggle:active {
  background: rgba(0, 0, 0, 0.8);
}

/* Loading / failed state */
.reel-loading {
  width: 100%;
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(180deg, #1a1a1a 0%, var(--card) 100%);
  color: var(--text-dim);
}

.reel-loading p {
  font-size: 0.9rem;
}

.reel-failed p {
  color: var(--danger);
}

.btn-retry {
  font-size: 0.85rem;
  padding: 8px 20px;
  min-height: 40px;
}

/* Spinner */
.spinner {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.reel-card-body {
  padding: 12px 20px 16px;
  text-align: center;
}

.reel-card-username {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 4px;
}

.btn-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  background: transparent;
  color: var(--text-label);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  min-height: 44px;
  margin-top: 8px;
  transition: background 0.15s, border-color 0.15s;
}

.btn-open:active {
  background: rgba(232, 228, 220, 0.05);
  border-color: var(--text-label);
}

/* ============ Swipe Buttons ============ */
.swipe-buttons {
  display: flex;
  justify-content: center;
  gap: 48px;
  padding: 24px 0 16px;
}

.swipe-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.swipe-btn:active {
  transform: scale(0.9);
}

.swipe-btn-dislike {
  border-color: var(--danger);
  color: var(--danger);
}

.swipe-btn-dislike:hover {
  background: var(--danger-glow);
  box-shadow: 0 0 20px var(--danger-glow);
}

.swipe-btn-like {
  border-color: var(--accent);
  color: var(--accent);
}

.swipe-btn-like:hover {
  background: var(--accent-glow);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover { background: var(--accent-hover); }

.btn-primary:disabled {
  background: var(--surface);
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--text-label);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
  background: rgba(232, 228, 220, 0.05);
  border-color: var(--text-label);
}

/* ============ Overlays ============ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: none;
  align-items: flex-end;
  z-index: 200;
  animation: fadeOverlay 0.15s ease;
}

.overlay.visible {
  display: flex;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay-content {
  background: var(--card);
  width: 100%;
  border-radius: 20px 20px 0 0;
  padding: 24px 16px calc(env(safe-area-inset-bottom, 16px) + 16px);
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid var(--border-strong);
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.overlay-content h3 {
  margin-bottom: 16px;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.niche-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.niche-chip {
  padding: 10px 18px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-label);
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.niche-chip.selected {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
}

.overlay-actions {
  display: flex;
  gap: 12px;
}

.overlay-actions .btn {
  flex: 1;
}

/* ============ Niche Filters (Liked) ============ */
.niche-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 16px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.niche-filters::-webkit-scrollbar { display: none; }

.filter-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  cursor: pointer;
  min-height: 38px;
  display: flex;
  align-items: center;
  transition: all 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.filter-chip.active {
  background: transparent;
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 500;
}

/* ============ Liked List ============ */
.liked-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.liked-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s, transform 0.1s;
  overflow: hidden;
  border: 1px solid var(--border);
}

.liked-item:active {
  background: var(--surface);
  transform: scale(0.98);
}

.liked-item-thumb {
  width: 72px;
  height: 90px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  overflow: hidden;
  object-fit: cover;
}

.liked-item-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text-dim);
}

.liked-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.liked-item-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.liked-item-username {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
}

.liked-item-niche {
  font-size: 0.65rem;
  font-weight: 400;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
}

.liked-item-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

/* ============ Pagination ============ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0 8px;
}

.pagination-btn {
  min-height: 40px;
  padding: 8px 20px;
  font-size: 0.85rem;
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-dim);
  font-weight: 600;
  min-width: 60px;
  text-align: center;
}

/* ============ Stats ============ */
.stats-content {
  max-width: 500px;
  margin: 0 auto;
}

.stats-loading {
  display: flex;
  justify-content: center;
  padding: 60px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
}

.stat-number {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}

.stat-card-total .stat-number { color: var(--blue); }
.stat-card-liked .stat-number { color: var(--accent); }
.stat-card-disliked .stat-number { color: var(--danger); }
.stat-card-inbox .stat-number { color: var(--purple); }

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-section {
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 20px;
  border: 1px solid var(--border);
}

.stat-section-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-label);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.stat-niche-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.stat-niche-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stat-niche-label {
  font-size: 0.85rem;
  color: var(--text);
  width: 100px;
  flex-shrink: 0;
}

.stat-bar-track {
  flex: 1;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 2px;
  min-width: 4px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.stat-niche-count {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
  width: 30px;
  text-align: right;
}

/* ============ Accounts ============ */
.accounts-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-item {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  border: 1px solid var(--border);
  gap: 12px;
}

.account-link {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  min-width: 0;
}

.account-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-reel-count {
  font-size: 0.65rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(52, 211, 153, 0.3);
}

.account-username {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-time {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.account-delete {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255, 122, 122, 0.3);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.account-delete:active {
  background: var(--danger-glow);
}

.account-niches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.account-niche-pill {
  font-size: 0.65rem;
  font-weight: 400;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  letter-spacing: 0.03em;
}

.account-tag {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(52, 211, 153, 0.3);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}

.account-tag:active {
  background: var(--accent-glow);
}

/* ============ Disk Usage ============ */
.disk-section {
  margin-top: 16px;
}

.disk-bar-track {
  width: 100%;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

.disk-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.disk-bar-danger {
  background: linear-gradient(90deg, var(--danger), var(--accent-warning));
}

.disk-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-dim);
}

.disk-warning .stat-section-title {
  color: var(--danger);
}

.disk-warning-msg {
  margin-top: 14px;
  text-align: center;
}

.disk-warning-msg p {
  font-size: 0.85rem;
  color: var(--danger);
  margin-bottom: 10px;
  font-weight: 600;
}

.disk-cleanup-btn {
  font-size: 0.85rem;
  min-height: 40px;
  width: 100%;
}

/* ============ Settings ============ */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0 12px;
}

.setting-row label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.05em;
}

.setting-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin-bottom: 16px;
}

.toggle-switch {
  -webkit-appearance: none;
  appearance: none;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--surface);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
  border: none;
  outline: none;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.toggle-switch:checked {
  background: var(--accent);
}

.toggle-switch:checked::after {
  transform: translateX(20px);
}

.settings-hint {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-bottom: 12px;
  line-height: 1.4;
}

.cookies-textarea {
  width: 100%;
  height: 120px;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: 'SF Mono', 'Menlo', monospace;
  font-size: 0.75rem;
  resize: vertical;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}

.cookies-textarea:focus {
  outline: none;
  border-color: var(--text-label);
}

.cookies-textarea::placeholder {
  color: var(--text-dim);
}

.btn-text-danger {
  background: none;
  border: none;
  color: var(--danger);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 10px 0;
  margin-top: 8px;
  transition: opacity 0.15s;
}

.btn-text-danger:active {
  opacity: 0.7;
}

/* ============ Toast Notifications ============ */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 300;
  pointer-events: none;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: #fff;
  background: var(--surface);
  border: 1px solid var(--border);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: auto;
  max-width: 360px;
  text-align: center;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

.toast-error {
  background: var(--danger-dim);
  border-color: var(--danger);
  color: var(--danger);
}

.toast-info {
  background: rgba(122, 184, 255, 0.15);
  border-color: var(--blue);
  color: var(--blue);
}

/* ============ Category Management ============ */
.categories-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.category-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  background: transparent;
  border: 1px solid var(--border-strong);
  font-size: 0.8rem;
  color: var(--text-label);
}

.category-delete-btn {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  font-size: 0.7rem;
  transition: color 0.15s;
}

.category-delete-btn:active {
  color: var(--danger);
}

.category-add-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.category-input {
  flex: 1;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  min-height: 44px;
}

.category-input:focus {
  outline: none;
  border-color: var(--text-label);
}

.category-input::placeholder {
  color: var(--text-dim);
}

.btn-sm {
  min-height: 44px;
  padding: 10px 16px;
  font-size: 0.8rem;
}

.btn-danger {
  background: var(--danger);
  color: #000;
}

.btn-danger:hover {
  background: var(--danger-hover);
}

.category-confirm-actions {
  flex-wrap: wrap;
}

.reel-send-btn {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}
.reel-send-btn:active {
  transform: scale(0.95);
}
.reel-send-btn.sent {
  color: var(--accent);
  border-color: var(--accent);
}

/* ============ Desktop Improvements ============ */
@media (min-width: 768px) {
  /* Widen the main container */
  .screen {
    max-width: 900px;
  }

  /* Nav stretches naturally — just add more horizontal padding */
  #nav {
    padding: 0 24px;
  }

  /* Stats: 4-column KPI grid */
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  /* Stats: remove the narrow cap so content uses full width */
  .stats-content {
    max-width: 100%;
  }

  /* Stats: niche breakdown gets more breathing room */
  .stat-section {
    padding: 24px;
  }

  /* Liked: 2-column grid */
  .liked-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Accounts: 2-column grid */
  .accounts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  /* Inbox: card stays centered, but give it a bit more room */
  .reel-card {
    max-width: 440px;
  }

  /* Wider screen padding */
  .screen {
    padding-left: 32px;
    padding-right: 32px;
  }

  /* Filter chips row: allow wrapping with more space */
  .filter-bar {
    gap: 10px;
  }

  /* Pagination: wider layout */
  .pagination {
    max-width: 100%;
  }
}
