:root {
  --bg: #edf2f7;
  --ink: #12202b;
  --ink-soft: #4f5f6f;
  --panel: #f9fcff;
  --line: #cfd9e3;
  --accent: #0f6b8a;
  --accent-2: #0a4f66;
  --good: #1f7e3a;
  --warn: #9a5b17;
  --bad: #a2232b;
  --shadow-color: rgba(18, 32, 43, 0.08);
  --glow-color: rgba(15, 107, 138, 0.15);
  --header-height: 56px;
  --search-height: 60px;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --ink: #e6edf3;
  --ink-soft: #7d8590;
  --panel: #1c2128;
  --line: #30363d;
  --accent: #58a6ff;
  --accent-2: #79c0ff;
  --good: #3fb950;
  --warn: #d29922;
  --bad: #f85149;
  --shadow-color: rgba(0, 0, 0, 0.5);
  --glow-color: rgba(88, 166, 255, 0.25);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  overscroll-behavior-y: none;
}

html.theme-switching *,
html.theme-switching *::before,
html.theme-switching *::after {
  transition: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(circle at 12% 15%, #d5e6ef 0, transparent 30%),
    radial-gradient(circle at 90% 8%, #dce3f7 0, transparent 32%),
    radial-gradient(circle at 50% 100%, #e8f0f8 0, transparent 50%),
    linear-gradient(180deg, #f4f8fc 0%, var(--bg) 45%, #ebf0f6 100%);
  min-height: 100vh;
  padding-top: calc(var(--header-height) + var(--search-height));
  transition: background 0.4s ease, color 0.3s ease, padding-top 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Collapsed header state - remove top padding */
body.header-collapsed {
  padding-top: 0;
}

/* Pages without search bar (health, tags, feeds) */
body.no-search {
  padding-top: var(--header-height);
}

[data-theme="dark"] body {
  background:
    radial-gradient(circle at 12% 15%, rgba(88, 166, 255, 0.08) 0, transparent 35%),
    radial-gradient(circle at 90% 8%, rgba(121, 192, 255, 0.06) 0, transparent 32%),
    radial-gradient(circle at 50% 100%, rgba(88, 166, 255, 0.05) 0, transparent 50%),
    linear-gradient(180deg, #0a0e14 0%, #0f1419 40%, #131820 100%);
}

/* Fixed Header Bar */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-bar.header-hidden {
  transform: translateY(-100%);
}

.top-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
  box-shadow: 0 2px 8px var(--glow-color);
}

[data-theme="dark"] .brand-icon {
  box-shadow: 0 2px 12px rgba(88, 166, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.brand-text {
  font: 700 1.1rem/1 "Inter", sans-serif;
  color: var(--ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

[data-theme="dark"] .brand-text {
  color: var(--ink);
}

/* Horizontal Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: center;
}

/* Mobile nav hidden by default */
.mobile-nav {
  display: none;
}

.nav-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  white-space: nowrap;
  height: 36px;
}

.nav-item:hover {
  color: var(--ink);
  background: rgba(15, 107, 138, 0.08);
}

.nav-item.active {
  color: var(--accent);
  background: rgba(15, 107, 138, 0.12);
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(88, 166, 255, 0.1);
}

[data-theme="dark"] .nav-item.active {
  background: rgba(88, 166, 255, 0.15);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.2);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.8;
}

.nav-item.active .nav-icon {
  opacity: 1;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

/* Layout switch in header */
.header-layout-switch {
  padding: 2px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  height: 44px;
  display: inline-flex;
  align-items: center;
}

.header-layout-switch .layout-btn {
  padding: 6px;
  height: 40px;
  width: 40px;
  min-height: 40px;
  min-width: 40px;
  border-radius: 8px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.header-layout-switch .layout-btn svg {
  width: 18px;
  height: 18px;
}

.theme-toggle {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.theme-toggle:hover {
  background: rgba(15, 107, 138, 0.1);
  border-color: var(--accent);
}

[data-theme="dark"] .theme-toggle:hover {
  background: rgba(88, 166, 255, 0.12);
  border-color: rgba(88, 166, 255, 0.5);
  box-shadow: 0 0 12px rgba(88, 166, 255, 0.15);
}

.theme-icon-svg {
  width: 18px;
  height: 18px;
}

/* Fixed Search Bar */
.search-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-bar.search-hidden {
  transform: translateY(calc(-1 * (var(--header-height) + var(--search-height))));
}

.search-bar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
}

#searchInput {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  font: 500 0.95rem/1 "Inter", sans-serif;
  padding: 0 44px 0 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#searchInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-color);
}

[data-theme="dark"] #searchInput {
  background: rgba(22, 27, 34, 0.8);
  border-color: rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] #searchInput:focus {
  background: rgba(28, 33, 40, 0.95);
  border-color: rgba(88, 166, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.2), 0 4px 12px rgba(0, 0, 0, 0.3);
}

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.4;
  pointer-events: none;
}

/* Filter Toggle Button */
.filter-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink-soft);
  font: 600 0.85rem/1 "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.filter-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.filter-toggle.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

[data-theme="dark"] .filter-toggle {
  background: rgba(28, 33, 40, 0.8);
  border-color: rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .filter-toggle:hover {
  background: rgba(35, 42, 50, 0.95);
  border-color: rgba(88, 166, 255, 0.5);
}

[data-theme="dark"] .filter-toggle.active {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.9) 0%, rgba(56, 139, 253, 0.95) 100%);
  border-color: rgba(88, 166, 255, 0.6);
  box-shadow: 0 4px 12px rgba(88, 166, 255, 0.25);
}

.filter-toggle-icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s ease;
}

.filter-toggle.active .filter-toggle-icon {
  transform: rotate(180deg);
}

/* Filter badge - shows active filter count */
.filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font: 600 0.65rem/1 "Inter", sans-serif;
  margin-left: 2px;
}

@media (max-width: 768px) {
  .filter-badge {
    min-width: 14px;
    height: 14px;
    padding: 0 3px;
    font-size: 0.6rem;
    border-radius: 7px;
  }
}

.filter-toggle.active .filter-badge {
  background: white;
  color: var(--accent);
}

/* Filter Panel */
.filter-panel {
  position: fixed;
  top: calc(var(--header-height) + var(--search-height));
  left: 0;
  right: 0;
  z-index: 998;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 16px;
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: calc(100vh - var(--header-height) - var(--search-height));
  overflow-y: auto;
}

.filter-panel.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.filter-panel-inner {
  max-width: 1400px;
  margin: 0 auto;
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  font: 600 0.75rem/1 "IBM Plex Mono", monospace;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filter-group select {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: 500 0.9rem/1 "Inter", sans-serif;
  padding: 0 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-group select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--glow-color);
}

[data-theme="dark"] .filter-group select {
  background: rgba(22, 27, 34, 0.8);
  border-color: rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .filter-group select:focus {
  background: rgba(28, 33, 40, 0.95);
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.filter-btn {
  padding: 10px 20px;
  border-radius: 10px;
  font: 600 0.85rem/1 "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.filter-btn-primary {
  background: var(--accent);
  color: white;
  border: none;
}

.filter-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px var(--glow-color);
}

[data-theme="dark"] .filter-btn-primary {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.9) 0%, rgba(56, 139, 253, 0.95) 100%);
  box-shadow: 0 2px 8px rgba(88, 166, 255, 0.2);
}

[data-theme="dark"] .filter-btn-primary:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 1) 0%, rgba(56, 139, 253, 1) 100%);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.3);
}

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

.filter-btn-secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .filter-btn-secondary {
  border-color: rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .filter-btn-secondary:hover {
  background: rgba(88, 166, 255, 0.08);
  border-color: rgba(88, 166, 255, 0.5);
}

/* Main Content */
.shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* Pages without search bar - shell needs less padding-top since body already accounts for header only */
body.no-search .shell {
  padding-top: 24px;
}

/* Hero Section (compact) */
.hero {
  margin-bottom: 28px;
  animation: rise-in 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.hero h1 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-meta {
  margin-top: 8px;
  color: var(--ink-soft);
  font: 500 0.85rem/1.4 "IBM Plex Mono", monospace;
}

/* Metrics Grid */
.grid.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 0 0 28px;
  animation: rise-in 600ms cubic-bezier(0.16, 1, 0.3, 1) 100ms both;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 2px 0 rgba(207, 217, 227, 0.5);
  transition: border-color 0.2s ease;
}

[data-theme="dark"] .metric {
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
}

.metric:hover {
  border-color: var(--accent);
}

[data-theme="dark"] .metric:hover {
  border-color: rgba(88, 166, 255, 0.25);
}

.metric h3 {
  margin: 0 0 8px;
  color: var(--ink-soft);
  font: 600 0.7rem/1 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.metric p {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--ink), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Panels */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 32px;
  box-shadow: 0 2px 12px var(--shadow-color);
  transition: box-shadow 0.3s ease, border-color 0.2s ease;
  animation: rise-in 600ms cubic-bezier(0.16, 1, 0.3, 1) 200ms both;
}

.panel:hover {
  box-shadow: 0 4px 24px var(--shadow-color);
}

[data-theme="dark"] .panel {
  border-color: rgba(48, 54, 61, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .panel:hover {
  border-color: rgba(88, 166, 255, 0.15);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.panel h2 {
  margin: 0 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

/* Feed content - no panel wrapper */
.shell > .timeline-root,
.shell > .table-wrap {
  animation: rise-in 600ms cubic-bezier(0.16, 1, 0.3, 1) 200ms both;
}

/* Hide mobile card column on desktop */
#feedsTable tbody td.mobile-card-link {
  display: none;
}

.section-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  opacity: 0.9;
}

/* View Toggle - removed, now in header */
.view-toggle {
  display: none;
}

/* Layout Switch - minimal icon buttons */
.layout-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.layout-btn {
  border: 0;
  border-radius: 6px;
  padding: 6px;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.layout-btn svg {
  width: 14px;
  height: 14px;
}

.layout-btn:hover {
  color: var(--ink);
}

.layout-btn.active {
  background: var(--panel);
  color: var(--accent);
  box-shadow: 0 1px 3px var(--shadow-color);
}

[data-theme="dark"] .layout-btn.active {
  background: linear-gradient(180deg, rgba(45, 55, 65, 0.9) 0%, rgba(35, 42, 50, 0.95) 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* Timeline */
.timeline-root {
  display: grid;
  gap: 12px;
}

.timeline-week {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: clip;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 12px var(--shadow-color);
}

[data-theme="dark"] .timeline-week {
  border-color: rgba(48, 54, 61, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .timeline-week:hover {
  border-color: rgba(88, 166, 255, 0.15);
}

.timeline-week-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 107, 138, 0.05) 0%, rgba(15, 107, 138, 0.02) 100%);
}

[data-theme="dark"] .timeline-week-head {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.06) 0%, rgba(88, 166, 255, 0.02) 100%);
  border-color: rgba(48, 54, 61, 0.8);
}

.timeline-week-head::-webkit-details-marker {
  display: none;
}

.timeline-week-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

.timeline-week-head h3::before {
  content: "▾";
  margin-right: 8px;
  color: var(--accent);
  transition: transform 0.2s ease;
  display: inline-block;
}

.timeline-week:not([open]) .timeline-week-head h3::before {
  content: "▸";
  transform: rotate(-90deg);
}

.timeline-count {
  color: var(--ink-soft);
  font: 600 0.75rem/1 "IBM Plex Mono", monospace;
}

.timeline-topic {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
}

.timeline-topic:first-of-type {
  border-top: 0;
}

.timeline-topic-head {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.timeline-topic[open] .timeline-topic-head {
  margin-bottom: 8px;
}

.timeline-topic-head .topic-pill::before {
  content: "▾";
  margin-right: 5px;
  color: var(--ink-soft);
  transition: transform 0.2s ease;
  display: inline-block;
}

.timeline-topic:not([open]) .timeline-topic-head .topic-pill::before {
  content: "▸";
  transform: rotate(-90deg);
}

.timeline-items {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  padding: 10px 12px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.timeline-item:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 4px 12px var(--shadow-color);
}

[data-theme="dark"] .timeline-item {
  border-color: rgba(48, 54, 61, 0.6);
  background: linear-gradient(180deg, rgba(30, 35, 42, 0.8) 0%, rgba(25, 30, 36, 0.9) 100%);
}

[data-theme="dark"] .timeline-item:hover {
  border-color: rgba(88, 166, 255, 0.2);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.timeline-item-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--ink-soft);
  font: 500 0.72rem/1.2 "IBM Plex Mono", monospace;
}

.timeline-item-link {
  display: inline-block;
  margin-top: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  text-decoration: none;
  transition: color 0.2s ease;
}

.timeline-item-link:hover {
  color: var(--accent);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.empty-state-cell {
  padding: 0;
  border: none;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(15, 107, 138, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  color: var(--accent);
}

[data-theme="dark"] .empty-state-icon {
  background: rgba(88, 166, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.15), 0 4px 16px rgba(88, 166, 255, 0.1);
}

.empty-state h3 {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
}

.empty-state p {
  margin: 0 0 20px;
  font-size: 0.9rem;
  max-width: 280px;
}

.empty-state-action {
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--accent);
  font: 600 0.85rem/1 "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.empty-state-action:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

[data-theme="dark"] .empty-state-action {
  background: rgba(28, 33, 40, 0.8);
  border-color: rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .empty-state-action:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.9) 0%, rgba(56, 139, 253, 0.95) 100%);
  border-color: rgba(88, 166, 255, 0.6);
  box-shadow: 0 4px 16px rgba(88, 166, 255, 0.2);
}

/* Feed Loader */
.feed-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 24px;
  text-align: center;
  color: var(--ink-soft);
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

.feed-loader p {
  margin: 0;
  font-size: 0.9rem;
}

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

/* Skeleton Loading Animation */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--line) 25%,
    var(--panel) 50%,
    var(--line) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(
    90deg,
    rgba(48, 54, 61, 0.6) 25%,
    rgba(35, 42, 50, 0.8) 50%,
    rgba(48, 54, 61, 0.6) 75%
  );
  background-size: 200% 100%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 1em;
  margin-bottom: 0.5em;
}

.skeleton-text:last-child {
  width: 80%;
}

.skeleton-title {
  height: 1.25em;
  width: 60%;
  margin-bottom: 0.75em;
}

.skeleton-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.skeleton-table-row {
  display: flex;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.skeleton-table-row:last-child {
  border-bottom: none;
}

.skeleton-cell {
  height: 1em;
  flex: 1;
}

.skeleton-cell:first-child {
  flex: 2;
}

.skeleton-badge {
  width: 60px;
  height: 24px;
  border-radius: 12px;
}

.skeleton-metric {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.skeleton-metric-value {
  height: 2em;
  width: 40%;
  margin-bottom: 8px;
}

.skeleton-metric-label {
  height: 0.875em;
  width: 60%;
}

/* Skeleton responsive styles */
@media (max-width: 768px) {
  .skeleton-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .skeleton-metric {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 12px;
  }

  .skeleton-metric:nth-child(3),
  .skeleton-metric:nth-child(4) {
    display: none;
  }

  .skeleton-metric-value {
    height: 1.5em;
    width: 50%;
    margin-bottom: 6px;
  }

  .skeleton-metric-label {
    height: 0.75em;
    width: 70%;
  }

  /* Skeleton table becomes cards on mobile */
  .skeleton-table-row {
    display: block;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--panel);
  }

  .skeleton-table-row:last-child {
    border-bottom: 1px solid var(--line);
  }

  .skeleton-cell {
    display: block;
    margin-bottom: 8px;
  }

  .skeleton-cell:last-child {
    margin-bottom: 0;
  }

  /* Skeleton tag cloud responsive */
  .skeleton-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
  }

  /* Skeleton tag list becomes compact */
  .skeleton-tag-item {
    padding: 10px 0;
  }
}

.timeline-empty {
  display: none;
}

/* Tables */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 2px 12px var(--shadow-color);
}

[data-theme="dark"] .table-wrap {
  border-color: rgba(48, 54, 61, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

/* Hide mobile-meta column on desktop */
#sourcesTable th.mobile-meta,
#sourcesTable td.mobile-meta {
  display: none;
}

/* Streamlined table inside panel - remove double border effect */
.panel > .table-wrap {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}

#feedsTable th:nth-child(1),
#feedsTable td:nth-child(1) {
  width: 140px;
  white-space: nowrap;
}

#feedsTable th:nth-child(3),
#feedsTable td:nth-child(3) {
  width: 120px;
  white-space: nowrap;
}

thead {
  background: rgba(15, 107, 138, 0.08);
}

[data-theme="dark"] thead {
  background: rgba(88, 166, 255, 0.08);
}

th, td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-soft);
}

tbody tr {
  transition: background 0.1s ease;
}

tbody tr:hover {
  background: rgba(15, 107, 138, 0.12);
}

[data-theme="dark"] tbody tr:hover {
  background: rgba(88, 166, 255, 0.08);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* Topic Pills */
.topic-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.74rem;
  background: rgba(15, 107, 138, 0.1);
  color: var(--accent);
  font-weight: 700;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.topic-pill:hover {
  background: rgba(15, 107, 138, 0.2);
}

[data-theme="dark"] .topic-pill {
  background: rgba(88, 166, 255, 0.1);
}

[data-theme="dark"] .topic-pill:hover {
  background: rgba(88, 166, 255, 0.18);
}

/* Status Colors */
.status-healthy { color: var(--good); }
.status-degraded { color: var(--warn); }
.status-down, .status-failed { color: var(--bad); }

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg);
  color: var(--ink-soft);
}

.chip.status-healthy {
  background: rgba(31, 126, 58, 0.15);
  color: var(--good);
}

.chip.status-degraded {
  background: rgba(154, 91, 23, 0.15);
  color: var(--warn);
}

.chip.status-down, .chip.status-failed {
  background: rgba(162, 35, 43, 0.15);
  color: var(--bad);
}

[data-theme="dark"] .chip.status-healthy {
  background: rgba(63, 185, 80, 0.12);
}

[data-theme="dark"] .chip.status-degraded {
  background: rgba(210, 153, 34, 0.1);
}

[data-theme="dark"] .chip.status-down, [data-theme="dark"] .chip.status-failed {
  background: rgba(248, 81, 73, 0.1);
}

/* Sources */
.source-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.source-favicon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 3px var(--shadow-color);
  flex-shrink: 0;
}

.event-favicon {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 1px 2px var(--shadow-color);
  flex-shrink: 0;
  vertical-align: middle;
  margin-right: 6px;
}

.event-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  color: inherit;
  transition: color 0.2s ease;
  font-weight: 600;
}

.event-title:hover {
  color: var(--accent);
}

/* Status History */
.status-history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.status-history-row {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 14px;
  padding: 14px;
  transition: all 0.2s ease;
}

.status-history-row:hover {
  box-shadow: 0 4px 12px var(--shadow-color);
}

[data-theme="dark"] .status-history-row {
  border-color: rgba(48, 54, 61, 0.8);
  background: linear-gradient(180deg, rgba(32, 38, 46, 0.9) 0%, rgba(28, 33, 40, 0.95) 100%);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .status-history-row:hover {
  border-color: rgba(48, 54, 61, 0.9);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.status-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.status-history-meta {
  color: var(--ink-soft);
  font: 500 0.8rem/1.2 "IBM Plex Mono", monospace;
}

.status-bars {
  display: grid;
  grid-template-columns: repeat(90, minmax(3px, 1fr));
  gap: 2px;
}

.status-dot {
  height: 14px;
  border-radius: 3px;
  background: var(--line);
  transition: transform 0.15s ease;
}

.status-dot:hover {
  transform: scaleY(1.3);
}

.status-dot.ok {
  background: linear-gradient(180deg, var(--good), #2ea043);
}

.status-dot.bad {
  background: linear-gradient(180deg, var(--bad), #f85149);
}

.history-inline {
  display: grid;
  grid-template-columns: repeat(30, minmax(2px, 1fr));
  gap: 1px;
  min-width: 90px;
  height: 4px;
  align-items: center;
}

.history-inline .status-dot {
  height: 4px;
  border-radius: 1px;
  min-width: 3px;
  flex-shrink: 0;
}

.history-meta {
  display: inline-block;
  margin-top: 4px;
  color: var(--ink-soft);
  font: 500 0.72rem/1 "IBM Plex Mono", monospace;
}

/* Run History */
.run-history-row {
  padding: 14px 0;
}

.run-bars {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.run-bars::-webkit-scrollbar {
  display: none;
}

.run-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: var(--line);
  flex-shrink: 0;
}

.run-dot.ok,
.run-dot.status-healthy {
  background: var(--good);
}

.run-dot.bad,
.run-dot.status-failed,
.run-dot.status-down {
  background: var(--bad);
}

/* Tag Cloud */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 12px;
  align-items: flex-end;
}

.tag-cloud.stage {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(15, 107, 138, 0.03) 0%, rgba(15, 107, 138, 0.01) 100%);
}

[data-theme="dark"] .tag-cloud.stage {
  background: linear-gradient(180deg, rgba(88, 166, 255, 0.04) 0%, rgba(88, 166, 255, 0.02) 100%);
  border-color: rgba(88, 166, 255, 0.2);
}

.cloud-tag {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  font-size: var(--tag-size, 1rem);
  line-height: 1;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  box-shadow: 0 2px 4px var(--shadow-color);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.cloud-tag span {
  font: 500 0.72rem/1 "IBM Plex Mono", monospace;
  color: var(--ink-soft);
}

.cloud-tag:hover {
  background: rgba(15, 107, 138, 0.1);
  border-color: var(--accent);
  color: var(--accent);
}

[data-theme="dark"] .cloud-tag {
  background: linear-gradient(180deg, rgba(35, 42, 50, 0.9) 0%, rgba(28, 33, 40, 0.95) 100%);
  border-color: rgba(48, 54, 61, 0.7);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

[data-theme="dark"] .cloud-tag:hover {
  background: linear-gradient(180deg, rgba(45, 55, 65, 0.95) 0%, rgba(35, 42, 50, 1) 100%);
  border-color: rgba(88, 166, 255, 0.25);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

/* Tag Rank List */
.tag-rank-list {
  display: grid;
  gap: 0;
}

.tag-rank-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 8px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.2s ease;
}

.tag-rank-row:first-child {
  border-top: 0;
}

.tag-rank-row:hover {
  background: rgba(15, 107, 138, 0.06);
  border-radius: 8px;
}

[data-theme="dark"] .tag-rank-row:hover {
  background: rgba(88, 166, 255, 0.08);
}

.rank-index {
  font: 600 0.8rem/1 "IBM Plex Mono", monospace;
  color: var(--ink-soft);
  text-align: center;
}

.rank-name {
  font-weight: 700;
}

.rank-count {
  font: 600 0.78rem/1 "IBM Plex Mono", monospace;
  color: var(--ink-soft);
}

/* Cards */
.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.panel > .cards {
  margin-top: 10px;
}

/* Cards with visual separation (incidents, etc.) */
.cards.cards-separated {
  gap: 0;
}

.cards.cards-separated .card {
  border-top: 1px solid var(--line);
  padding: 12px;
  border-radius: 8px;
  margin: 0 -12px;
}

.cards.cards-separated > .card:first-child {
  border-top: none;
}

.cards.cards-separated .card:hover {
  margin: 0 -12px;
  padding: 12px;
}

.card {
  padding: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  transition: all 0.2s ease;
}

.cards > .card:first-child {
  border-top: 0;
}

.card:hover {
  background: rgba(15, 107, 138, 0.05);
}

[data-theme="dark"] .card:hover {
  background: rgba(88, 166, 255, 0.06);
}

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

.meta-row {
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

/* Incident Cards - Minimal */
.incident-card {
  padding: 12px 0;
}

.incident-card .card-head {
  margin-bottom: 4px;
  align-items: baseline;
}

.incident-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--accent);
  text-decoration: none;
  flex: 1;
}

.incident-title:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.incident-card .meta-row {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.incident-card .meta-row a {
  color: var(--ink-soft);
}

.incident-card .meta-row a:hover {
  color: var(--accent);
}

/* Empty state for incidents */
.incident-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 32px 24px;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.incident-empty svg {
  width: 20px;
  height: 20px;
  color: var(--good);
}

.card-link {
  display: inline-block;
  margin-top: 8px;
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--accent);
  text-decoration: none;
  transition: all 0.2s ease;
}

.card-link:hover {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--accent-2);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--panel);
  color: var(--ink);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 16px var(--shadow-color);
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

[data-theme="dark"] .back-to-top {
  background: linear-gradient(180deg, rgba(35, 42, 50, 0.95) 0%, rgba(28, 33, 40, 0.98) 100%);
  border-color: rgba(48, 54, 61, 0.8);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .back-to-top:hover {
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.9) 0%, rgba(56, 139, 253, 0.95) 100%);
  border-color: rgba(88, 166, 255, 0.6);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.25);
}

/* Animations */
@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsive */
@media (max-width: 768px) {
  :root {
    --header-height: 56px;
    --search-height: 56px;
    --bottom-nav-height: 56px;
  }

  body {
    padding-top: calc(var(--header-height) + var(--search-height));
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  body.no-search {
    padding-top: var(--header-height);
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }

  .top-bar-inner {
    padding: 0 16px;
    gap: 12px;
    grid-template-columns: 1fr auto;
  }

  .brand-text {
    font-size: 0.95rem;
  }

  /* Hide desktop nav on mobile */
  .desktop-nav {
    display: none;
  }

  /* Show and position mobile nav at bottom - compact */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    z-index: 1000;
    background: var(--panel);
    border-top: 1px solid var(--line);
    border-bottom: none;
    padding: 4px 12px calc(4px + env(safe-area-inset-bottom, 0px));
    gap: 0;
    justify-content: space-around;
    align-items: center;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .mobile-nav.nav-hidden {
    transform: translateY(100%);
  }

  .nav-item {
    flex-direction: column;
    padding: 4px 12px;
    font-size: 0.65rem;
    gap: 2px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    max-width: 70px;
  }

  .nav-item span {
    display: block;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }
  
  .header-layout-switch {
    height: 44px;
    padding: 2px;
  }
  
  .header-layout-switch .layout-btn {
    height: 40px;
    width: 40px;
    min-height: 40px;
    min-width: 40px;
    padding: 4px;
  }
  
  .header-layout-switch .layout-btn svg {
    width: 20px;
    height: 20px;
  }

  /* Bottom nav active state */
  .nav-item.active {
    background: rgba(15, 107, 138, 0.15);
  }

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

  .search-bar {
    padding: 10px 12px;
  }

  .search-bar-inner {
    gap: 8px;
  }
  
  #searchInput {
    height: 40px;
    font-size: 0.9rem;
  }

  .sort-select {
    height: 40px;
    font-size: 0.85rem;
    min-width: 85px;
    padding: 0 28px 0 10px;
    background-position: right 8px center;
  }
  
  .filter-toggle {
    height: 40px;
    padding: 0 12px;
    font-size: 0.8rem;
  }
  
  .filter-toggle > span:first-of-type {
    display: none;
  }
  
  .shell {
    padding: 16px 12px calc(24px + var(--bottom-nav-height) + env(safe-area-inset-bottom, 0px));
  }
  
  .hero h1 {
    font-size: 1.5rem;
  }
  
  /* Compact metrics bar on mobile */
  .grid.metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }

  .metric {
    flex: 1;
    min-width: calc(50% - 4px);
    padding: 10px 12px;
  }

  .metric:nth-child(3),
  .metric:nth-child(4),
  .metric:nth-child(5),
  .metric:nth-child(6) {
    display: none;
  }

  .metric h3 {
    font-size: 0.6rem;
    margin-bottom: 4px;
  }

  .metric p {
    font-size: 1.1rem;
  }
  
  .panel {
    padding: 16px;
    border-radius: 14px;
  }
  
  .panel h2 {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .header-actions {
    gap: 10px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
  }
  
  .timeline-week-head {
    padding: 10px 12px;
  }

  .timeline-week-head h3 {
    font-size: 0.9rem;
  }

  .timeline-topic {
    padding: 8px 10px;
  }

  .timeline-item {
    padding: 8px 10px;
  }
  
  .timeline-item-link {
    font-size: 0.88rem;
  }
  
  th, td {
    padding: 10px 12px;
    font-size: 0.85rem;
  }
  
  .tag-cloud {
    gap: 8px;
  }
  
  .tag-rank-row {
    grid-template-columns: 32px 1fr auto;
    gap: 8px;
    padding: 10px 4px;
  }
  
  .status-history-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .status-bars {
    grid-template-columns: repeat(45, minmax(4px, 1fr));
  }
  
  .history-inline {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 1px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
    min-width: auto;
    height: auto;
  }
  
  .history-inline::-webkit-scrollbar {
    display: none;
  }

  /* Mobile-friendly table cards - compact layout */
  #sourcesTable thead {
    display: none;
  }

  #sourcesTable tbody tr {
    display: block;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 10px;
    background: var(--panel);
  }

  #sourcesTable tbody tr:hover {
    background: rgba(15, 107, 138, 0.05);
  }

  #sourcesTable tbody td {
    display: block;
    padding: 0;
    border: none;
    font-size: 0.85rem;
  }

  #sourcesTable tbody td::before {
    display: none;
  }

  /* Top row: source + status dot */
  #sourcesTable tbody td:first-child {
    margin-bottom: 4px;
  }

  #sourcesTable tbody td:first-child .source-with-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  #sourcesTable tbody td:first-child .source-with-status::after {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--status-color, var(--ink-soft));
    flex-shrink: 0;
  }

  #sourcesTable tbody td:first-child .source-label {
    font-size: 0.95rem;
    font-weight: 600;
  }

  /* Hide status text cell on mobile */
  #sourcesTable tbody td:nth-child(2) {
    display: none;
  }

  /* Hide regular data cells on mobile (3,4,5 = Last Success, Failures, Latency) */
  #sourcesTable tbody td:nth-child(3),
  #sourcesTable tbody td:nth-child(4),
  #sourcesTable tbody td:nth-child(5) {
    display: none;
  }

  /* Show mobile meta row */
  #sourcesTable tbody td.mobile-meta {
    display: block !important;
    font-size: 0.75rem;
    color: var(--ink-soft);
  }

  #sourcesTable tbody td.mobile-meta:empty {
    display: none !important;
  }

  /* Hidden cells */
  #sourcesTable tbody td:nth-child(3),
  #sourcesTable tbody td:nth-child(4),
  #sourcesTable tbody td:nth-child(5) {
    display: none;
  }

  /* Hide history column (6th td) on mobile */
  #sourcesTable tbody td:nth-child(6) {
    display: none;
  }

  /* Mobile-friendly feeds table - card layout */
  #feedsTable thead {
    display: none;
  }

  #feedsTable tbody tr {
    display: block;
    padding: 0;
    border: none;
    border-radius: 0;
    margin-bottom: 12px;
    background: transparent;
  }

  #feedsTable tbody tr:last-child {
    margin-bottom: 16px;
  }

  /* Hide desktop cells on mobile */
  #feedsTable tbody td:nth-child(1),
  #feedsTable tbody td:nth-child(2),
  #feedsTable tbody td:nth-child(3),
  #feedsTable tbody td:nth-child(4) {
    display: none;
  }

    /* Mobile card link - full width clickable card */
  #feedsTable tbody td.mobile-card-link {
    display: block !important;
    padding: 0;
    border-bottom: none;
  }

  #feedsTable tbody tr:hover {
    background: transparent;
  }

  .mobile-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 0;
    background: var(--panel);
    text-decoration: none;
    color: var(--ink);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-card:hover,
  .mobile-card:active {
    background: rgba(15, 107, 138, 0.05);
    border-color: var(--accent);
  }

  [data-theme="dark"] .mobile-card {
    background: linear-gradient(180deg, rgba(35, 42, 50, 0.9) 0%, rgba(28, 33, 40, 0.95) 100%);
    border-color: rgba(48, 54, 61, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  }

  [data-theme="dark"] .mobile-card:hover,
  [data-theme="dark"] .mobile-card:active {
    background: linear-gradient(180deg, rgba(45, 55, 65, 0.95) 0%, rgba(35, 42, 50, 1) 100%);
    border-color: rgba(88, 166, 255, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
  }

  .mobile-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ink);
  }

  .mobile-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--ink-soft);
    flex-wrap: wrap;
  }

  .mobile-card-meta .source-favicon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    flex-shrink: 0;
  }

  .mobile-card-sep {
    color: var(--line);
  }

  .mobile-card-meta .topic-pill {
    font-size: 0.7rem;
    padding: 2px 8px;
    background: rgba(15, 107, 138, 0.08);
  }

  /* Compact card - remove extra padding when no history */
  #sourcesTable tbody tr {
    padding: 10px 12px;
  }

  .table-wrap {
    background: transparent;
    border: none;
    box-shadow: none;
  }

  #feedsTable {
    display: block;
  }

  #feedsTable tbody {
    display: block;
  }

  #feedsTable tbody tr {
    scroll-snap-align: start;
  }

  .back-to-top {
    width: 44px;
    height: 44px;
    font-size: 1.1rem;
    bottom: 16px;
    right: 16px;
  }
}

@media (max-width: 480px) {
  .grid.metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .metric h3 {
    font-size: 0.65rem;
  }
  
  .metric p {
    font-size: 1.2rem;
  }
}

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

/* RSS Page Styles */
.rss-panel {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px;
}

.rss-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.rss-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ff8c42, #ff6b35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.rss-icon svg {
  width: 28px;
  height: 28px;
}

.rss-title-wrap h1 {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.rss-subtitle {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.rss-section {
  margin-bottom: 28px;
}

.rss-section:last-of-type {
  margin-bottom: 0;
}

.rss-section h2 {
  margin: 0 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.feed-url-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 4px;
}

.feed-url {
  flex: 1;
  padding: 10px 12px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.85rem;
  color: var(--ink);
  background: transparent;
  border: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: 600 0.85rem/1 "Inter", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.copy-btn:hover {
  border-color: var(--accent);
  background: rgba(15, 107, 138, 0.08);
}

.copy-btn:active {
  transform: scale(0.98);
}

[data-theme="dark"] .copy-btn {
  background: rgba(28, 33, 40, 0.8);
  border-color: rgba(48, 54, 61, 0.8);
}

[data-theme="dark"] .copy-btn:hover {
  background: rgba(88, 166, 255, 0.1);
  border-color: rgba(88, 166, 255, 0.5);
}

.copy-icon {
  width: 16px;
  height: 16px;
}

.setup-steps,
.reader-list {
  margin: 0;
  padding-left: 20px;
  color: var(--ink);
}

.setup-steps li,
.reader-list li {
  margin-bottom: 10px;
  line-height: 1.5;
}

.setup-steps li:last-child,
.reader-list li:last-child {
  margin-bottom: 0;
}

.reader-list a {
  font-weight: 600;
}

.rss-meta {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.85rem;
}

.rss-meta p {
  margin: 0;
}

@media (max-width: 768px) {
  .rss-panel {
    padding: 24px;
  }
  
  .rss-header {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }
  
  .rss-icon {
    width: 48px;
    height: 48px;
  }
  
  .rss-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .rss-title-wrap h1 {
    font-size: 1.3rem;
  }
  
  .feed-url-wrap {
    flex-direction: column;
    align-items: stretch;
  }
  
  .feed-url {
    font-size: 0.8rem;
  }
  
  .copy-btn {
    justify-content: center;
  }
}

/* Feed end marker — tasteful "end of feed" message */
.feed-end-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 32px 16px 8px;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.feed-end-line {
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.feed-end-text {
  white-space: nowrap;
  opacity: 0.8;
}

@media (max-width: 760px) {
  .feed-end-marker {
    padding: 24px 12px 4px;
    font-size: 0.8rem;
  }
  .feed-end-line {
    max-width: 80px;
  }
}

/* View Transitions API support */
@view-transition {
  navigation: auto;
}

::view-transition-old(root) {
  animation: fade-out 0.2s ease-out forwards;
}

::view-transition-new(root) {
  animation: fade-in 0.2s ease-out forwards;
}

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

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