/* ===== Reset & Base ===== */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --bg-surface: #141414;
  --text: #e0e0e0;
  --text-heading: #f5f5f5;
  --text-muted: #888888;
  --accent: #f59e0b;
  --accent-hover: #fbbf24;
  --border: #222222;
  --max-width: 800px;
}

[data-theme="light"] {
  --bg: #ffffff;
  --bg-surface: #f5f5f5;
  --text: #1a1a1a;
  --text-heading: #000000;
  --text-muted: #666666;
  --border: #e0e0e0;
  --accent: #c2410c;
  --accent-hover: #9a3412;
}

html {
  font-size: clamp(17px, 1.2vw + 13px, 19px);
  line-height: 1.7;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  text-rendering: optimizeLegibility;
}

/* ===== Container ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  width: 100%;
}

/* ===== Focus Visible ===== */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--accent);
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: none;
}

.skip-link:focus {
  top: 1rem;
}

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

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

/* ===== Header ===== */
.site-header {
  border-bottom: 1px solid var(--border);
  padding: 1.25rem 0;
  position: sticky;
  top: 0;
  background-color: var(--bg);
  z-index: 50;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  height: 100%;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  height: 100%;
}

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

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.site-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.nav-links a:hover {
  color: var(--accent);
}

/* Theme Toggle */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.theme-icon {
  line-height: 0;
}

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

/* ===== Main Content ===== */
main {
  flex: 1;
  padding: 2rem 0;
}

/* ===== Hero (Homepage) ===== */
.hero {
  margin-bottom: 3rem;
}

.hero h1 {
  font-size: 2.2rem;
  color: var(--text-heading);
  margin-bottom: 1rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* ===== Recent Posts & Post List ===== */
.recent-posts h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-heading);
  line-height: 1.2;
  text-wrap: balance;
  margin-bottom: 1rem;
}

.post-list {
  list-style: none;
}

.post-list li {
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--border);
  border-radius: 4px;
  margin: 0 -0.5rem;
}

.post-list li:last-child {
  border-bottom: none;
}

.post-list a {
  font-size: 1.05rem;
  font-weight: 500;
}

.post-list time {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.post-description {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.view-all {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.9rem;
}

/* ===== Page Title h1 (bare h1 in container) ===== */
.container > h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-wrap: balance;
  margin-bottom: 1rem;
}

/* ===== Single Post ===== */
.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 2rem;
  color: var(--text-heading);
  line-height: 1.25;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.post-header .post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}

.post-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.reading-time {
  margin-left: 0.4rem;
}

.tags {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
}

/* ===== Content (Prose) ===== */
.content h2,
.content h3,
.content h4 {
  color: var(--text-heading);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-weight: 700;
  text-wrap: balance;
}

.content h2 {
  font-size: 1.6rem;
  line-height: 1.2;
}

.content h3 {
  font-size: 1.3rem;
  line-height: 1.25;
}

.content h4 {
  font-size: 1.1rem;
  line-height: 1.3;
}

.content p {
  margin-bottom: 1.5rem;
}

.content ul,
.content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.content li {
  margin-bottom: 0.4rem;
}

.content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-style: italic;
}
.content blockquote p:first-child {
  margin-bottom: 0;
}
.content blockquote p + p {
  margin-left: 1rem;
  margin-top: 0;
  font-style: normal;
  font-size: 0.9em;
}

.x-embed {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.x-embed-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
.x-embed-author {
  font-weight: 600;
  color: var(--text-heading);
  text-decoration: none;
}
.x-embed-author:hover,
.x-embed-author:focus {
  color: var(--accent);
}
.x-embed-handle {
  color: var(--text-muted);
  text-decoration: none;
}
.x-embed-handle:hover,
.x-embed-handle:focus {
  color: var(--accent);
}
.x-embed-sep {
  color: var(--text-muted);
}
.x-embed-date {
  color: var(--text-muted);
  text-decoration: none;
}
.x-embed-date:hover,
.x-embed-date:focus {
  color: var(--accent);
  text-decoration: underline;
}
.x-embed blockquote.twitter-tweet {
  border-left: none;
  padding-left: 0;
  margin: 0;
  font-style: normal;
  font-size: 0; /* hide oEmbed attribution line (text nodes + date link) */
}
.x-embed blockquote.twitter-tweet p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
  margin: 0;
}
.x-embed blockquote.twitter-tweet p a {
  color: var(--accent);
  text-decoration: none;
}
.x-embed blockquote.twitter-tweet p a:hover,
.x-embed blockquote.twitter-tweet p a:focus {
  color: var(--accent-hover);
  text-decoration: underline;
}

.content code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  background-color: var(--bg-surface);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
}

.content pre {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.5rem;
}

.content pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
}

.content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

.content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0;
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 6px;
}


/* ===== 404 ===== */
.content .ascii-art {
  font-family: monospace;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 1.5rem 0;
  background: none;
  border: none;
  padding: 0;
  font-size: 1rem;
  border-radius: 0;
  overflow-x: visible;
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
  white-space: nowrap;
}

.footer-links a {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding-block: 0.5rem;
  padding-inline: 0.35rem;
  min-width: 24px;
  text-align: center;
}

.footer-links a:hover {
  color: var(--accent);
}

.site-footer p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.site-footer p a {
  padding-block: 0.5rem;
}

/* ===== Pagination ===== */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
  list-style: none;
}

.pagination a,
.pagination span {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
}

.pagination .active a {
  background-color: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ===== About ===== */
.about-content .about-avatar {
  float: right;
  width: 150px;
  height: 150px;
  border-radius: 6px;
  object-fit: cover;
  margin: 0.5rem 0 1.5rem 2.5rem;
}

/* ===== Mobile Menu Toggle (hidden on desktop) ===== */
.mobile-menu-toggle {
  display: none;
}


/* ===== Responsive ===== */
@media (max-width: 900px) {
  .site-footer .container {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  .site-footer p {
    flex-basis: 100%;
    text-align: center;
  }
}

@media (max-width: 750px) {
  .site-footer {
    padding: 1.75rem 0;
  }

  .site-footer .container {
    gap: 0.75rem;
  }

  .footer-links {
    gap: 1rem;
  }

  .site-footer p {
    padding: 0.25rem 0;
    font-size: 0.75rem;
  }
}

@media (max-width: 600px) {
  .site-header {
    padding: 0.75rem 0;
  }

  .about-content .about-avatar {
    float: none;
    display: block;
    margin: 0 0 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .post-header h1 {
    font-size: 1.6rem;
  }

  .site-footer {
    padding: 1.5rem 0;
  }

  .site-footer .container {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }

  .footer-links {
    gap: 1rem;
    justify-content: center;
  }

  .site-footer p {
    font-size: 0.75rem;
    line-height: 1.4;
  }

  .mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
    position: relative;
  }

  .mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--text);
    transition: transform 0.25s ease, opacity 0.25s ease;
  }

  .mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Full-screen blur overlay */
  .nav-links {
    position: fixed;
    inset: 0;
    background-color: color-mix(in srgb, var(--bg) 70%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: flex-end;
    padding: 5rem 2rem 2rem;
    gap: 0;
    display: flex;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 1.15rem;
    font-weight: 500;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border);
    width: 100%;
    text-align: right;
    color: var(--text);
  }

  .nav-links a:hover,
  .nav-links a:focus {
    color: var(--accent);
  }

  .nav-links a:last-child {
    border-bottom: none;
  }
}

/* ===== Search Modal ===== */
.search-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.search-modal.active {
  display: flex;
}

.search-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
}

.search-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.search-header input {
  flex: 1;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--text);
  outline: none;
}

.search-header input::placeholder {
  color: var(--text-muted);
}

.search-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.5rem;
}

.search-close:hover {
  color: var(--text);
}

.search-results {
  overflow-y: auto;
  max-height: calc(70vh - 60px);
  padding: 0.5rem;
}

.search-result {
  display: block;
  padding: 0.75rem;
  border-radius: 4px;
  text-decoration: none;
}

.search-result:hover,
.search-result.focused {
  background-color: var(--bg);
}

.search-result-title {
  color: var(--accent);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.search-result-excerpt {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.search-result-excerpt mark {
  background-color: var(--accent);
  color: var(--bg);
  font-style: normal;
  padding: 0 0.15rem;
  border-radius: 2px;
}

.no-results {
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tag:hover {
  background-color: var(--accent);
  color: var(--bg);
}

/* ===== Tags Page ===== */
.tags-page {
  margin-top: 1rem;
}

.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.tags-cloud .tag {
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
}

.tag-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.25rem;
}

/* ===== Tag Taxonomy Page ===== */
.tag-posts {
  margin-top: 2rem;
}

/* ===== Keyboard Navigation ===== */
.post-list li.focused,
.tags-cloud a.focused {
  background-color: var(--bg-surface);
}

/* ===== Shortcuts Overlay ===== */
#shortcuts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

#shortcuts-overlay.active {
  display: flex;
}

.shortcuts-modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 90%;
  max-width: 380px;
  overflow: hidden;
}

.shortcuts-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.95rem;
}

.shortcuts-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0 0.25rem;
  line-height: 1;
}

.shortcuts-close:hover {
  color: var(--text);
}

.shortcuts-modal-body {
  padding: 1rem;
}

.shortcuts-modal-body dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 1.25rem;
  margin: 0;
}

.shortcuts-modal-body dt {
  font-family: "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
  align-self: center;
  justify-self: start;
  color: var(--text);
}

.shortcuts-modal-body dd {
  color: var(--text-muted);
  font-size: 0.85rem;
  align-self: center;
  margin: 0;
}

/* ===== Footer Shortcuts Hint ===== */
.shortcuts-hint {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: inherit;
  cursor: pointer;
  padding: 0.25rem 0;
  min-height: 24px;
  font-family: inherit;
  vertical-align: middle;
}

.shortcuts-hint:hover {
  color: var(--accent);
}

/* ===== YouTube Embed ===== */
.yt-embed {
  position: relative;
  margin: 1.5rem 0;
}

.yt-thumb-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
}

.yt-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.yt-play-btn {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.yt-play-btn svg {
  width: 68px;
  height: 48px;
  opacity: 0.85;
  transition: opacity 0.15s, transform 0.15s;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.yt-play-btn:hover svg,
.yt-play-btn:focus-visible svg {
  opacity: 1;
  transform: scale(1.08);
}

.yt-embed iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: none;
}

.yt-blocked-notice {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.82);
  color: #e0e0e0;
  padding: 1.5rem;
  text-align: center;
}

.yt-blocked-notice[hidden] {
  display: none;
}

.yt-blocked-notice p {
  margin: 0;
  font-size: 0.875rem;
}

/* ===== Consent shared buttons ===== */
.consent-btn-primary,
.consent-btn-secondary,
.consent-btn-ghost {
  padding: 0.45rem 1.1rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}

.consent-btn-primary {
  background: var(--accent);
  color: #000;
  font-weight: 600;
}

.consent-btn-primary:hover {
  background: var(--accent-hover);
}

.consent-btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.consent-btn-secondary:hover {
  border-color: var(--text-muted);
}

.consent-btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.consent-btn-ghost:hover {
  color: var(--text);
}

.consent-link-btn {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-family: inherit;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.consent-link-btn:hover {
  color: var(--text);
}

/* ===== Consent Banner ===== */
#consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 0.85rem 1rem;
  z-index: 900;
}

#consent-banner[hidden] {
  display: none;
}

.consent-banner-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.consent-banner-text {
  flex: 1;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
  min-width: 18ch;
}

.consent-banner-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-shrink: 0;
}

/* ===== Consent Overlay ===== */
#consent-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

#consent-overlay[hidden] {
  display: none;
}

.consent-overlay-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

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

.consent-overlay-header h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-heading);
}

.consent-close-overlay {
  appearance: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.15rem;
  display: flex;
  align-items: center;
  border-radius: 4px;
}

.consent-close-overlay:hover {
  color: var(--text);
}

.consent-overlay-body {
  padding: 0.25rem 0;
  flex: 1;
}

.consent-category {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.consent-category:last-child {
  border-bottom: none;
}

.consent-category-row {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
}

.consent-category-info {
  flex: 1;
}

.consent-category-info strong {
  display: block;
  font-size: 0.9rem;
  color: var(--text-heading);
  margin-bottom: 0.25rem;
}

.consent-category-info p {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.consent-always-on {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Toggle switch */
.consent-toggle {
  position: relative;
  flex-shrink: 0;
  margin-top: 0.1rem;
  cursor: pointer;
}

.consent-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-toggle-track {
  display: block;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
}

.consent-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: left 0.2s, background 0.2s;
}

.consent-toggle input:checked + .consent-toggle-track {
  background: var(--accent);
}

.consent-toggle input:checked + .consent-toggle-track::after {
  left: 21px;
  background: #fff;
}

.consent-toggle input:focus-visible + .consent-toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.consent-overlay-footer {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* ===== Reduced Motion ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
