/* ==========================================================================
   DSeekApp - OpenAI / ChatGPT Codex Design System
   Obsidian Dark Palette, Crisp Typography, Tech Glow, High-Density Aesthetics
   Responsive Mobile-First Architecture (< 768px & < 480px)
   ========================================================================== */

:root,
[data-theme="dark"],
html.dark {
  color-scheme: dark;
  /* Dark Architecture: Deep Slate Background (#0d1117), avoiding pitch black #000 */
  --bg-page: #0d1117;
  --bg-surface: #161b22;
  --bg-surface-solid: #161b22;
  --bg-subtle: #21262d;
  --bg-card: #161b22;
  --bg-card-hover: #1c2128;
  --bg-card-active: #22272e;
  --bg-hover: rgba(255, 255, 255, 0.08);
  --bg-header: rgba(13, 17, 23, 0.85);

  /* Low-contrast soft luminous borders */
  --border-color: #30363d;
  --border-hover: #484f58;
  --border-active: #6e7681;
  --border-light: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(16, 185, 129, 0.35);
  --border-blue-glow: rgba(56, 189, 248, 0.35);

  /* High contrast WCAG AA text */
  --text-main: #f0f6fc;
  --text-secondary: #c9d1d9;
  --text-muted: #9ca3af;
  --text-soft: #8b949e;
  --text-faint: #6e7681;

  /* Diff colors: low-saturation color blocks */
  --diff-del-bg: rgba(239, 68, 68, 0.16);
  --diff-del-text: #f87171;
  --diff-del-border: rgba(239, 68, 68, 0.35);
  --diff-add-bg: rgba(16, 185, 129, 0.16);
  --diff-add-text: #34d399;
  --diff-add-border: rgba(16, 185, 129, 0.35);
  --diff-ctx-bg: rgba(255, 255, 255, 0.03);

  /* Accents */
  --accent-codex: #10a37f;
  --accent-codex-hover: #12b990;
  --accent-codex-glow: rgba(16, 163, 127, 0.3);
  --accent-codex-bg: rgba(16, 163, 127, 0.12);

  --color-brand: #38bdf8;
  --color-brand-bg: rgba(56, 189, 248, 0.12);
  --color-green: #10b981;
  --color-green-bg: rgba(16, 185, 129, 0.15);
  --color-orange: #f59e0b;
  --color-orange-bg: rgba(245, 158, 11, 0.15);
  --color-red: #ef4444;
  --color-red-bg: rgba(239, 68, 68, 0.15);
  --color-purple: #a855f7;
  --color-purple-bg: rgba(168, 85, 247, 0.15);
  --color-blue: #3b82f6;
  --color-blue-bg: rgba(59, 130, 246, 0.15);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.6);
  --shadow-hover: 0 12px 35px rgba(0, 0, 0, 0.8), 0 0 25px rgba(16, 185, 129, 0.12);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

[data-theme="light"],
html:not(.dark)[data-theme="light"] {
  color-scheme: light;
  /* Light Architecture: Soft slate-50 background (#f8fafc), pure white card surface (#ffffff) */
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-solid: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-card-active: #f1f5f9;
  --bg-hover: rgba(0, 0, 0, 0.04);
  --bg-header: rgba(255, 255, 255, 0.88);

  /* Subtle border + micro shadow */
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-active: #94a3b8;
  --border-light: #f1f5f9;
  --border-glow: rgba(16, 163, 127, 0.25);
  --border-blue-glow: rgba(37, 99, 235, 0.25);

  /* Readable high-contrast dark text */
  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-soft: #64748b;
  --text-faint: #cbd5e1;

  /* Diff colors: low-saturation color blocks for light mode */
  --diff-del-bg: #fee2e2;
  --diff-del-text: #b91c1c;
  --diff-del-border: #fca5a5;
  --diff-add-bg: #dcfce7;
  --diff-add-text: #15803d;
  --diff-add-border: #86efac;
  --diff-ctx-bg: #f8fafc;

  /* Accents */
  --accent-codex: #059669;
  --accent-codex-hover: #047857;
  --accent-codex-bg: rgba(5, 150, 105, 0.08);

  --color-brand: #0369a1;
  --color-brand-bg: rgba(2, 132, 199, 0.08);
  --color-green: #059669;
  --color-green-bg: rgba(5, 150, 105, 0.08);
  --color-orange: #d97706;
  --color-orange-bg: rgba(217, 119, 6, 0.08);
  --color-red: #dc2626;
  --color-red-bg: rgba(220, 38, 38, 0.08);
  --color-purple: #7c3aed;
  --color-purple-bg: rgba(124, 58, 237, 0.08);
  --color-blue: #2563eb;
  --color-blue-bg: rgba(37, 99, 235, 0.08);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-card: 0 4px 18px rgba(0, 0, 0, 0.06);
  --shadow-hover: 0 12px 30px rgba(0, 0, 0, 0.08);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* ================= Global Resets & Typography ================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 15px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--bg-page);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease, opacity 0.15s ease, border-color 0.15s ease;
}

code, kbd, pre, .font-mono {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  outline: none;
  background: transparent;
}

/* Ambient Video Loop Backdrop (ChatGPT Codex Style) */
.codex-video-backdrop {
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 0;
  overflow: hidden;
  height: 680px;
  mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 60%, transparent 100%);
}
.codex-video-backdrop video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.45;
}

/* Ambient Glow & Grid Backdrop */
.codex-ambient-glow {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  max-width: 100vw;
  height: 580px;
  background: radial-gradient(ellipse 65% 50% at 50% 30%, rgba(16, 185, 129, 0.16), rgba(56, 189, 248, 0.08) 45%, rgba(168, 85, 247, 0.04) 70%, transparent 85%);
  pointer-events: none;
  z-index: 0;
}

/* ================= Header / Codex Floating Nav ================= */
.site-header {
  background: var(--bg-header);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  height: 60px;
  display: flex;
  align-items: center;
  width: 100%;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

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

.brand-wrap a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
}
.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  flex-shrink: 0;
}
.brand-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
  white-space: nowrap;
}
.brand-badge {
  font-size: 0.68rem;
  color: var(--color-brand);
  background: var(--color-brand-bg);
  border: 1px solid var(--border-blue-glow);
  padding: 0.12rem 0.45rem;
  border-radius: 9999px;
  font-weight: 600;
  margin-left: 0.25rem;
  white-space: nowrap;
}

/* Nav Menu (Desktop) */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 0.25rem;
  border-radius: 9999px;
}
.nav-item {
  padding: 0.35rem 0.95rem;
  border-radius: 9999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.nav-item:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}
.nav-item.active {
  color: #0d1117 !important;
  background: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}
[data-theme="light"] .nav-item.active {
  color: #ffffff !important;
  background: #0f172a !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 4px 12px;
  border-radius: 9999px;
  white-space: nowrap;
}
.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseGlow 2s infinite ease-in-out;
}
@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

.btn-theme-toggle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-theme-toggle:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

.btn-hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}
.btn-hamburger:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}
.btn-hamburger:active {
  background: var(--bg-hover);
}

/* Mobile Navigation Drawer & Backdrop */
.mobile-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 48;
  transition: opacity 0.2s ease;
}
.mobile-drawer-overlay.hidden {
  display: none;
}

.mobile-drawer {
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  background: var(--bg-surface-solid);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 1.25rem 1.5rem 1.25rem;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: calc(100vh - 60px);
  max-height: calc(100dvh - 60px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-card);
  animation: slideDownDrawer 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDownDrawer {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
.mobile-drawer.hidden {
  display: none;
}
.mobile-nav-link {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}
.mobile-nav-link:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}
.mobile-nav-link.active {
  color: var(--color-brand);
  background: var(--bg-hover);
  font-weight: 700;
}
[data-theme="light"] .mobile-nav-link.active {
  color: var(--color-brand);
  background: var(--bg-subtle);
  font-weight: 700;
}

/* ================= Main Container ================= */
.main-wrap {
  max-width: 1360px;
  width: 100%;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 5rem 1.5rem;
  position: relative;
  z-index: 10;
}

/* Hero Section */
.hero-compact {
  text-align: center;
  padding-top: 1.5rem;
  padding-bottom: 1.75rem;
  max-width: 840px;
  margin: 0 auto;
}
.hero-icon-wrap {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  background: transparent;
  border: 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.3);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="light"] .hero-icon-wrap {
  background: transparent;
  border: 0;
  box-shadow: 0 12px 28px rgba(48, 32, 68, 0.12);
}
.hero-icon-wrap:hover {
  transform: scale(1.04);
}
.hero-icon-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.hero-title,
.hero-text h1 {
  font-size: clamp(1.65rem, 5.2vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  margin: 0 0 0.75rem 0;
  color: var(--text-main);
  line-height: 1.25;
  word-break: break-word;
}
.hero-desc,
.hero-text p {
  font-size: clamp(0.88rem, 2.4vw, 1.02rem);
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0 auto;
  max-width: 740px;
}
.hero-desc strong {
  color: var(--text-main);
}

.hero-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  padding: 6px 16px;
  border-radius: 9999px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-top: 1.25rem;
  backdrop-filter: blur(10px);
}

/* ================= Homepage briefing & important changes ================= */
.home-page {
  padding-top: 1.6rem;
}
.home-intro {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  margin: 0 0 1.4rem;
}
.home-intro-copy {
  min-width: 0;
}
.home-intro .hero-title {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  font-weight: 750;
  letter-spacing: -0.035em;
  margin-bottom: 0.45rem;
  line-height: 1.35;
}
.home-intro .hero-desc {
  font-size: 0.8rem;
  line-height: 1.7;
  margin: 0;
}
.home-intro-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem 1rem;
  flex-shrink: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.home-intro-meta strong {
  color: var(--text-secondary);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.milestones-card-panel {
  position: relative;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.milestones-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  grid-template-areas: "title range toggle" "subtitle range toggle";
  align-items: center;
  gap: 0.25rem 1rem;
  padding: 1.1rem 1.45rem 0.9rem;
  border-bottom: 1px solid var(--border-light);
}
.milestones-heading-row {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.milestones-toggle {
  grid-area: toggle;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 36px;
  padding: 0.35rem 0.5rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  white-space: nowrap;
}
.milestones-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
  color: var(--text-main);
}
.milestones-toggle svg {
  flex-shrink: 0;
}
.milestones-toggle[aria-expanded="false"] svg {
  transform: rotate(180deg);
}
.milestones-card-panel[data-collapsed="true"] .milestones-header {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "title toggle";
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 0;
}
#milestones-content[hidden],
.milestones-card-panel[data-collapsed="true"] .milestones-sub,
.milestones-card-panel[data-collapsed="true"] .milestones-range {
  display: none;
}
.milestones-mark {
  color: var(--color-brand);
  display: inline-flex;
}
.milestones-heading {
  font-size: 1.12rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-main);
}
.milestones-top-label {
  color: var(--color-brand);
  background: var(--color-brand-bg);
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}
.milestones-sub {
  grid-area: subtitle;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}
.milestones-range {
  grid-area: range;
  display: flex;
  flex-shrink: 0;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border-light);
  border-radius: 9px;
  background: var(--bg-page);
}
.milestones-range button {
  min-height: 34px;
  padding: 0.3rem 0.8rem;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-muted);
  background: transparent;
  font-size: 0.75rem;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}
.milestones-range button:hover {
  color: var(--text-main);
}
.milestones-range button[aria-pressed="true"] {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
  box-shadow: var(--shadow-sm);
}
.milestones-list {
  display: grid;
  grid-auto-flow: column;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(var(--milestone-rows, 5), auto);
  list-style: none;
  padding: 0.3rem 0.6rem;
  margin: 0;
}
.milestone-item-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr);
  gap: 0.15rem 0.65rem;
  position: relative;
  min-width: 0;
  padding: 0.7rem 0.85rem 0.6rem;
  border-bottom: 1px solid var(--border-light);
  border-radius: 6px;
  transition: background 0.15s ease;
}
.milestone-item-row[data-column="2"] {
  border-left: 1px solid var(--border-light);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}
.milestone-item-row:hover,
.milestone-item-row:focus-within {
  background: var(--bg-hover);
}
.milestone-rank-badge {
  grid-column: 1;
  grid-row: 1 / 4;
  align-self: start;
  padding-top: 0.95rem;
  color: var(--text-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: -0.08em;
  font-variant-numeric: tabular-nums;
}
.milestone-rank-badge.top-rank {
  color: var(--color-brand);
  font-weight: 700;
}
.milestone-overline {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.milestone-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 550;
}
.milestone-category {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.milestone-category::before {
  content: "·";
  padding-right: 0.4rem;
  color: var(--text-soft);
}
.milestone-time {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.milestone-item-title {
  grid-column: 2;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: var(--text-main);
  font-size: 0.94rem;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.milestone-item-title:hover {
  color: var(--color-brand);
}
.milestone-item-title::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 6px;
}
.milestone-bottom {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.milestone-item-summary {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.milestone-source {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 24px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.milestone-source:hover {
  color: var(--color-brand);
}
.milestones-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem 1.25rem;
  padding: 0.4rem 1.45rem 0.5rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}
#milestones-status {
  margin-right: auto;
}
#milestones-status[data-state="error"] {
  color: var(--diff-del-text);
}
.milestones-all-link,
.milestones-method summary {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: 32px;
  cursor: pointer;
}
.milestones-all-link:hover,
.milestones-method summary:hover {
  color: var(--color-brand);
}
.milestones-method {
  position: relative;
}
.milestones-method summary {
  list-style: none;
}
.milestones-method summary::-webkit-details-marker {
  display: none;
}
.milestones-method summary::after {
  content: "+";
}
.milestones-method[open] summary::after {
  content: "−";
}
.milestones-method-note {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.5rem);
  z-index: 20;
  width: min(28rem, 80vw);
  padding: 1.1rem 1.25rem;
  background: var(--bg-surface-solid);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.8;
}
.milestones-method-note strong {
  color: var(--text-main);
  font-size: 0.9rem;
}
.milestones-method-note p {
  margin-top: 0.55rem;
}
.milestones-expand {
  display: none;
}
.milestones-loading,
.milestones-empty {
  min-height: 16rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 2rem;
  text-align: center;
  font-size: 0.86rem;
  color: var(--text-secondary);
}
.milestones-empty p {
  font-size: 0.76rem;
  color: var(--text-muted);
}
.milestones-empty a,
.milestones-empty button {
  color: var(--color-brand);
  background: transparent;
  font-size: 0.8rem;
  padding: 0.5rem;
}
.milestones-card-panel a:focus-visible,
.milestones-card-panel button:focus-visible,
.milestones-card-panel summary:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (max-width: 1100px) {
  .home-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }
  .home-intro-meta {
    gap: 1rem;
  }
}
@media (max-width: 768px) {
  .home-page {
    padding-top: 1.1rem;
  }
  .home-intro {
    margin-bottom: 1rem;
    gap: 0.45rem;
  }
  .home-intro .hero-title {
    font-size: clamp(1.35rem, 5.3vw, 1.65rem);
    margin-bottom: 0.3rem;
  }
  .home-intro .hero-desc {
    font-size: 0.78rem;
  }
  .hero-full-name {
    display: none;
  }
  .home-intro-meta {
    width: 100%;
    gap: 0.4rem 0.9rem;
    font-size: 0.7rem;
  }
  .milestones-card-panel {
    margin-bottom: 1.1rem;
    border-radius: 12px;
  }
  .milestones-header {
    padding: 0.95rem 1rem 0.8rem;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "title toggle" "subtitle subtitle" "range range";
    gap: 0.25rem 0.5rem;
  }
  .milestones-heading {
    font-size: 1.04rem;
  }
  .milestones-sub {
    font-size: 0.71rem;
  }
  .milestones-range {
    width: 100%;
    margin-top: 0.55rem;
  }
  .milestones-range button {
    flex: 1;
    min-height: 36px;
  }
  .milestones-list {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    grid-auto-flow: row;
    padding: 0.2rem 0.35rem;
  }
  .milestone-item-row {
    padding: 0.8rem 0.65rem 0.6rem;
    grid-template-columns: 1.6rem minmax(0, 1fr);
    column-gap: 0.55rem;
  }
  .milestone-item-row[data-column="2"] {
    border-left: 0;
  }
  .milestones-card-panel[data-expanded="false"] .milestone-item-row:nth-child(n+4) {
    display: none;
  }
  .milestone-item-title {
    font-size: 0.96rem;
    padding: 0.2rem 0;
  }
  .milestone-source {
    min-height: 32px;
    min-width: 44px;
  }
  .milestone-overline {
    font-size: 0.73rem;
    gap: 0.3rem;
  }
  .milestone-category::before {
    padding-right: 0.3rem;
  }
  .milestone-time {
    font-size: 0.7rem;
  }
  .milestones-expand {
    display: flex;
    width: calc(100% - 2rem);
    margin: 0.35rem 1rem;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 40px;
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: 7px;
    color: var(--text-secondary);
    font-size: 0.76rem;
  }
  .milestones-expand[hidden] {
    display: none;
  }
  .milestones-footer {
    padding: 0.3rem 1rem 0.6rem;
    gap: 0.1rem 1rem;
    font-size: 0.68rem;
  }
  #milestones-status {
    flex-basis: 100%;
  }
  .milestones-method summary,
  .milestones-all-link {
    min-height: 36px;
  }
  .milestones-all-link {
    margin-left: auto;
  }
  .milestones-method-note {
    left: 0;
    right: auto;
    width: min(28rem, calc(100vw - 4rem));
  }
  .milestones-loading,
  .milestones-empty {
    min-height: 15rem;
    padding: 1.4rem;
  }
}

/* ================= Control & Filter Panel ================= */
.control-panel {
  background: rgba(14, 18, 26, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
  width: 100%;
}

.search-box-wrap {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 1 280px;
  min-width: 220px;
  max-width: 100%;
}
.search-box-input {
  display: block;
  width: 100%;
  min-width: 0;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 0.6rem 2.75rem 0.6rem 2.5rem;
  color: var(--text-main);
  font-size: 0.86rem;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
}
input.search-box-input {
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.4;
}
input.search-box-input::-webkit-search-decoration,
input.search-box-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}
.search-box-input:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px var(--border-blue-glow);
  background: rgba(0, 0, 0, 0.75);
}
[data-theme="light"] .search-box-input {
  background: #ffffff;
  color: var(--text-main);
  border-color: var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
[data-theme="light"] .search-box-input:focus {
  background: #ffffff;
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}
.search-box-input::placeholder {
  color: var(--text-soft);
}
select.search-box-input {
  border-radius: 12px;
  padding: 0.65rem 1rem;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}
select.search-box-input option {
  background-color: var(--bg-surface-solid);
  color: var(--text-main);
}
.search-box-icon,
.search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  line-height: 1;
  font-size: 0.88rem;
  z-index: 2;
}
.search-box-icon svg,
.search-clear-btn svg {
  display: block;
  flex: none;
}
.search-clear-btn {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 8px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  border-radius: 50%;
  transition: color 0.15s ease;
}
.search-clear-btn:hover {
  color: var(--text-main);
}

.app-selector-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.app-pill {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 36px;
  line-height: 1;
}
.app-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-hover);
}
.app-pill.active {
  background: #ffffff !important;
  color: #0d1117 !important;
  font-weight: 700 !important;
  border-color: #ffffff !important;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}
[data-theme="light"] .app-pill {
  background: var(--bg-subtle);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
[data-theme="light"] .app-pill:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border-color: var(--border-hover);
}
[data-theme="light"] .app-pill.active {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}
.pill-logo {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.type-filter-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.type-pill {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  line-height: 1;
}
.type-pill:hover {
  background: var(--bg-subtle);
  color: var(--text-main);
  border-color: var(--border-hover);
}
.type-pill.active {
  background: #ffffff !important;
  color: #0d1117 !important;
  font-weight: 700 !important;
  border-color: #ffffff !important;
}
[data-theme="light"] .type-pill {
  background: var(--bg-subtle);
  border-color: var(--border-color);
  color: var(--text-secondary);
}
[data-theme="light"] .type-pill:hover {
  background: #e2e8f0;
  color: var(--text-main);
  border-color: var(--border-hover);
}
[data-theme="light"] .type-pill.active {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border-color: #0f172a !important;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);
}

/* ================= Main Data Table Container ================= */
.data-table-container {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 2rem;
}
.data-table-header-bar {
  padding: 1rem 1.5rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.btn-reset-filters {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 12px;
  border-radius: 9999px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-reset-filters:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #ef4444;
}
#row-count,
#results-count {
  font-size: 0.78rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 3px 10px;
  border-radius: 9999px;
  white-space: nowrap;
}

/* Table Styles (Desktop) */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}
.data-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.data-table td {
  padding: 1.15rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.data-table tr:last-child td {
  border-bottom: none;
}
.data-table tr:hover {
  background: var(--bg-hover);
}

/* Semantic Column Styling */
.col-app .cell-app {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.app-icon-mini {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.app-official-logo {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.app-meta-title {
  font-weight: 700;
  color: var(--text-main);
  font-size: 0.88rem;
  text-decoration: none;
}
.app-meta-title:hover {
  color: var(--color-brand);
}
.app-meta-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  display: block;
}

.cell-change-title a {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  text-decoration: none;
}
.cell-change-title a:hover {
  color: var(--color-brand);
}
.cell-change-summary {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  line-height: 1.5;
}

/* Delta / Diff Box */
.table-delta-box {
  margin-top: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.76rem;
}
[data-theme="light"] .table-delta-box {
  background: var(--bg-subtle);
  border-color: var(--border-color);
}
.table-delta-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 3px 0;
}
.delta-label.old {
  color: #f87171;
  font-weight: 600;
  flex-shrink: 0;
}
[data-theme="light"] .delta-label.old {
  color: #dc2626;
}
.delta-label.new {
  color: #34d399;
  font-weight: 600;
  flex-shrink: 0;
}
[data-theme="light"] .delta-label.new {
  color: #16a34a;
}
.delta-text {
  color: var(--text-main);
  word-break: break-word;
  white-space: pre-wrap;
  line-height: 1.45;
  max-height: 140px;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Badges */
.badge-clean {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
  white-space: nowrap;
}
.badge-clean.pricing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
[data-theme="light"] .badge-clean.pricing {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.badge-clean.model {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
[data-theme="light"] .badge-clean.model {
  background: #f3e8ff;
  color: #6b21a8;
  border-color: #e9d5ff;
}
.badge-clean.api {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}
[data-theme="light"] .badge-clean.api {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.badge-clean.feature {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
[data-theme="light"] .badge-clean.feature {
  background: #dcfce7;
  color: #15803d;
  border-color: #bbf7d0;
}
.badge-clean.deprecation {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
[data-theme="light"] .badge-clean.deprecation {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.badge-clean.version {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
[data-theme="light"] .badge-clean.version {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}
.badge-clean.policy {
  background: rgba(234, 88, 12, 0.15);
  color: #fb923c;
  border: 1px solid rgba(234, 88, 12, 0.3);
}
[data-theme="light"] .badge-clean.policy {
  background: #fef9c3;
  color: #854d0e;
  border-color: #fde047;
}
.badge-clean.other {
  background: var(--bg-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}
[data-theme="light"] .badge-clean.other {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.badge-impact-clean {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
}
.badge-impact-clean.high, .badge-impact-clean.critical {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}
[data-theme="light"] .badge-impact-clean.high,
[data-theme="light"] .badge-impact-clean.critical {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.badge-impact-clean.medium {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
}
[data-theme="light"] .badge-impact-clean.medium {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}
.badge-impact-clean.low {
  background: var(--bg-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}
[data-theme="light"] .badge-impact-clean.low {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.cell-source-link {
  color: var(--color-brand);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}
.cell-source-link:hover {
  text-decoration: underline;
}
.badge-verified {
  font-size: 0.68rem;
  color: #10b981;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  display: inline-block;
  white-space: nowrap;
}
[data-theme="light"] .badge-verified {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}

/* Date Cell with exact HH:mm:ss */
.cell-date-exact {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.badge-today-tag {
  display: inline-block;
  font-size: 0.65rem;
  color: #34d399;
  font-weight: 600;
}
.badge-recent-tag {
  display: inline-block;
  font-size: 0.65rem;
  color: #38bdf8;
  font-weight: 600;
}

/* ================= KPI Grid & Cards (Admin & Detail) ================= */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}
.kpi-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-card);
}
.kpi-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}
.kpi-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* ================= Detail Page Layout ================= */
.detail-container {
  max-width: 960px;
  margin: 0 auto;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  text-decoration: none;
  transition: all 0.2s;
  min-height: 40px;
}
.back-link:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}

.detail-header {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
}
.detail-app-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.detail-title {
  font-size: clamp(1.3rem, 4.5vw, 1.85rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.3;
  margin: 0.5rem 0 1rem 0;
}
.detail-section {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.35rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-card);
}
.detail-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}

/* Detail Page Grids */
.before-after-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 0.75rem;
}
.diff-box {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
}
.diff-box.before {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.04);
}
.diff-box.after {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.04);
}
.diff-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}
.diff-box.before .diff-label { color: #f87171; }
.diff-box.after .diff-label { color: #34d399; }
.diff-content {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
  word-break: break-word;
  white-space: pre-wrap;
}
.detail-impact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Action Buttons */
.btn {
  padding: 0.45rem 1rem;
  border-radius: 9999px;
  border: 1px solid var(--border-color);
  background: var(--bg-hover);
  color: var(--text-main);
  font-size: 0.82rem;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
}
.btn:hover {
  background: var(--bg-subtle);
  border-color: var(--border-hover);
}
.btn-primary {
  background: #ffffff;
  border-color: #ffffff;
  color: #0d1117;
}
[data-theme="light"] .btn-primary {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
}
.btn-app-action {
  color: #38bdf8;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-app-action:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.4);
}

.status-ok { color: #10b981; font-weight: 600; }
.status-err { color: #ef4444; font-weight: 600; }

/* Site Footer */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-surface);
  padding: 2.5rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  position: relative;
  z-index: 10;
  padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   Tablet & Medium Viewport Adaptation (< 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }
  .search-box-wrap {
    /* In a column, the desktop 280px flex-basis would become HEIGHT. */
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    order: -1;
  }
  .app-selector-group {
    width: 100%;
  }
}

/* ==========================================================================
   Comprehensive Mobile Optimization (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .header-container {
    padding: 0 1rem;
  }
  .nav-menu.desktop-nav {
    display: none !important;
  }
  .btn-hamburger {
    display: inline-flex !important;
  }
  .status-pill span:last-child {
    display: none;
  }
  .status-pill {
    padding: 4px 6px;
  }

  .main-wrap {
    padding: 1rem 0.85rem 3.5rem 0.85rem;
  }
  .hero-compact {
    padding-top: 0.75rem;
    padding-bottom: 1rem;
  }
  .hero-icon-wrap {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    padding: 8px;
    margin-bottom: 0.85rem;
  }
  .hero-live-badge {
    font-size: 0.74rem;
    padding: 5px 12px;
    margin-top: 0.85rem;
  }

  .control-panel {
    margin-top: 0.75rem;
    margin-bottom: 1rem;
    gap: 0.65rem;
    padding: 0.95rem;
    border-radius: 16px;
  }
  .filter-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
  }
  .search-box-wrap {
    min-width: 0;
    max-width: 100%;
    order: -1;
  }
  .search-box-input {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
    height: 46px;
  }
  .search-clear-btn {
    width: 44px;
    height: 44px;
    right: 1px;
  }

  /* Edge-to-Edge Full Bleed Swipeable Chips */
  .app-selector-group, .type-filter-group {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px 0.85rem 6px 0.85rem;
    margin: 0 -0.85rem;
    gap: 0.45rem;
  }
  .app-selector-group::-webkit-scrollbar,
  .type-filter-group::-webkit-scrollbar {
    display: none;
  }
  .app-pill, .type-pill {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.78rem;
    padding: 0.4rem 0.85rem;
    min-height: 36px;
  }

  /* Native-Feeling Card Layout for Changes (index.html, changes.html, app.html) */
  .data-table-container {
    border-radius: 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    margin-bottom: 2rem;
  }
  .data-table-header-bar {
    padding: 0.5rem 0.2rem 0.65rem 0.2rem;
    background: transparent !important;
    border-bottom: none !important;
  }
  .data-table, .data-table tbody {
    display: block;
    width: 100%;
  }
  .data-table thead {
    display: none !important;
  }
  
  /* Mobile CSS Grid Card Transformation for Changes */
  .data-table tr.change-card-row {
    display: grid;
    grid-template-areas:
      "app date"
      "type type"
      "content content"
      "evidence evidence";
    grid-template-columns: 1fr auto;
    row-gap: 0.6rem;
    column-gap: 0.75rem;
    background: rgba(14, 18, 28, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 1.15rem;
    margin-bottom: 0.95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    transition: transform 0.15s ease, border-color 0.15s ease;
  }
  .data-table tr.change-card-row:active {
    transform: scale(0.99);
    border-color: rgba(255, 255, 255, 0.22);
  }

  .col-app {
    grid-area: app;
    display: flex;
    align-items: center;
    padding: 0 !important;
    border: none !important;
  }
  .col-date {
    grid-area: date;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 !important;
    border: none !important;
    text-align: right;
  }
  .col-date .cell-date-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
  }
  .col-date .cell-date-exact {
    font-size: 0.76rem;
  }

  .col-type {
    grid-area: type;
    padding: 0 !important;
    border: none !important;
  }
  .col-type .cell-type-box {
    display: flex;
    flex-direction: row;
    gap: 0.4rem;
    align-items: center;
    flex-wrap: wrap;
  }

  .col-content {
    grid-area: content;
    padding: 0.1rem 0 !important;
    border: none !important;
  }
  .cell-change-title a {
    font-size: 0.96rem;
  }
  .cell-change-summary {
    font-size: 0.82rem;
  }
  .table-delta-box {
    margin-top: 6px;
    padding: 8px 10px;
  }

  .col-evidence {
    grid-area: evidence;
    padding: 0.65rem 0 0 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
    margin-top: 0.25rem;
  }
  .col-evidence .cell-evidence-box {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  /* Mobile App Cards Transformation (apps.html) */
  .data-table tr.app-card-row {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(14, 18, 28, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    padding: 1.15rem;
    margin-bottom: 0.95rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  }
  .data-table tr.app-card-row td {
    padding: 0 !important;
    border: none !important;
  }
  .app-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
  }
  .app-card-body {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
  }
  .app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
    font-size: 0.8rem;
    color: var(--text-muted);
  }

  /* Subpage Responsive Grids */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .before-after-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .detail-impact-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  .source-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}

@media (max-width: 480px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  .data-table tr.change-card-row {
    padding: 1rem;
    border-radius: 16px;
  }
  .header-container {
    padding: 0 0.75rem;
  }
  .brand-name {
    font-size: 1.05rem;
  }
}

/* ==========================================================================
   DSeekApp V2 - Redesign Enhancements
   1. Hero KPI Metrics Block
   2. Sticky Toolbar & Chip Counters
   3. GitHub/Linear Diff Code Review View (Split/Unified)
   4. Structured Key-Value Indicators
   5. Evidence Chain & SHA-256 Fingerprint
   6. Micro-actions & Toast Notification
   7. Visual Analytics Dashboard (Pricing & Radar)
   8. Skeleton Screen Shimmer
   9. Equal-Height Apps Grid
   ========================================================================== */

/* 1. Hero KPI Metrics Widget */
.metrics-hero-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
  margin: 1.25rem auto 1.5rem auto;
  max-width: 860px;
  width: 100%;
}
.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, border-color 0.2s ease;
  position: relative;
  overflow: hidden;
}
.metric-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.metric-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.metric-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.metric-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}
.metric-sub {
  font-size: 0.7rem;
  color: var(--text-soft);
  margin-top: 2px;
}

/* 2. Sticky Toolbar */
.sticky-toolbar {
  position: sticky;
  top: 60px;
  z-index: 35;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.85rem 1.15rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}
.chip-count-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font-weight: 700;
  margin-left: 4px;
}
[data-theme="light"] .chip-count-badge {
  background: rgba(0, 0, 0, 0.08);
}
.app-pill.active .chip-count-badge {
  background: rgba(0, 0, 0, 0.2);
  color: #000000;
}
[data-theme="light"] .app-pill.active .chip-count-badge {
  background: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* View Mode Switcher */
.view-mode-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}
.btn-view-mode {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.btn-view-mode:hover {
  color: var(--text-main);
}
.btn-view-mode.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* 3. GitHub / Linear Diff Code Review View */
.diff-view-box {
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.diff-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
  font-size: 0.74rem;
  color: var(--text-muted);
}
.diff-tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.diff-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 2px 8px;
  font-size: 0.72rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.15s;
}
.diff-tab-btn.active {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-color);
  font-weight: 700;
}
.diff-stat-tag {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.7rem;
  font-weight: 600;
}
.diff-stat-tag .stat-add { color: #34d399; }
.diff-stat-tag .stat-del { color: #f87171; }

.diff-content-container {
  font-family: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.76rem;
  line-height: 1.5;
  transition: max-height 0.25s ease;
  position: relative;
}
.diff-content-container.collapsed {
  max-height: 135px;
  overflow: hidden;
}
.diff-content-container.collapsed::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: linear-gradient(to bottom, transparent, var(--bg-card));
  pointer-events: none;
}

/* Split View Grid */
.diff-split-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  divide-x: 1px solid var(--border-color);
}
.diff-split-col {
  overflow-x: auto;
}
.diff-col-head {
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--diff-ctx-bg);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.diff-col-head.before { color: var(--diff-del-text); }
.diff-col-head.after { color: var(--diff-add-text); }

.diff-line {
  display: flex;
  align-items: flex-start;
  padding: 2px 8px;
  white-space: pre-wrap;
  word-break: break-word;
  gap: 8px;
}
.diff-line.del {
  background: var(--diff-del-bg);
  color: var(--diff-del-text);
  border-left: 3px solid var(--diff-del-text);
}
.diff-line.add {
  background: var(--diff-add-bg);
  color: var(--diff-add-text);
  border-left: 3px solid var(--diff-add-text);
}
.diff-line.ctx {
  background: transparent;
  color: var(--text-muted);
}
.diff-line-marker {
  user-select: none;
  font-weight: 700;
  width: 12px;
  flex-shrink: 0;
}
.diff-line-text {
  flex: 1;
}

.diff-expand-bar {
  padding: 6px;
  text-align: center;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
}
.btn-diff-expand {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 3px 14px;
  font-size: 0.74rem;
  font-weight: 600;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}
.btn-diff-expand:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

/* 4. Structured Key-Value Indicators */
.kv-indicators-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 4px;
}
.kv-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.kv-chip.pricing {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
}
[data-theme="light"] .kv-chip.pricing {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}
.kv-chip.model {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.35);
}
[data-theme="light"] .kv-chip.model {
  background: #dcfce7;
  color: #047857;
  border-color: #a7f3d0;
}
.kv-chip.api {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
}
[data-theme="light"] .kv-chip.api {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
}

.delta-badge-drop {
  background: #10b981;
  color: #ffffff;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
}
.delta-badge-up {
  background: #ef4444;
  color: #ffffff;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
}

/* 5. Evidence Chain & SHA-256 */
.evidence-meta-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.74rem;
}
.evidence-source-tag {
  color: var(--color-brand);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.evidence-source-tag:hover {
  text-decoration: underline;
  color: var(--accent-codex-hover);
}
.sha-tag {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sha-tag:hover {
  border-color: var(--border-hover);
  color: var(--text-main);
}
.probe-time-txt {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* 6. Micro-actions & Toast */
.card-micro-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
}
.btn-micro {
  background: var(--bg-hover);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-micro:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.toast-pill {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(16, 22, 34, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 1000;
  box-shadow: 0 12px 30px rgba(0,0,0,0.6);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-pill.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* 7. Analytics Dashboard */
.analytics-dashboard-panel {
  border-top: 1px solid var(--border-color);
  padding: 1.25rem;
}
.dashboard-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding-bottom: 0.25rem;
}
.dashboard-heading { font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.dashboard-description { margin-top: 0.25rem; font-size: 0.73rem; color: var(--text-muted); line-height: 1.7; }
.dashboard-section-heading { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0.3rem 0.5rem; margin-bottom: 0.65rem; }
.dashboard-section-heading h4 { font-size: 0.82rem; font-weight: 700; color: var(--text-main); }
.dashboard-section-heading > span { font-size: 0.7rem; color: var(--text-muted); }
.pricing-status { margin-bottom: 0.8rem; font-size: 0.72rem; line-height: 1.7; color: var(--text-muted); }
.pricing-status p + p { margin-top: 0.2rem; }
.pricing-warning { color: var(--color-orange); }
.pricing-empty { padding: 1.25rem 0; color: var(--text-muted); font-size: 0.8rem; line-height: 1.8; }
.pricing-empty strong { display: block; color: var(--text-secondary); font-weight: 600; }
.pricing-empty p { margin: 0.45rem 0; }
.pricing-empty a { color: var(--color-brand); }
.activity-row, .activity-brand, .activity-measure { display: flex; align-items: center; }
.activity-row { justify-content: space-between; gap: 0.6rem; padding: 0.7rem 0; border-bottom: 1px solid var(--border-light); font-size: 0.8rem; }
.activity-brand { gap: 0.5rem; color: var(--text-main); font-weight: 600; }
.activity-measure { gap: 0.5rem; }
.activity-meter { display: block; width: 72px; height: 7px; overflow: hidden; border-radius: 4px; background: var(--bg-hover); }
.activity-meter > span { display: block; height: 100%; background: var(--color-brand); border-radius: inherit; }
.activity-count { min-width: 3.5rem; text-align: right; white-space: nowrap; color: var(--text-main); font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-weight: 600; }
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1.5rem;
}
.pricing-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--border-light);
}
.pricing-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.btn-pricing-tab {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-pricing-tab:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}
.btn-pricing-tab.active {
  background: var(--color-brand-bg, rgba(56, 189, 248, 0.12));
  color: var(--color-brand);
  border-color: var(--color-brand);
}
.btn-pricing-sort {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.btn-pricing-sort:hover {
  color: var(--text-main);
  border-color: var(--border-hover);
}
.pricing-chart-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 255px) minmax(0, 1fr) 82px;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
  font-size: 0.76rem;
}
.pricing-rank-badge {
  width: 28px;
  height: 20px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  border-radius: 4px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}
.pricing-rank-badge.top-1 {
  background: rgba(234, 179, 8, 0.15);
  color: #eab308;
  border-color: rgba(234, 179, 8, 0.35);
}
.pricing-rank-badge.top-2 {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.35);
}
.pricing-rank-badge.top-3 {
  background: rgba(217, 119, 6, 0.15);
  color: #f59e0b;
  border-color: rgba(217, 119, 6, 0.35);
}
.pricing-model-cell { min-width: 0; }
.pricing-verification { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem; margin-top: 0.25rem; color: var(--text-muted); font-size: 0.64rem; line-height: 1.6; }
.pricing-verification time { white-space: nowrap; }
.pricing-stale-badge { color: var(--color-orange); border: 1px solid var(--border-light); padding: 0 0.25rem; border-radius: 3px; white-space: nowrap; }
.pricing-model-name {
  width: 100%;
  min-width: 0;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
.pricing-model-name:hover .pricing-model-text {
  color: var(--color-brand);
}
.pricing-model-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
}
.pricing-condition-tag {
  display: inline-flex;
  align-items: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  padding: 0 4px;
  line-height: 1.3;
  white-space: nowrap;
  flex-shrink: 0;
}
.pricing-track {
  width: 100%;
  min-width: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  height: 14px;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.pricing-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.pricing-val-label {
  width: 82px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1.25;
}
.pricing-val-label .price-out {
  font-size: 0.76rem;
  color: var(--text-main);
}
.pricing-val-label .price-in {
  font-size: 0.67rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 8. Skeleton Screen Shimmer */
.skeleton-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.skeleton-shimmer {
  background: linear-gradient(90deg, #21262d 25%, #30363d 50%, #21262d 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: 6px;
}
[data-theme="light"] .skeleton-shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Smooth Fade-in Transition for Loaded Content */
@keyframes fadeInEntry {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.fade-in-entry,
.change-card,
.change-card-row,
.compact-view-table tbody tr,
.app-card-item {
  animation: fadeInEntry 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* 9. Compact Table View */
.compact-view-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.compact-view-table th {
  padding: 0.65rem 0.85rem;
  text-align: left;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.72rem;
  text-transform: uppercase;
}
.compact-view-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.compact-view-table tbody tr,
.change-card-row {
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.compact-view-table tbody tr:hover,
.change-card-row:hover {
  background-color: var(--bg-hover) !important;
}
[data-theme="light"] .compact-view-table tbody tr:hover,
[data-theme="light"] .change-card-row:hover {
  background-color: #f1f5f9 !important;
}

/* 10. AI Apps Grid Layout */
.apps-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.app-card-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  min-height: 220px;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}
.app-card-item:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}
.app-desc-clamp {
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0.75rem 0;
}

/* Mobile Adjustments for Diff and Metrics */
@media (max-width: 768px) {
  .metrics-hero-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  .metric-card {
    padding: 0.65rem 0.65rem;
  }
  .metric-val {
    font-size: 1.25rem;
  }
  .metric-label {
    font-size: 0.7rem;
  }
  .metric-sub {
    display: none;
  }
  .diff-split-grid {
    grid-template-columns: 1fr;
  }
  .apps-catalog-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .metrics-hero-grid {
    grid-template-columns: 1fr;
  }
}

/* Data/error states and narrow-screen fixes; preserve the existing visual system. */
.main-wrap, .detail-container, .stream-section, .filter-row,
.dashboard-grid > *, .metrics-hero-grid > *, .apps-catalog-grid > * {
  min-width: 0;
}
.stream-section, .filter-row, .dashboard-grid > *,
.metrics-hero-grid > *, .apps-catalog-grid > * {
  max-width: 100%;
}
.change-card div, .app-card-item div, #app-profile-header div,
#change-detail-content div {
  min-width: 0;
}
.change-card, .app-card-item, #app-profile-header, #change-detail-content,
.source-error, .pricing-model-name {
  overflow-wrap: anywhere;
}
.refresh-notice {
  padding: 10px 14px;
  margin-bottom: 1rem;
  border: 1px solid var(--color-orange);
  border-radius: 10px;
  background: var(--color-orange-bg);
  color: var(--text-main);
  font-size: 0.82rem;
}
.empty-state {
  padding: 2rem 1rem;
  color: var(--text-muted);
  text-align: center;
  grid-column: 1 / -1;
}
.empty-state button { margin-top: 0.75rem; }
.status-pill[data-state="degraded"],
.status-pill[data-state="offline"] { color: var(--color-orange); }
.status-pill:not([data-state="healthy"]) .pulse-dot {
  background: currentColor;
  box-shadow: none;
  animation: none;
}
.status-pill[data-state="unknown"],
.status-pill[data-state="initializing"] { color: var(--text-muted); }
.status-pill[data-state="offline"] .pulse-dot { opacity: 0.6; }
.source-error {
  margin-top: 5px;
  font-size: 0.72rem;
  color: var(--color-red);
  max-width: 340px;
}
.capture-time { display: block; font-size: 0.75rem; margin-top: 4px; }
.official-detail-text { white-space: pre-wrap; }
.evidence-excerpt { width: 100%; min-width: 0; font-size: 0.82rem; }
.evidence-excerpt summary { cursor: pointer; color: var(--color-brand); padding: 6px 0; }
.evidence-excerpt pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 32rem;
  overflow-y: auto;
  padding: 0.75rem;
  margin-top: 0.5rem;
  background: var(--bg-card);
  border-radius: 8px;
}
.detail-impact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.pricing-note { color: var(--text-muted); font-size: 0.72rem; margin-top: 10px; }
#pricing-landscape-box { max-height: 32rem; overflow-y: auto; scrollbar-gutter: stable; }
.data-freshness { color: var(--text-muted); font-size: 0.76rem; margin-bottom: 0.75rem; }
.skeleton-box, .skeleton-shimmer { max-width: 100%; }
.metric-top-row, .dashboard-title-row { flex-wrap: wrap; gap: 0.5rem; }
.toast-pill { max-width: calc(100vw - 24px); white-space: normal; text-align: center; }
button:focus-visible, a:focus-visible, [role="button"]:focus-visible,
summary:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--color-brand);
  outline-offset: 3px;
}

@media (max-width: 768px) {
  .pricing-track { min-width: 0; }
  .app-selector-group, .type-filter-group {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
    max-width: 100%;
    width: 100%;
    min-width: 0;
  }
  .sticky-toolbar, .sticky-toolbar > div { min-width: 0; max-width: 100%; }
  .sticky-toolbar select { min-width: 0 !important; width: 100%; max-width: 100%; }
  .sticky-toolbar [role="group"][aria-label="日志筛选条件"] { flex-basis: 100% !important; }
  .sticky-toolbar [role="group"][aria-label="日志筛选条件"] select { flex-basis: 100% !important; }
  .change-card [style*="display:flex"], .change-card [style*="display: flex"],
  .app-card-item > div:last-child, #change-detail-content > div > div,
  .detail-container > div:first-child {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  .card-micro-actions { flex-wrap: wrap; }
  .badge-clean, .badge-verified, .badge-impact-clean, .evidence-source-tag {
    max-width: 100%;
    white-space: normal;
  }
  .analytics-dashboard-panel { padding: 1rem; }
  .pricing-chart-row { grid-template-columns: 24px minmax(0, 1fr) 76px; grid-template-areas: "rank model value" "rank track track"; gap: 4px 8px; margin-bottom: 0.85rem; }
  .pricing-rank-badge { grid-area: rank; width: 24px; }
  .pricing-model-cell { grid-area: model; }
  .pricing-model-name { flex-wrap: wrap; white-space: normal; overflow: visible; gap: 0.15rem 0.25rem; }
  .pricing-model-text { flex: 1 1 calc(100% - 16px); white-space: normal; overflow: visible; overflow-wrap: anywhere; }
  .pricing-condition-tag { max-width: calc(100% - 14px); margin-left: 14px; white-space: normal; overflow-wrap: anywhere; flex-shrink: 1; }
  .pricing-track { grid-area: track; height: 5px; }
  .pricing-val-label { grid-area: value; width: 76px; font-size: 0.75rem; }
  .compact-view-table, .compact-view-table tbody { display: block; width: 100%; }
  .compact-view-table thead { display: none; }
  .compact-view-table tr.change-card-row {
    display: grid;
    grid-template-areas: "app verification" "content content" "type type" "time time";
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: var(--bg-card);
  }
  .compact-view-table tr.change-card-row td {
    min-width: 0;
    padding: 0;
    border: 0;
    white-space: normal !important;
    overflow-wrap: anywhere;
  }
  .compact-view-table tr.change-card-row td:nth-child(1) { grid-area: app; }
  .compact-view-table tr.change-card-row td:nth-child(2) { grid-area: content; }
  .compact-view-table tr.change-card-row td:nth-child(3) { grid-area: type; }
  .compact-view-table tr.change-card-row td:nth-child(4) { grid-area: verification; }
  .compact-view-table tr.change-card-row td:nth-child(5) { grid-area: time; }
  .status-table { display: table; min-width: 800px; }
  .status-table tbody { display: table-row-group; }
  .status-table thead { display: table-header-group !important; }
  .status-table th, .status-table td { white-space: normal; }
  .data-table-header-bar { flex-wrap: wrap; gap: 0.5rem; }
}
@media (max-width: 960px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .nav-menu.desktop-nav { display: none !important; }
  .btn-hamburger { display: inline-flex !important; }
}
@media (pointer: coarse) {
  .btn-micro, .btn-view-mode, .btn-theme-toggle, .btn-hamburger,
  .app-pill, .type-pill, .diff-tab-btn, .btn-diff-expand, .sha-tag,
  .milestones-toggle, .btn-pricing-tab, .btn-pricing-sort { min-height: 44px; }
  .btn-theme-toggle, .btn-hamburger { min-width: 44px; }
}
@media (max-width: 380px) {
  .brand-badge { display: none; }
  .header-container { gap: 0.4rem; }
}
@media (max-height: 550px) and (max-width: 960px) {
  .sticky-toolbar { position: relative; top: auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .codex-video-backdrop video { display: none; }
}
