/* ============================================================
   PhinaticNews – Dark Theme, Mobile-First
   Base: 390px (iPhone 14 Pro)
   ============================================================ */

/* ── Reset & Custom Properties ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colors */
  --bg:           #09090f;
  --surface:      #13131f;
  --surface-2:    #1a1a2e;
  --border:       #1e1e2e;
  --border-light: #252540;

  --accent:       #6366f1;
  --accent-dim:   rgba(99,102,241,.15);
  --accent-light: #818cf8;
  --accent-glow:  rgba(99,102,241,.4);

  --text-1:       #f8fafc;
  --text-2:       #94a3b8;
  --text-3:       #64748b;

  --breaking:     #ef4444;
  --breaking-dim: rgba(239,68,68,.15);
  --success:      #22c55e;
  --warn:         #f59e0b;

  /* Spacing */
  --gap:          16px;
  --gap-sm:       8px;
  --gap-xs:       4px;
  --radius:       14px;
  --radius-sm:    8px;
  --radius-xs:    6px;

  /* Typography */
  --font:         -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'SF Mono', 'Fira Code', monospace;

  /* Transitions */
  --ease:         cubic-bezier(.25,.46,.45,.94);
  --dur:          200ms;

  /* Layout */
  --header-h:     56px;
  --nav-h:        64px;
  --filter-h:     48px;
  --max-w:        680px;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  padding-bottom: var(--nav-h);
}

/* ── Typography ── */
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; }
p { line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; border: none; cursor: pointer; background: none; color: inherit; }
input, select { font: inherit; color: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }

/* ── Layout Wrapper ── */
.app-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
}

/* ============================================================
   HEADER
   ============================================================ */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap);
  background: rgba(9,9,15,.85);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -1px;
  box-shadow: 0 0 16px var(--accent-glow);
}

.brand-name {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-1) 40%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.btn-icon:hover { background: var(--surface-2); color: var(--text-1); }
.btn-icon svg { width: 20px; height: 20px; }

/* Profile Avatar Button */
.profile-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  position: relative;
}
.profile-avatar-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 12px currentColor;
}
.profile-avatar-btn .profile-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  background: var(--success);
  border: 2px solid var(--bg);
  border-radius: 50%;
}

/* ============================================================
   FILTER PILLS
   ============================================================ */
.filter-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  height: var(--filter-h);
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  padding: 0 var(--gap);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  background: rgba(9,9,15,.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all var(--dur) var(--ease);
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent-light); }
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================================
   NEWS FEED
   ============================================================ */
.news-feed {
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ── Hero Card ── */
.card-hero {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
  cursor: pointer;
}
.card-hero:hover { transform: translateY(-2px); border-color: var(--border-light); }

.card-hero .card-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface-2);
}
.card-hero .card-img-placeholder {
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--surface-2) 0%, var(--border) 100%);
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 32px;
}

.card-hero .card-body { padding: var(--gap); }

.card-hero .card-meta {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-sm);
}

.card-hero .card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: var(--gap-sm);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-hero .card-desc {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

.card-hero .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ── Standard Card ── */
.card-standard {
  display: flex;
  gap: var(--gap);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.card-standard:hover { transform: translateY(-1px); border-color: var(--border-light); }

.card-standard .card-img-wrap {
  flex-shrink: 0;
  width: 90px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.card-standard .card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-standard .card-img-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--text-3);
  font-size: 20px;
}

.card-standard .card-content { flex: 1; min-width: 0; }
.card-standard .card-meta { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.card-standard .card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.card-standard .card-footer { display: flex; align-items: center; gap: 6px; }

/* ── Compact Card ── */
.card-compact {
  padding: 12px var(--gap);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.card-compact:hover { background: var(--surface-2); }
.card-compact .card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-compact .card-footer { margin-top: 6px; display: flex; align-items: center; gap: 6px; }

/* ── Card Shared Components ── */
.source-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.time-tag {
  font-size: 11px;
  color: var(--text-3);
}

.importance-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
}
.importance-badge.high   { background: var(--breaking-dim); color: var(--breaking); }
.importance-badge.medium { background: rgba(245,158,11,.12); color: var(--warn); }
.importance-badge.low    { background: var(--accent-dim); color: var(--accent-light); }

.category-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-light);
  background: var(--accent-dim);
  padding: 2px 8px;
  border-radius: 99px;
}

.ai-summary {
  font-size: 13px;
  color: var(--accent-light);
  line-height: 1.5;
  padding: 10px 12px;
  background: var(--accent-dim);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  margin-top: 8px;
}

/* Breaking News Badge */
.breaking-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: var(--breaking);
  color: #fff;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: pulse-breaking 2s infinite;
}
@keyframes pulse-breaking {
  0%, 100% { opacity: 1; }
  50% { opacity: .7; }
}

/* ── Section Divider ── */
.section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 0;
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ============================================================
   BOTTOM NAVIGATION
   ============================================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: rgba(13,13,25,.92);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 var(--gap);
  z-index: 200;
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 16px;
  color: var(--text-3);
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease);
  min-width: 56px;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item span { font-size: 10px; font-weight: 600; }
.nav-item.active { color: var(--accent-light); }
.nav-item.active svg { filter: drop-shadow(0 0 6px var(--accent)); }

/* ============================================================
   PANELS & OVERLAYS
   ============================================================ */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
.overlay.visible { opacity: 1; pointer-events: all; }

/* ── Settings Panel (Slide-in right) ── */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 300ms var(--ease);
  overflow: hidden;
}
.panel.open { transform: translateX(0); }

.panel-header {
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--gap);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.panel-header h2 { font-size: 17px; font-weight: 700; }

.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* ── Profile Switcher (Bottom Sheet) ── */
.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 400;
  padding: var(--gap);
  padding-bottom: calc(var(--gap) + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform 300ms var(--ease);
  max-height: 80vh;
  overflow-y: auto;
}
.bottom-sheet.open { transform: translateY(0); }

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--border-light);
  border-radius: 99px;
  margin: 0 auto var(--gap);
}

/* ── Modal ── */
.modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap);
  z-index: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.modal.open { opacity: 1; pointer-events: all; }

.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  padding: var(--gap);
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  transform: scale(.95) translateY(10px);
  transition: transform 300ms var(--ease);
}
.modal.open .modal-card { transform: scale(1) translateY(0); }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 18px; font-weight: 700; }

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
}

.form-input {
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 15px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-select {
  appearance: none;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 15px;
  outline: none;
  width: 100%;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* Tag Checkboxes (für Kategorien) */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
}

.tag-check {
  display: none;
}
.tag-label {
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border: 1px solid var(--border-light);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
  user-select: none;
}
.tag-check:checked + .tag-label {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Color Picker Dots */
.color-grid {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.color-dot-input { display: none; }
.color-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: transform var(--dur) var(--ease);
}
.color-dot:hover { transform: scale(1.15); }
.color-dot-input:checked + .color-dot::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  transition: all var(--dur) var(--ease);
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
}
.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 0 24px var(--accent-glow);
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text-1);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent-light); }

.btn-ghost {
  background: transparent;
  color: var(--text-2);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text-1); }

.btn-danger {
  background: var(--breaking-dim);
  color: var(--breaking);
  border: 1px solid transparent;
}
.btn-danger:hover { border-color: var(--breaking); }

.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-full { width: 100%; }

/* ============================================================
   PROFILE CARD (in switcher)
   ============================================================ */
.profile-list { display: flex; flex-direction: column; gap: var(--gap-sm); }

.profile-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.profile-item:hover { background: var(--surface-2); border-color: var(--border-light); }
.profile-item.active { border-color: var(--accent); background: var(--accent-dim); }

.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 15px; font-weight: 600; }
.profile-meta { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.profile-actions { display: flex; gap: var(--gap-xs); }

/* ============================================================
   SEARCH
   ============================================================ */
.search-wrap {
  padding: var(--gap);
}

.search-input-wrap {
  position: relative;
}
.search-input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-3);
  pointer-events: none;
}
.search-input-wrap input {
  width: 100%;
  padding: 11px 14px 11px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1);
  font-size: 15px;
  outline: none;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.search-input-wrap input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-input-wrap input::placeholder { color: var(--text-3); }

/* ============================================================
   STATES: Loading, Empty, Error
   ============================================================ */
.state-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px var(--gap);
  gap: var(--gap);
  text-align: center;
}

.state-icon { font-size: 48px; opacity: .4; }
.state-title { font-size: 18px; font-weight: 700; }
.state-text { font-size: 14px; color: var(--text-2); max-width: 280px; }

/* Skeleton Loading */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--surface-2) 25%,
    var(--border) 50%,
    var(--surface-2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-xs);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-hero {
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}
.skeleton-hero .sk-img { height: 200px; }
.skeleton-hero .sk-body { padding: var(--gap); }
.skeleton-hero .sk-line { height: 12px; margin-bottom: 10px; }
.skeleton-hero .sk-title { height: 20px; margin-bottom: 8px; }

.skeleton-card {
  display: flex;
  gap: var(--gap);
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.skeleton-card .sk-img { width: 90px; height: 72px; border-radius: var(--radius-sm); flex-shrink: 0; }
.skeleton-card .sk-content { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-card .sk-line { height: 12px; }

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Refresh indicator */
.refresh-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-2);
}

/* Pull to refresh */
.ptr-indicator {
  position: absolute;
  top: -48px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  transition: top 0.2s;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
  position: fixed;
  top: calc(var(--header-h) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  animation: toast-in 0.3s var(--ease) forwards;
  pointer-events: all;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--breaking); }
.toast.info    { background: var(--accent); }
.toast.out     { animation: toast-out 0.3s var(--ease) forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-12px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to   { opacity: 0; transform: translateY(-12px) scale(.95); }
}

/* ============================================================
   SETTINGS SECTIONS
   ============================================================ */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}

.settings-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  gap: var(--gap);
}
.settings-row-label { font-size: 15px; }
.settings-row-desc { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* Toggle Switch */
.toggle {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.toggle input { display: none; }
.toggle-track {
  width: 100%;
  height: 100%;
  background: var(--border-light);
  border-radius: 99px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  display: block;
}
.toggle input:checked + .toggle-track { background: var(--accent); }
.toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--dur) var(--ease);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* ============================================================
   ARTICLE DETAIL VIEW
   ============================================================ */
#view-article {
  display: none;
}
#view-article.active {
  display: block;
}

.article-header {
  padding: var(--gap);
  border-bottom: 1px solid var(--border);
}

.article-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.article-body {
  padding: var(--gap);
}

.article-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: var(--gap);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: var(--gap-sm);
  margin-bottom: var(--gap);
  flex-wrap: wrap;
}

.article-desc {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-2);
}

.article-cta {
  margin-top: var(--gap);
  padding-top: var(--gap);
  border-top: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVE – Tablet & Desktop
   ============================================================ */
@media (min-width: 640px) {
  .news-feed {
    padding: var(--gap) calc(var(--gap) * 1.5);
  }

  .card-hero .card-title { font-size: 22px; }

  .bottom-nav {
    max-width: var(--max-w);
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius) var(--radius) 0 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
}

@media (min-width: 768px) {
  .card-standard .card-title { font-size: 16px; }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.hidden  { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
.flex    { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.gap-sm  { gap: var(--gap-sm); }
.gap     { gap: var(--gap); }
.mt-sm   { margin-top: var(--gap-sm); }
.mt      { margin-top: var(--gap); }
.text-2  { color: var(--text-2); }
.text-sm { font-size: 13px; }
.fw-600  { font-weight: 600; }
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Active view switching */
.view { display: none; }
.view.active { display: block; }
