/* ==========================================================================
   NyhederLive - Premium Dark Design System
   ========================================================================== */

:root {
  --bg-body: #080c14;
  --bg-surface: #0f172a;
  --bg-surface-elevated: #162036;
  --bg-card: rgba(22, 32, 54, 0.7);
  --bg-card-hover: rgba(30, 43, 72, 0.85);
  
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-active: rgba(56, 189, 248, 0.4);
  
  --text-main: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --primary: #38bdf8;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent: #818cf8;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
  position: relative;
  font-family: var(--font-body);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header & Breaking Ticker
   ========================================================================== */

.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 12, 20, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  font-size: 1.75rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(129, 140, 248, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.brand-text h1 {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}

.brand-text .highlight {
  color: var(--primary);
  margin-left: 2px;
}

.brand-text .sub-brand {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.header-status {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.live-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 14px var(--success); }
  100% { transform: scale(0.95); opacity: 0.7; }
}

.live-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--success);
}

.refresh-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.last-sync-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-icon {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  color: var(--primary);
  border-color: var(--primary);
  transform: rotate(45deg);
  background: rgba(56, 189, 248, 0.1);
}

/* Breaking Ticker */
.ticker-bar {
  background: #0b1120;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  height: 34px;
  overflow: hidden;
}

.ticker-label {
  background: var(--danger);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0 0.85rem;
  height: 100%;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 2;
  box-shadow: 2px 0 10px rgba(0,0,0,0.5);
}

.ticker-track-wrapper {
  flex-grow: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}

.ticker-track {
  display: inline-flex;
  white-space: nowrap;
  gap: 2.5rem;
  animation: tickerMarquee 50s linear infinite;
  padding-left: 2rem;
}

.ticker-track:hover {
  animation-play-state: paused;
}

@keyframes tickerMarquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.ticker-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s ease;
}

.ticker-link:hover {
  color: var(--primary);
}

.ticker-source-tag {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   Toolbar Section (Search, Filters & Views)
   ========================================================================== */

.toolbar-section {
  max-width: 1440px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  width: 100%;
}

.toolbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1 1 360px;
  max-width: 600px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.75rem 2.8rem 0.75rem 2.8rem;
  color: #fff;
  font-size: 0.92rem;
  outline: none;
  transition: var(--transition);
}

.search-box input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
  background: var(--bg-surface-elevated);
}

.btn-clear {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

.btn-clear:hover {
  color: #fff;
}

.view-toggles {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toggle-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
}

.toggle-btn:hover, .toggle-btn.active {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--warning);
  color: var(--warning);
}

.view-mode-group {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
}

.view-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.view-btn.active {
  background: var(--bg-surface-elevated);
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Filter Chips */
.chips-container {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chips-scroll {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.chips-scroll::-webkit-scrollbar {
  height: 4px;
}

.chips-scroll::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  transform: translateY(-1px);
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #04101e;
  font-weight: 700;
  box-shadow: 0 0 14px var(--primary-glow);
}

.chip.cat-chip.active {
  background: linear-gradient(135deg, var(--accent), var(--primary));
  color: #fff;
  border-color: transparent;
}

.chip .count {
  font-size: 0.7rem;
  opacity: 0.8;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   Feed Header & Info Bar
   ========================================================================== */

.feed-header-bar {
  max-width: 1440px;
  margin: 1.5rem auto 0.75rem;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.feed-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.filter-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
}

.count-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
}

.sort-indicator {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.sort-indicator strong {
  color: var(--text-secondary);
}

/* ==========================================================================
   Main Content & News Grid
   ========================================================================== */

.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  width: 100%;
  flex-grow: 1;
}

/* Grid View */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.25rem;
}

/* News Card */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--source-accent, var(--primary));
  opacity: 0.75;
  transition: opacity 0.2s ease, height 0.2s ease;
}

.news-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.news-card:hover::before {
  opacity: 1;
  height: 4px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.5rem;
}

.source-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  color: #fff;
  background: var(--source-accent, #334155);
  letter-spacing: 0.02em;
}

.card-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  margin-bottom: 0.6rem;
  transition: color 0.15s ease;
}

.news-card:hover .card-title {
  color: var(--primary);
}

.card-desc {
  font-size: 0.86rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

.card-tags {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.tag-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.tag-badge.special {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-bookmark {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.2rem;
  line-height: 1;
  transition: var(--transition);
}

.btn-bookmark:hover, .btn-bookmark.saved {
  color: var(--warning);
  transform: scale(1.15);
}

/* ==========================================================================
   Timeline / List View Mode (Kompakt Tidslinje med Miniature Thumbnails)
   ========================================================================== */

.news-grid.list-view {
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.news-grid.list-view .news-card {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-radius: 12px;
  min-height: 84px;
}

.news-grid.list-view .card-main-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
  gap: 0.35rem;
}

.news-grid.list-view .card-header {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.news-grid.list-view .card-title {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: none;
  width: 100%;
}

.news-grid.list-view .card-desc {
  display: none;
}

.news-grid.list-view .card-footer {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

/* Miniature Thumbnail i Kompakt Tidslinje */
.news-grid.list-view .card-media {
  width: 76px;
  height: 76px;
  min-width: 76px;
  min-height: 76px;
  border-radius: 8px;
  margin-bottom: 0;
  flex-shrink: 0;
  order: 2;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  background: rgba(0, 0, 0, 0.25);
}

.news-grid.list-view .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

/* Grid View Image placement */
.news-grid:not(.list-view) .news-card {
  display: flex;
  flex-direction: column;
}

.news-grid:not(.list-view) .card-media {
  order: -1;
  width: 100%;
  height: 155px;
  margin-bottom: 0.75rem;
}

/* Loading & Empty States */
.loading-state, .empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 1rem;
  background: var(--bg-surface);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.15);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1.25rem;
}

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

/* ==========================================================================
   Reader Modal Dialog
   ========================================================================== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: #111a2e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.modal-overlay.open .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-close {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close:hover {
  color: #fff;
  border-color: #fff;
}

.modal-body {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
  position: relative;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  line-height: 1.3;
  margin-bottom: 1rem;
  color: #fff;
}

.modal-image-wrap {
  margin-bottom: 1.25rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 320px;
}

.modal-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.modal-desc {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #000;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

.btn-secondary {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  padding: 2rem 1.5rem;
  margin-top: auto;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.app-footer p {
  margin-bottom: 0.4rem;
}

.app-footer code {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

/* ==========================================================================
   Mobile-First & Touch Optimization System (v2.3)
   ========================================================================== */

/* Modal Handle Bar (Desktop hidden, Mobile visible) */
.modal-handle-bar {
  display: none;
}

/* Floating Back-to-Top Button */
.back-to-top-btn {
  position: fixed;
  right: 1.25rem;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 1.25rem));
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #111e38;
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 90;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top-btn:active {
  transform: scale(0.92);
  background: var(--primary);
  color: #04101e;
}

/* Tablet & Smaller Screens (< 768px) */
@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
  }

  .toolbar-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .view-toggles {
    justify-content: space-between;
  }

  .search-box input {
    font-size: 16px !important; /* Forhindrer iOS auto-zoom */
  }
}

/* Smartphone & Compact Screens (< 640px) */
@media (max-width: 640px) {
  /* Navigation */
  .top-nav {
    border-bottom-width: 1px;
  }

  .nav-container {
    padding: 0.65rem 0.85rem;
  }

  .brand-icon {
    font-size: 1.5rem;
  }

  .brand-text h1 {
    font-size: 1.12rem;
  }

  .brand-text .sub-brand {
    font-size: 0.65rem;
  }

  .last-sync-text {
    display: none;
  }

  .live-pill {
    padding: 0.25rem 0.55rem;
  }

  .live-text {
    font-size: 0.65rem;
    letter-spacing: 0.04em;
  }

  .btn-icon {
    width: 38px;
    height: 38px;
  }

  /* Breaking Ticker */
  .ticker-bar {
    height: 38px;
    padding: 0 0.85rem;
  }

  .ticker-label {
    font-size: 0.65rem;
    padding: 0.18rem 0.45rem;
  }

  .ticker-link {
    font-size: 0.78rem;
    gap: 0.4rem;
  }

  .ticker-source-tag {
    font-size: 0.62rem;
    padding: 0.1rem 0.35rem;
  }

  /* Toolbar & Search */
  .toolbar-section {
    padding: 0.75rem 0.85rem 0.4rem;
  }

  .search-box {
    flex: 1 1 100%;
    max-width: 100%;
  }

  .search-box input {
    height: 44px;
    padding: 0.65rem 2.5rem;
    font-size: 16px !important; /* Forhindrer iOS auto-zoom */
    border-radius: var(--radius-md);
  }

  .btn-clear {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
  }

  .view-toggles {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
  }

  .toggle-btn {
    height: 42px;
    flex: 1;
    justify-content: center;
    font-size: 0.85rem;
    padding: 0 0.85rem;
  }

  .view-mode-group {
    height: 42px;
  }

  .view-btn {
    width: 42px;
    height: 42px;
  }

  /* Filter Chips - Smooth Touch Swipe */
  .chips-container {
    margin-top: 0.7rem;
    gap: 0.5rem;
  }

  .chips-scroll {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0.15rem 0.15rem 0.35rem;
    gap: 0.45rem;
  }

  .chips-scroll::-webkit-scrollbar {
    display: none;
  }

  .chip {
    min-height: 38px;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    user-select: none;
    -webkit-user-select: none;
  }

  .chip:active {
    transform: scale(0.96);
  }

  .chip .count {
    font-size: 0.68rem;
    padding: 0.1rem 0.38rem;
  }

  /* Feed Header */
  .feed-header-bar {
    padding: 0.75rem 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .filter-title {
    font-size: 1rem;
  }

  .count-badge {
    font-size: 0.72rem;
  }

  .sort-indicator {
    font-size: 0.72rem;
    opacity: 0.8;
  }

  /* Content & News Cards */
  .main-content {
    padding: 0 0.85rem 3.5rem;
  }

  .news-grid {
    grid-template-columns: 1fr;
    gap: 0.85rem;
  }

  .news-card {
    padding: 1rem;
    border-radius: 14px;
  }

  .news-card:active {
    background: var(--bg-card-hover);
  }

  .card-header {
    margin-bottom: 0.6rem;
  }

  .card-title {
    font-size: 1.05rem;
    line-height: 1.35;
    margin-bottom: 0.5rem;
  }

  .card-desc {
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 0.85rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .card-footer {
    padding-top: 0.65rem;
  }

  .btn-bookmark {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -0.4rem;
  }

  /* List / Timeline View Mode on Mobile */
  .news-grid.list-view .news-card {
    padding: 0.85rem 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .news-grid.list-view .card-header {
    width: 100%;
    min-width: auto;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .news-grid.list-view .card-title {
    font-size: 0.98rem;
    margin: 0.2rem 0;
    flex: none;
    width: 100%;
  }

  .news-grid.list-view .card-footer {
    width: 100%;
    min-width: auto;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
    margin-top: 0.25rem;
  }

  /* Native Bottom Sheet Modal on Mobile */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-dialog {
    max-width: 100%;
    width: 100%;
    border-radius: 22px 22px 0 0;
    max-height: 90vh;
    border-bottom: none;
    border-left: none;
    border-right: none;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.18, 0.9, 0.3, 1);
  }

  .modal-overlay.open .modal-dialog {
    transform: translateY(0);
  }

  .modal-handle-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0.65rem 0 0.25rem;
  }

  .modal-handle {
    width: 42px;
    height: 5px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.35);
  }

  .modal-header {
    padding: 0.5rem 1.25rem 0.75rem;
  }

  .modal-body {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
  position: relative;
    padding: 0.85rem 1.25rem 1.5rem;
    max-height: calc(90vh - 170px);
  }

  .modal-title {
    font-size: 1.22rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
  }

  .modal-image-wrap {
    max-height: 220px;
    border-radius: 12px;
    margin-bottom: 1rem;
  }

  .modal-desc {
    font-size: 0.92rem;
    line-height: 1.6;
  }

  .modal-footer {
    flex-direction: column-reverse;
    gap: 0.6rem;
    padding: 0.85rem 1.25rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    background: #090e1b;
    border-top: 1px solid var(--border-subtle);
  }

  .modal-footer .btn-primary,
  .modal-footer .btn-secondary {
    width: 100%;
    justify-content: center;
    height: 46px;
    font-size: 0.95rem;
    border-radius: 12px;
  }

  /* Footer */
  .app-footer {
    padding: 2rem 1rem max(2rem, env(safe-area-inset-bottom, 1.5rem));
    font-size: 0.78rem;
  }
}

/* IP Indicator Badge */
.ip-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 0.22rem 0.6rem;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: monospace;
  letter-spacing: 0.02em;
  transition: var(--transition);
}

.ip-indicator.whitelisted {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.08);
  color: #6ee7b7;
}

.ip-indicator.whitelisted::after {
  content: '🛡️';
  font-size: 0.65rem;
}

/* Card Image Thumbnail */
.card-media {
  width: 100%;
  height: 155px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: rgba(0, 0, 0, 0.35);
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

.news-card:hover .card-media img {
  transform: scale(1.03);
}

/* Scroll Sentinel for Lazy Rendering */
.scroll-sentinel {
  width: 100%;
  height: 60px;
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sentinel-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(56, 189, 248, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 0.5rem;
}

/* ==========================================================================
   Mobile Custom Dropdowns (< 768px)
   ========================================================================== */

.mobile-dropdowns-bar {
  display: none; /* Skjult på desktop */
}

@media (max-width: 768px) {
  /* Skjul de to pladskrævende rækker badges på mobil */
  .chips-container {
    display: none !important;
  }

  /* Lad top-nav scrolle væk på mobil, så dropdowns låser fast ved top: 0px */
  .top-nav {
    position: relative;
    top: auto;
  }

  .toolbar-section {
    padding-bottom: 0.25rem;
  }

  /* Sticky Dropdown Bar ved 0px */
  .mobile-dropdowns-bar {
    display: flex;
    gap: 0.5rem;
    position: sticky;
    top: 0;
    z-index: 150;
    background: rgba(8, 14, 26, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: max(0.55rem, env(safe-area-inset-top, 0.55rem)) 0.85rem 0.55rem;
    margin: 0;
    width: 100%; max-width: 100vw; box-sizing: border-box;
    border-bottom: 1px solid rgba(56, 189, 248, 0.25);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.55);
  }

  .custom-dropdown {
    flex: 1 1 50%;
    position: relative;
  }

  .dropdown-trigger {
    width: 100%;
    height: 44px;
    background: var(--bg-surface, #0f172a);
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.1));
    border-radius: var(--radius-md, 10px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.65rem;
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    user-select: none;
    -webkit-user-select: none;
  }

  .dropdown-trigger:active, .dropdown-trigger.open {
    border-color: var(--primary, #38bdf8);
    background: #141f36;
  }

  .dropdown-trigger.has-active-filter {
    border-color: var(--primary, #38bdf8);
    background: rgba(56, 189, 248, 0.08);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
  }

  .dropdown-trigger-icon {
    font-size: 0.95rem;
    margin-right: 0.35rem;
    flex-shrink: 0;
  }

  .dropdown-trigger-label {
    flex-grow: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 0.35rem;
  }

  .dropdown-trigger-count {
    background: rgba(0, 0, 0, 0.35);
    padding: 0.12rem 0.4rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    color: var(--primary, #38bdf8);
    font-weight: 700;
    margin-right: 0.25rem;
    flex-shrink: 0;
  }

  .dropdown-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }

  .dropdown-trigger.open .dropdown-arrow {
    transform: rotate(180deg);
    color: var(--primary);
  }

  /* Dropdown Menu Popup */
  .dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #09101f;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
    z-index: 500;
    max-height: 280px;
    overflow-y: auto;
    display: none;
    padding: 0.4rem;
    -webkit-overflow-scrolling: touch;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
  }

  .dropdown-menu.show {
    display: block;
    animation: dropdownFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .dropdown-item {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.84rem;
    cursor: pointer;
    border: none;
    background: none;
    text-align: left;
    transition: background 0.12s ease;
  }

  .dropdown-item:active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .dropdown-item.active {
    background: rgba(56, 189, 248, 0.16);
    color: var(--primary, #38bdf8);
    font-weight: 700;
  }

  .dropdown-item.dimmed {
    opacity: 0.35;
  }

  .dropdown-item-left {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dropdown-item-count {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.1rem 0.42rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    opacity: 0.85;
    flex-shrink: 0;
  }
}

/* Yderligere kompakt header på meget små mobiler (< 400px) */
@media (max-width: 400px) {
  .nav-container {
    padding: 0.5rem 0.65rem;
    gap: 0.4rem;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }

  .brand-icon {
    font-size: 1.35rem;
  }

  .ip-indicator {
    padding: 0.15rem 0.35rem;
    font-size: 0.62rem;
    max-width: 110px;
    overflow: hidden;
  }

  .mobile-dropdowns-bar {
    gap: 0.35rem;
  }

  .dropdown-trigger {
    padding: 0 0.45rem;
    font-size: 0.78rem;
  }
}

@media (max-width: 640px) {

  /* Mobil tilpasning for kompakt tidslinje (< 640px) */
  .news-grid.list-view {
    gap: 0.55rem;
  }

  .news-grid.list-view .news-card {
    padding: 0.75rem 0.85rem;
    gap: 0.75rem;
    flex-direction: row;
    align-items: center;
  }

  .news-grid.list-view .card-title {
    font-size: 0.92rem;
    line-height: 1.3;
  }

  .news-grid.list-view .card-media {
    width: 68px;
    height: 68px;
    min-width: 68px;
    min-height: 68px;
    border-radius: 8px;
  }

}


/* ==========================================================================
   Mobile Custom Dropdowns - True Sticky at 0px
   ========================================================================== */

.mobile-dropdowns-bar {
  display: none;
}

@media (max-width: 768px) {
  /* Skjul chips på mobil */
  .chips-container {
    display: none !important;
  }

  /* Headeren ruller væk på mobil så dropdowns låser fast ved præcis 0px */
  .top-nav {
    position: relative !important;
    top: auto !important;
    z-index: 50;
  }

  /* Selve dropdown-baren er klistret til toppen af vinduet */
  .mobile-dropdowns-bar {
    display: flex;
    gap: 0.5rem;
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100% !important;
    z-index: 400 !important;
    background: rgba(8, 12, 22, 0.97) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    padding: max(0.55rem, env(safe-area-inset-top, 0.55rem)) 0.85rem 0.55rem !important;
    margin: 0 !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.28) !important;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.75) !important;
  }
}


/* ==========================================================================
   Strict Viewport Lock - Zero Horizontal Overflow
   ========================================================================== */

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



.top-nav,
.toolbar-section,
.mobile-dropdowns-bar,
.feed-header-bar,
.main-content,
.app-footer {
  box-sizing: border-box !important;
  max-width: 100% !important;
  width: 100% !important;
  overflow-x: clip;
}

.mobile-dropdowns-bar {
  margin: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.card-title,
.card-desc,
.modal-title,
.modal-desc {
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}


/* ==========================================================================
   Guaranteed Sticky & Pinned at Top: 0px
   ========================================================================== */

.mobile-dropdowns-bar.is-pinned {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 100vw !important;
  z-index: 9999 !important;
  background: rgba(8, 12, 22, 0.98) !important;
  backdrop-filter: blur(24px) !important;
  -webkit-backdrop-filter: blur(24px) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85) !important;
}

.mobile-dropdowns-spacer {
  width: 100%;
  height: 52px;
}


/* Quick Open in New Tab Button on Card */
.btn-open-tab {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 6px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-open-tab:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
}

.btn-open-tab:active {
  transform: scale(0.92);
  background: var(--primary);
  color: #04101e;
}

@media (max-width: 640px) {
  .btn-open-tab {
    width: 36px;
    height: 36px;
  }
}

/* ==========================================================================
   Dual Toast Notification System (Top & Bottom)
   ========================================================================== */

.toast-notification {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  max-width: calc(100vw - 2rem);
  width: auto;
  pointer-events: auto;
}

.toast-top {
  top: 1rem;
  animation: toastSlideDown 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-bottom {
  bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
  animation: toastSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.6rem 1rem 0.6rem 1.1rem;
  border-radius: 9999px;
  color: #f1f5f9;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
}

.toast-bottom .toast-content {
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(168, 85, 247, 0.2);
}

.toast-pulse-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary, #38bdf8);
  box-shadow: 0 0 10px var(--primary, #38bdf8);
  animation: toastPulse 1.8s infinite;
  flex-shrink: 0;
}

.toast-icon {
  font-size: 1rem;
  line-height: 1;
  flex-shrink: 0;
}

.toast-message {
  color: #e2e8f0;
}

.toast-message strong {
  color: var(--primary, #38bdf8);
  font-weight: 700;
}

.toast-bottom .toast-message {
  color: #cbd5e1;
}

.btn-toast-action {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #04101e;
  border: none;
  border-radius: 9999px;
  padding: 0.38rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.toast-bottom .btn-toast-action {
  background: linear-gradient(135deg, #9333ea, #c084fc);
  color: #ffffff;
}

.btn-toast-action:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.4);
}

.toast-bottom .btn-toast-action:hover {
  box-shadow: 0 4px 14px rgba(192, 132, 252, 0.4);
}

.btn-toast-action:active {
  transform: scale(0.96);
}

.btn-toast-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  cursor: pointer;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s ease, background 0.15s ease;
}

.btn-toast-close:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

@keyframes toastSlideDown {
  from {
    opacity: 0;
    transform: translate(-50%, -100%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toastSlideUp {
  from {
    opacity: 0;
    transform: translate(-50%, 100%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes toastPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.6;
  }
}

@media (max-width: 640px) {
  .toast-top {
    top: 3.9rem;
  }
  .toast-content {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    gap: 0.55rem;
  }
  .btn-toast-action {
    padding: 0.32rem 0.75rem;
    font-size: 0.78rem;
  }
}

/* ==========================================================================
   Progressive Web App (PWA) Styling
   ========================================================================== */

/* Hent App / Install Knap */
.btn-install-pwa {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.15), rgba(2, 132, 199, 0.25));
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-install-pwa:hover {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #04101e;
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  transform: translateY(-1px);
}

.btn-install-pwa:active {
  transform: scale(0.95);
}

.btn-install-pwa .install-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Offline Status Banner */
.offline-banner {
  width: 100%;
  box-sizing: border-box;
  background: rgba(30, 20, 5, 0.95);
  border-top: 1px solid rgba(245, 158, 11, 0.4);
  border-bottom: 1px solid rgba(245, 158, 11, 0.4);
  color: #fde68a;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: offlineFadeIn 0.3s ease forwards;
  position: relative;
  z-index: 101;
}

@keyframes offlineFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.offline-banner-content {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.offline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
  animation: toastPulse 1.5s infinite;
}

/* iOS Install Guide */
.ios-dialog {
  max-width: 420px !important;
}

.ios-guide-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.25rem 0.5rem;
}

.ios-step {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.ios-step .step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #04101e;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.ios-step p {
  margin: 0;
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .btn-install-pwa {
    padding: 0.28rem 0.55rem;
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   Version Control & Auto-Update Styling
   ========================================================================== */

/* Update Toast */
.toast-update .toast-content {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 12px 32px -4px rgba(0, 0, 0, 0.6), 0 0 20px rgba(16, 185, 129, 0.25);
}

.btn-update-action {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
}

.btn-update-action:hover {
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.45) !important;
}

/* Footer Version Row & Badge */
.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.75rem;
}

.version-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: var(--transition);
}

.version-badge-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: var(--primary);
  border-color: rgba(56, 189, 248, 0.4);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* Version & Changelog Modal */
.version-dialog {
  max-width: 440px !important;
}

.version-modal-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.version-logo {
  font-size: 1.5rem;
}

.modal-version-tag {
  font-size: 0.8rem;
  background: rgba(56, 189, 248, 0.15);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  vertical-align: middle;
}

.version-modal-body {
  padding: 1.25rem 0.5rem 0.5rem;
}

.changelog-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.changelog-list li {
  position: relative;
  padding-left: 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.changelog-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
  font-size: 0.78rem;
}

.version-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}
