/* Hide unnecessary theme elements */
.github-banner, .github-badge,
a[href*="github.com"][class*="button"], .btn-github,
#forkme_banner, #forkme_banner_wrap, a#forkme_banner,
.maintained-by, .credits,
footer p:contains("maintained by"),
footer p:contains("Published with") {
  display: none !important;
}

/* Base styles */
body {
  background: #f2f2f2 !important;
  color: #373737 !important;
  font-family: 'Literata', 'Georgia', serif !important;
  line-height: 1.6 !important;
  -webkit-font-smoothing: antialiased !important;
}

#header_wrap {
  background: #212121 !important;
  padding: 40px 0 30px 0 !important;
  color: white !important;
  border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

#main_content_wrap {
  background: #f2f2f2 !important;
  border: none !important;
}

#main_content {
  background: #ffffff !important;
  color: #333333 !important;
  max-width: 640px !important;
  padding: 56px 72px !important;
  margin: 28px auto !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05) !important;
  border-radius: 4px !important;
}

/* Layout shell */
footer { display: none !important; }

.header-shell {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
}

.header-brand-link {
  text-decoration: none;
  color: inherit;
  display: block;
  border-bottom: none !important;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 18px;
}

.header-avatar {
  width: 72px !important;
  height: 72px !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,0.2) !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3) !important;
  flex-shrink: 0 !important;
  object-fit: cover !important;
  background: #ffffff !important;
}

#project_title {
  font-family: 'Inter', sans-serif !important;
  font-size: 32px !important;
  font-weight: 800 !important;
  letter-spacing: -1px !important;
  margin: 0 !important;
  color: #ffffff !important;
  text-shadow: none !important;
}

#project_tagline {
  font-family: 'Inter', sans-serif !important;
  font-size: 16px !important;
  font-weight: 300 !important;
  margin-top: 4px !important;
  color: rgba(255, 255, 255, 0.72) !important;
  text-shadow: none !important;
}

.header-socials {
  display: flex;
  gap: 18px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-social-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: none !important;
  transition: color 0.2s;
}

.header-social-link:hover { color: #ffffff; }

.page-header {
  margin: 1.25rem 0 1.75rem;
}

.page-header h1 {
  margin-bottom: 0.35rem;
  letter-spacing: -0.03em;
}

.page-subtitle {
  font-size: 15px;
  color: #666;
  line-height: 1.75;
  max-width: 720px;
  margin: 0;
}

.site-footer-links {
  margin-top: 3rem;
  padding-top: 1.2rem;
  border-top: 1px solid #efefef;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: #777;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.site-footer-links a {
  border-bottom: none !important;
  text-decoration: none;
}

/* Typography */
#main_content h1, #main_content h2, #main_content h3 {
  font-family: 'Inter', sans-serif !important;
  color: #111111 !important;
  letter-spacing: -0.01em !important;
}

#main_content h1 {
  font-size: 32px !important;
  font-weight: 700 !important;
  margin-top: 0 !important;
  margin-bottom: 30px !important;
  border: none !important;
}

#main_content h2 {
  font-size: 24px !important;
  font-weight: 600 !important;
  margin-top: 40px !important;
  margin-bottom: 20px !important;
  border-bottom: 1px solid #eee !important;
  padding-bottom: 8px !important;
  background: none !important;
}

#main_content h3 {
  font-size: 19px !important;
  font-weight: 600 !important;
  margin-top: 30px !important;
  margin-bottom: 12px !important;
  border: none !important;
}

#main_content p, #main_content li {
  font-size: 17px !important;
  margin-bottom: 1.25rem !important;
}

#main_content a {
  color: #1e6bb8 !important;
  border-bottom: 1px solid transparent !important;
  transition: border-bottom 0.2s ease !important;
}

#main_content a:hover {
  text-decoration: none !important;
  border-bottom: 1px solid #1e6bb8 !important;
}

#main_content a[target="_blank"]::after {
  content: " ↗";
  font-size: 12px;
  opacity: 0.5;
}

/* Navigation */
.nav-tabs {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: flex-start !important;
  margin-bottom: 2.5rem !important;
  padding: 0 0 18px 0 !important;
  border-bottom: 1px solid #eee !important;
  list-style: none !important;
  gap: 18px !important;
}

.nav-item-wrapper {
  text-decoration: none !important;
  transition: all 0.2s ease !important;
  position: relative !important;
}

.nav-link {
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: #666 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
}

.nav-item-wrapper:hover .nav-link {
  color: #111 !important;
}

.nav-item-wrapper.active .nav-link {
  color: #1e6bb8 !important;
}

.nav-item-wrapper.active:after {
  content: "" !important;
  position: absolute !important;
  bottom: -19px !important;
  left: 0 !important;
  right: 0 !important;
  height: 2px !important;
  background: #1e6bb8 !important;
}

.nav-tagline {
  display: none !important;
}

/* Tables */
table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin-bottom: 30px !important;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif !important;
  font-size: 14px !important;
}

#main_content th, #main_content td {
  font-family: 'Inter', sans-serif !important;
}

th {
  background: #fafafa !important;
  color: #111 !important;
  font-weight: 600 !important;
  padding: 12px !important;
  border: 1px solid #eee !important;
  text-align: left !important;
}

td {
  padding: 12px !important;
  border: 1px solid #eee !important;
}

/* Shared components */
.cta-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin: 25px 0;
}

.cta-buttons.cta-buttons-compact {
  margin-top: 1.2rem;
  gap: 12px;
}

.cta-btn {
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  padding: 12px 24px !important;
  border-radius: 6px !important;
  text-decoration: none !important;
  font-size: 15px !important;
  transition: all 0.2s ease !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-bottom: none !important;
}

.cta-btn-primary {
  background: #111111 !important;
  color: #ffffff !important;
  border: 1px solid #111111 !important;
}

.cta-btn-primary:hover {
  background: #333333 !important;
  border-color: #333333 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.cta-btn-secondary {
  background: #ffffff !important;
  color: #111111 !important;
  border: 1px solid #dddddd !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.cta-btn-secondary:hover {
  background: #f9f9f9 !important;
  border-color: #cccccc !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.search-section {
  position: relative;
  max-width: 400px;
  margin: 0 auto 40px 0;
}

.search-section.search-section-spaced {
  margin-top: 1.5rem;
}

.search-bar-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#blogSearch {
  width: 100% !important;
  padding: 10px 15px 10px 40px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 14px !important;
  border: 1px solid #ddd !important;
  border-radius: 6px !important;
  background: #f9f9f9 !important;
  transition: all 0.2s ease !important;
  color: #333 !important;
  margin-bottom: 0 !important;
}

#blogSearch:focus {
  outline: none !important;
  border-color: #1e6bb8 !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(30,107,184,0.1) !important;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
  pointer-events: none;
  font-style: normal;
}

.paper-list {
  list-style: none !important;
  padding: 0 !important;
  margin: 2rem 0 !important;
}

.paper-card {
  background: #ffffff !important;
  border: 1px solid #eee !important;
  border-radius: 12px !important;
  padding: 24px !important;
  margin-bottom: 24px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  cursor: pointer;
  display: block !important;
  text-decoration: none !important;
  border-bottom: 1px solid #eee !important;
}

.paper-card:hover {
  transform: translateY(-4px) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,0.06) !important;
  border-color: #1e6bb8 !important;
  text-decoration: none !important;
}

.paper-title {
  font-family: 'Inter', sans-serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: #111 !important;
  margin-bottom: 8px !important;
  display: block;
}

.paper-meta {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  color: #666 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  margin-bottom: 12px !important;
  display: block;
}

.paper-excerpt {
  font-size: 15px !important;
  color: #444 !important;
  line-height: 1.5 !important;
  margin: 0 !important;
}

.paper-meta-inline {
  margin-top: 12px;
  display: block;
}

.paper-meta-inline .paper-meta {
  display: inline-block;
  margin-bottom: 0;
}

.article-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.tag-badge {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: 4px;
  background: #f4f4f4;
  color: #666;
  border: 1px solid #eee;
}

.tag-badge.zk { color: #5a228b; background: #faf5ff; border-color: #e9d5ff; }
.tag-badge.vuln { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.tag-badge.audit { color: #15803d; background: #f0fdf4; border-color: #bbf7d0; }
.tag-badge.cairo { color: #0369a1; background: #f0f9ff; border-color: #bae6fd; }
.tag-badge.fhe { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }

.pdf-viewer-container {
  position: relative;
  width: 100%;
  padding-top: 141.4%;
  background: #f5f5f5;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  margin: 2rem 0;
  border: 1px solid #ddd;
}

.pdf-viewer-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.tldr-box {
  background: #f8f9fa !important;
  border-left: 4px solid #1e6bb8 !important;
  padding: 20px 25px !important;
  margin: 30px 0 !important;
  border-radius: 0 8px 8px 0 !important;
}

.tldr-box strong {
  color: #1e6bb8 !important;
  display: block;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}

.floating-btn {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  background: #111111 !important;
  color: #ffffff !important;
  padding: 13px 20px !important;
  border-radius: 50px !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  text-decoration: none !important;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  z-index: 9999 !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  max-width: calc(100vw - 32px) !important;
}

.floating-btn:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(0,0,0,0.2) !important;
  color: #ffffff !important;
  text-decoration: none !important;
}

/* Home page */
.home-hero {
  margin-bottom: 2.25rem;
}

.home-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9a9a;
  margin-bottom: 0.75rem;
}

.home-hero h2 {
  font-size: 34px;
  line-height: 1.12;
  margin-bottom: 0.75rem;
  letter-spacing: -0.03em;
}

.home-hero p {
  font-size: 16px;
  line-height: 1.8;
  color: #555;
  margin-bottom: 0.8rem;
}

.home-proof {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 1.6rem 0 0;
}

.home-proof .proof-card {
  border: 1px solid #ececec;
  border-radius: 12px;
  padding: 14px 16px;
  background: #fafafa;
}

.home-proof .proof-card strong {
  display: block;
  font-size: 15px;
  color: #222;
  margin-bottom: 4px;
}

.home-proof .proof-card span {
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.home-section-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #999;
  margin-top: 2.4rem;
  margin-bottom: 0.8rem;
  text-transform: uppercase;
}

.findings-list,
.writing-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.findings-list li,
.writing-list li {
  padding: 12px 0;
  border-bottom: 1px solid #f2f2f2;
}

.findings-list li:last-child,
.writing-list li:last-child {
  border-bottom: none;
}

.finding-title {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 1.65;
  color: #222;
  text-decoration: none;
  border-bottom: none !important;
}

.finding-title:hover,
.writing-list a:hover,
.see-more:hover {
  color: #1e6bb8;
}

.finding-meta,
.writing-list .post-tag {
  display: inline-block;
  margin-top: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: #999;
}

.writing-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.writing-list a {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: #333;
  text-decoration: none;
  border-bottom: none !important;
  flex: 1;
  transition: color 0.15s;
}

.see-more {
  display: inline-block;
  margin-top: 1rem;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #1e6bb8;
  text-decoration: none;
  border-bottom: none !important;
}

.see-more::after { content: ' →'; }

/* Writing page */
.blog-tags-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.blog-tag-btn {
  font-family: 'Inter', sans-serif;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 6px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  color: #555;
  cursor: pointer;
  transition: all 0.2s ease;
}

.blog-tag-btn:hover {
  background: #fff;
  border-color: #1e6bb8;
  color: #111;
}

.blog-tag-btn.active {
  background: #1e6bb8;
  color: #fff;
  border-color: #1e6bb8;
}

.featured-writing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 0 0 2rem;
}

.featured-writing .paper-card {
  min-height: 100%;
}

.blog-no-results {
  display: none;
  text-align: center;
  color: #666;
  padding: 3rem 0;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
}

.blog-no-results.visible {
  display: block;
}

.blog-card.hidden {
  display: none !important;
}

/* Responsive */
@media (max-width: 760px) {
  .header-shell {
    align-items: flex-start;
    gap: 16px;
  }

  .header-socials {
    justify-content: flex-start;
    gap: 14px;
  }

  .header-branding {
    align-items: center;
    gap: 14px;
  }
}

@media (max-width: 768px) {
  #header_wrap {
    padding: 28px 0 20px 0 !important;
  }

  #main_content {
    max-width: 100% !important;
    padding: 26px 20px !important;
    margin: 12px auto !important;
    border-radius: 0 !important;
  }

  .nav-tabs {
    gap: 10px !important;
    justify-content: flex-start !important;
    margin-bottom: 1.6rem !important;
    padding-bottom: 10px !important;
    flex-wrap: wrap !important;
    overflow-x: visible !important;
  }

  .nav-item-wrapper {
    flex: 0 0 auto !important;
  }

  .nav-item-wrapper.active:after {
    bottom: -11px !important;
  }

  .nav-link {
    font-size: 12px !important;
    letter-spacing: 0.04em !important;
  }

  .home-hero h2 {
    font-size: 24px !important;
    line-height: 1.18 !important;
  }

  .home-hero p {
    font-size: 15px !important;
    line-height: 1.72 !important;
  }

  .writing-list li {
    display: block !important;
  }

  .floating-btn {
    bottom: 16px !important;
    right: 16px !important;
    left: 16px !important;
    width: auto !important;
    max-width: none !important;
    padding: 12px 16px !important;
    font-size: 14px !important;
    justify-content: center !important;
  }
}

@media (max-width: 480px) {
  #header_wrap {
    padding: 20px 0 14px 0 !important;
  }

  .header-branding {
    flex-direction: row !important;
    text-align: left !important;
    gap: 12px !important;
  }

  .header-avatar {
    width: 48px !important;
    height: 48px !important;
  }

  #project_title {
    font-size: 24px !important;
    letter-spacing: -0.04em !important;
  }

  #project_tagline {
    font-size: 13px !important;
    line-height: 1.35 !important;
    max-width: 260px;
  }

  .header-socials {
    gap: 12px;
    font-size: 13px;
  }

  .nav-tabs {
    gap: 8px !important;
  }

  .nav-link {
    font-size: 11px !important;
  }

  #main_content {
    padding: 22px 14px 96px 14px !important;
  }

  #main_content p, #main_content li {
    font-size: 15px !important;
    line-height: 1.75 !important;
  }

  .home-eyebrow {
    font-size: 10px !important;
    letter-spacing: 0.06em !important;
  }

  .home-hero h2 {
    font-size: 20px !important;
    line-height: 1.16 !important;
  }

  .home-hero p {
    font-size: 14px !important;
    line-height: 1.68 !important;
  }

  .home-proof {
    grid-template-columns: 1fr !important;
  }

  .floating-btn {
    border-radius: 18px !important;
    padding: 11px 14px !important;
    font-size: 13px !important;
  }
}

/* Theme system */
:root {
  color-scheme: light;
  --theme-page-bg: #f2f2f2;
  --theme-surface: #ffffff;
  --theme-surface-soft: #fafafa;
  --theme-surface-muted: #f8f9fa;
  --theme-text: #333333;
  --theme-text-strong: #111111;
  --theme-text-soft: #555555;
  --theme-text-muted: #666666;
  --theme-text-faint: #999999;
  --theme-border: #eeeeee;
  --theme-border-strong: #dddddd;
  --theme-header-bg: #212121;
  --theme-header-text: #ffffff;
  --theme-header-muted: rgba(255, 255, 255, 0.72);
  --theme-header-link: rgba(255, 255, 255, 0.82);
  --theme-header-link-hover: #ffffff;
  --theme-accent: #1e6bb8;
  --theme-accent-soft: rgba(30, 107, 184, 0.1);
  --theme-shadow: 0 1px 3px rgba(0,0,0,0.05);
  --theme-shadow-strong: 0 12px 24px rgba(0,0,0,0.06);
  --theme-button-primary-bg: #111111;
  --theme-button-primary-border: #111111;
  --theme-button-primary-text: #ffffff;
  --theme-button-primary-hover: #333333;
  --theme-button-secondary-bg: #ffffff;
  --theme-button-secondary-border: #dddddd;
  --theme-button-secondary-text: #111111;
  --theme-button-secondary-hover: #f9f9f9;
  --theme-floating-bg: #111111;
  --theme-floating-text: #ffffff;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --theme-page-bg: #101214;
  --theme-surface: #171a1d;
  --theme-surface-soft: #1c2024;
  --theme-surface-muted: #161b20;
  --theme-text: #e7eaee;
  --theme-text-strong: #f5f7fa;
  --theme-text-soft: #c8ced6;
  --theme-text-muted: #a9b3be;
  --theme-text-faint: #8a94a1;
  --theme-border: #2a3138;
  --theme-border-strong: #36404a;
  --theme-header-bg: #0d0f11;
  --theme-header-text: #f5f7fa;
  --theme-header-muted: rgba(245, 247, 250, 0.72);
  --theme-header-link: rgba(245, 247, 250, 0.82);
  --theme-header-link-hover: #ffffff;
  --theme-accent: #66a8ff;
  --theme-accent-soft: rgba(102, 168, 255, 0.16);
  --theme-shadow: 0 1px 3px rgba(0,0,0,0.35);
  --theme-shadow-strong: 0 12px 24px rgba(0,0,0,0.28);
  --theme-button-primary-bg: #f5f7fa;
  --theme-button-primary-border: #f5f7fa;
  --theme-button-primary-text: #111111;
  --theme-button-primary-hover: #dbe2ea;
  --theme-button-secondary-bg: #171a1d;
  --theme-button-secondary-border: #36404a;
  --theme-button-secondary-text: #f5f7fa;
  --theme-button-secondary-hover: #20252a;
  --theme-floating-bg: #f5f7fa;
  --theme-floating-text: #111111;
}

html, body, #header_wrap, #main_content_wrap, #main_content, .paper-card, .proof-card, .tldr-box, th, td, .cta-btn, .floating-btn, .theme-toggle {
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

body {
  background: var(--theme-page-bg) !important;
  color: var(--theme-text) !important;
}

#header_wrap {
  background: var(--theme-header-bg) !important;
  color: var(--theme-header-text) !important;
  border-bottom-color: var(--theme-border) !important;
}

#main_content_wrap {
  background: var(--theme-page-bg) !important;
}

#main_content {
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  box-shadow: var(--theme-shadow) !important;
}

#project_title {
  color: var(--theme-header-text) !important;
}

#project_tagline {
  color: var(--theme-header-muted) !important;
}

.header-social-link {
  color: var(--theme-header-link) !important;
}

.header-social-link:hover {
  color: var(--theme-header-link-hover) !important;
}

.page-subtitle,
.paper-meta,
.finding-meta,
.writing-list .post-tag,
.home-proof .proof-card span,
.home-section-label,
.site-footer-links,
#main_content p,
#main_content li,
.home-hero p,
.paper-excerpt {
  color: var(--theme-text-soft) !important;
}

#main_content h1,
#main_content h2,
#main_content h3,
.paper-title,
.finding-title,
.home-proof .proof-card strong,
.nav-item-wrapper:hover .nav-link,
.nav-item-wrapper.active .nav-link {
  color: var(--theme-text-strong) !important;
}

#main_content h2,
.nav-tabs,
.site-footer-links,
th,
td,
.paper-card,
.home-proof .proof-card,
.findings-list li,
.writing-list li {
  border-color: var(--theme-border) !important;
}

#main_content a,
.see-more,
.nav-item-wrapper.active .nav-link,
.finding-title:hover,
.writing-list a:hover {
  color: var(--theme-accent) !important;
}

#main_content a:hover {
  border-bottom-color: var(--theme-accent) !important;
}

.nav-link {
  color: var(--theme-text-muted) !important;
}

.nav-item-wrapper.active:after {
  background: var(--theme-accent) !important;
}

.page-header h1,
.paper-title,
.finding-title,
.writing-list a {
  color: var(--theme-text-strong) !important;
}

.paper-card,
.home-proof .proof-card,
th {
  background: var(--theme-surface-soft) !important;
}

.paper-card:hover {
  border-color: var(--theme-accent) !important;
  box-shadow: var(--theme-shadow-strong) !important;
}

.tldr-box {
  background: var(--theme-surface-muted) !important;
  border-left-color: var(--theme-accent) !important;
}

.tldr-box strong {
  color: var(--theme-accent) !important;
}

.tag-badge {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text-muted) !important;
  border-color: var(--theme-border) !important;
}

#blogSearch {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border-strong) !important;
}

#blogSearch:focus {
  background: var(--theme-surface) !important;
  border-color: var(--theme-accent) !important;
  box-shadow: 0 0 0 3px var(--theme-accent-soft) !important;
}

.blog-tag-btn {
  background: var(--theme-surface-soft) !important;
  color: var(--theme-text-muted) !important;
  border-color: var(--theme-border-strong) !important;
}

.blog-tag-btn:hover {
  background: var(--theme-surface) !important;
  color: var(--theme-text-strong) !important;
  border-color: var(--theme-accent) !important;
}

.blog-tag-btn.active {
  background: var(--theme-accent) !important;
  color: #ffffff !important;
  border-color: var(--theme-accent) !important;
}

.cta-btn-primary {
  background: var(--theme-button-primary-bg) !important;
  color: var(--theme-button-primary-text) !important;
  border-color: var(--theme-button-primary-border) !important;
}

.cta-btn-primary:hover {
  background: var(--theme-button-primary-hover) !important;
  border-color: var(--theme-button-primary-hover) !important;
}

.cta-btn-secondary {
  background: var(--theme-button-secondary-bg) !important;
  color: var(--theme-button-secondary-text) !important;
  border-color: var(--theme-button-secondary-border) !important;
}

.cta-btn-secondary:hover {
  background: var(--theme-button-secondary-hover) !important;
  border-color: var(--theme-button-secondary-border) !important;
}

.floating-btn {
  background: var(--theme-floating-bg) !important;
  color: var(--theme-floating-text) !important;
  border-color: var(--theme-border) !important;
}

.floating-btn:hover {
  color: var(--theme-floating-text) !important;
}

.header-avatar {
  background: var(--theme-surface) !important;
  border-color: rgba(255,255,255,0.16) !important;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.08);
  color: var(--theme-header-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0;
}

.theme-toggle:hover {
  background: rgba(255,255,255,0.14);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--theme-accent);
  outline-offset: 2px;
}

html[data-theme='dark'] .theme-toggle {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.14);
}

html[data-theme='dark'] .theme-toggle:hover {
  background: rgba(255,255,255,0.1);
}

@media (max-width: 480px) {
  .theme-toggle {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }
}
