/* ============================================================
   Site chrome only.
   Post interior styling lives INSIDE each content HTML file's
   own <style> block - this stylesheet never reaches into .post-body.
   ============================================================ */
:root,
[data-theme='light'] {
  --bg-color: #ffffff;
  --text-color: #1a1a1a;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --text-tertiary: #999;
  --text-tab: #fff;
  --border-color: #e1e1e1;
  --border-light: #e5e5e5;
  --border-lighter: #f5f5f5;
  --input-bg: #f8f9fa;
  --card-bg: #ffffff;
  --primary-color: #374151;
  --primary-hover: #1f2937;
  --primary-light-bg: rgba(55, 65, 81, 0.08);
  --accent-color: #10b981;
  --surface-1: #ffffff;
  --surface-2: #f8f9fa;
  --surface-3: #f0f0f0;
  --hover-bg: #f0f1f2;
  --positive-bg: #e8f5e8;
  --positive-color: #2d7d32;
  --negative-bg: #fee;
  --negative-color: #c33;
  --nav-bg: rgba(255, 255, 255, 0.96);
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  --card-shadow-hover: 0 4px 14px rgba(0, 0, 0, 0.06);
  --primary-rgb: 55, 65, 81;
}

[data-theme='dark'] {
  --bg-color: #1a1a1a;
  --text-color: #ffffff;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-tertiary: #888;
  --text-tab: #000;
  --border-color: #333;
  --border-light: #444;
  --border-lighter: #2a2a2a;
  --input-bg: #2a2a2a;
  --card-bg: #222;
  --primary-color: #d1d5db;
  --primary-hover: #f3f4f6;
  --primary-light-bg: rgba(209, 213, 219, 0.1);
  --accent-color: #10b981;
  --surface-1: #2a2a2a;
  --surface-2: #333;
  --surface-3: #3a3a3a;
  --hover-bg: #3a3a3a;
  --positive-bg: #1a3d1a;
  --positive-color: #4caf50;
  --negative-bg: #3d1a1a;
  --negative-color: #f44336;
  --nav-bg: rgba(14, 13, 12, 0.97);
  --card-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --card-shadow-hover: 0 6px 24px rgba(0, 0, 0, 0.4);
  --primary-rgb: 209, 213, 219;
}

/* Minimal global reset - applied site-wide. Posts may override inside .post-body. */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg-color);
  color: var(--text-color);
  min-height: 100vh;
  font-family: 'Be Vietnam Pro', 'Segoe UI', ui-sans-serif, system-ui, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

@media (hover: hover) and (pointer: fine) {
  .site-header {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }
}

.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 60px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* On desktop, dissolve the brand row so logo + actions become direct flex
   children of .site-header-inner; keep the visual order: logo, nav, actions. */
.site-header-row--brand {
  display: contents;
}
.site-header-row--brand .site-logo {
  order: 0;
}
.site-header-row--nav {
  order: 1;
}
.site-header-actions {
  order: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: 'Andada Pro', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  text-decoration: none;
}

.site-logo-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  box-shadow: 0 0 0 1px var(--border-color);
}

.site-nav {
  display: flex;
  gap: 22px;
  align-items: center;
}

.site-nav a {
  position: relative;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  padding: 4px 0;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 2px;
  background: var(--text-primary);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.15s ease;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text-primary);
}

.site-nav a:hover::after,
.site-nav a.active::after {
  transform: scaleX(1);
}

.theme-toggle,
.site-search-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  width: 30px;
  height: 30px;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease;
  padding: 0;
}

.theme-toggle:hover,
.site-search-btn:hover {
  background: var(--hover-bg);
  border-color: var(--text-secondary);
}

/* VI ⇄ EN segmented switch - the active language is filled and inert, the
   other segment is a link to the companion page (or that language's home). */
.site-lang-switch {
  display: inline-flex;
  align-items: stretch;
  height: 30px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.site-lang-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 0 6px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

a.site-lang-opt:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
}

.site-lang-opt.is-active {
  background: var(--text-primary);
  color: var(--bg-color);
}

/* Cross-language suggestion banner injected by assets/lang.js when the page
   has a translation in the reader's preferred language. */
.lang-banner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 10px;
  padding: 8px 44px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-2);
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
}

.lang-banner a {
  color: var(--text-primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.lang-banner-close {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.lang-banner-close:hover {
  color: var(--text-primary);
}

/* In-post link to the paired translation, next to date + tags. */
.post-lang-link {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.74rem;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.post-lang-link:hover {
  color: var(--text-primary);
}

.theme-toggle svg,
.site-search-btn svg {
  width: 14px;
  height: 14px;
}

.theme-toggle .icon-sun {
  display: none;
}
[data-theme='dark'] .theme-toggle .icon-sun {
  display: block;
}
[data-theme='dark'] .theme-toggle .icon-moon {
  display: none;
}

@media (max-width: 720px) {
  .site-header-inner {
    flex-direction: column;
    align-items: stretch;
    height: auto;
    padding: 0 16px;
    gap: 0;
  }
  .site-header-row--brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: 52px;
  }
  .site-header-row--nav {
    height: 44px;
    justify-content: flex-start;
    border-top: 1px solid var(--border-color);
    gap: 18px;
  }
  /* On scroll: flatten to a single row - [logo] [nav links] [search]. The
     theme toggle is hidden to make room. The brand row dissolves so its
     children flow into .site-header-inner alongside the nav row. */
  .site-header.is-scrolled .site-header-inner {
    flex-direction: row;
    align-items: center;
    height: 52px;
    gap: 14px;
  }
  .site-header.is-scrolled .site-header-row--brand {
    display: contents;
  }
  .site-header.is-scrolled .site-header-row--brand .site-logo {
    order: 0;
  }
  .site-header.is-scrolled .site-header-row--nav {
    order: 1;
    flex: 1 1 auto;
    height: auto;
    border-top: 0;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-header.is-scrolled .site-header-row--nav::-webkit-scrollbar {
    display: none;
  }
  .site-header.is-scrolled .site-header-actions {
    order: 2;
  }
  .site-header.is-scrolled .theme-toggle {
    display: none;
  }
  .site-header.is-scrolled .site-logo-text {
    display: none;
  }
  .site-nav {
    gap: 14px;
  }
  .site-nav a {
    font-size: 10px;
    letter-spacing: 0.06em;
  }
  .site-logo {
    font-size: 17px;
    gap: 8px;
  }
  .site-logo-avatar {
    width: 20px;
    height: 20px;
  }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--bg-color);
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 28px 24px;
  font-size: 12px;
  color: var(--text-tertiary);
  text-align: center;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

.site-footer-disclaimer {
  margin: 0 auto 14px;
  max-width: 680px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 11.5px;
  line-height: 1.6;
  letter-spacing: 0.005em;
  color: var(--text-tertiary);
  opacity: 0.85;
  text-wrap: balance;
}

.site-footer-disclaimer::before,
.site-footer-disclaimer::after {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  margin: 0 auto 8px;
  background: var(--border-color);
  opacity: 0.6;
}
.site-footer-disclaimer::after {
  margin: 8px auto 0;
}

.site-footer-nav {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.site-footer-meta {
  display: block;
}

.site-footer-inner a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-footer-inner a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

.site-footer-mark {
  color: var(--text-secondary);
  letter-spacing: 0.04em;
}

.site-footer-author {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.site-footer-avatar {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}

.site-footer-sep {
  display: inline-block;
  margin: 0 10px;
  color: var(--text-tertiary);
  opacity: 0.55;
}

.site-footer-rights {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

@media (max-width: 720px) {
  .site-footer-inner {
    padding: 18px 16px 20px;
    font-size: 11px;
  }
  .site-footer-disclaimer {
    font-size: 10.5px;
    line-height: 1.55;
    margin-bottom: 12px;
  }
  .site-footer-sep {
    margin: 0 6px;
  }
}

/* ============================================================
   Page containers
   ============================================================ */
.page-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.prose-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

.page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 28px;
}

/* ============================================================
   Book table-of-contents - the homepage / tag / pagination post
   list rendered as numbered chapter entries on a shared spine.
   Reuses the brass + hairline vocabulary from the home masthead
   and About shelf. (Search results still use .post-card below.)
   ============================================================ */
.book-toc {
  --plate-brass:   #a88440;
  --plate-brass-2: #c9a961;
  position: relative;
  margin: 8px 0 0;
}
[data-theme='dark'] .book-toc {
  --plate-brass:   #c9a961;
  --plate-brass-2: #e3c780;
}

/* The spine - a single hairline down the left gutter, shared by
   all entries. Reads as the inner margin of an open book. */
.book-toc::before {
  content: '';
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 40px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--border-color) 10%,
    var(--border-color) 90%,
    transparent 100%
  );
  opacity: 0.75;
  pointer-events: none;
}

.toc-entry {
  position: relative;
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: start;
  padding: 16px 4px 18px 0;
  transition: background-color 180ms ease;
}
.toc-entry + .toc-entry {
  border-top: 1px dashed var(--border-color);
}
.toc-entry:hover {
  background: var(--hover-bg);
}

.toc-ord {
  grid-column: 1;
  position: relative;
  z-index: 1;
  padding-top: 6px;
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
  transition: color 220ms ease, transform 220ms ease;
}
.toc-entry:hover .toc-ord {
  color: var(--plate-brass-2);
  transform: translateY(-1px);
}

.toc-body {
  grid-column: 2;
  min-width: 0;
  padding-right: 2px;
}

.toc-row {
  display: grid;
  grid-template-columns: minmax(0, auto) 1fr auto;
  align-items: baseline;
  column-gap: 10px;
  margin: 0 0 6px;
  font-weight: 700;
}

.toc-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.1rem, 2vw, 1.32rem);
  line-height: 1.32;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  text-decoration: none;
  background-image: linear-gradient(var(--plate-brass), var(--plate-brass));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size 260ms ease, color 180ms ease;
}
.toc-title:hover {
  background-size: 100% 1px;
  color: var(--plate-brass-2);
}
/* Whole-row click target - covers the entire entry so clicking
   leaders, folio, excerpt all navigate. Tag links sit above it. */
.toc-title::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.toc-leaders {
  align-self: end;
  margin-bottom: 6px;
  min-width: 16px;
  height: 0;
  border-bottom: 1px dotted var(--border-color);
  opacity: 0.9;
}

.toc-folio {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  white-space: nowrap;
  transition: color 180ms ease;
}
.toc-title:hover ~ .toc-leaders {
  border-bottom-color: var(--plate-brass);
  opacity: 1;
}
.toc-title:hover ~ .toc-folio {
  color: var(--plate-brass-2);
}

.toc-note {
  margin: 0 0 6px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 400;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.toc-tags {
  margin: 8px 0 0;
  position: relative;
  z-index: 2;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}
.toc-tags .toc-tag-pre {
  opacity: 0.6;
  margin-right: 4px;
}
.toc-tags a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-color);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease;
}
.toc-tags a:hover {
  color: var(--plate-brass-2);
  border-bottom-color: var(--plate-brass);
}

/* Chapter ornament + folio label above pagination - marks the
   end of the contents page. */
.toc-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 36px auto 0;
}
.toc-ornament::before,
.toc-ornament::after {
  content: '';
  display: block;
  height: 1px;
  width: 52px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-color) 50%,
    transparent 100%
  );
}
.toc-ornament span {
  display: block;
  width: 5px;
  height: 5px;
  background: #c9a961;
  transform: rotate(45deg);
}
[data-theme='dark'] .toc-ornament span {
  background: #e3c780;
}

.toc-folio-label {
  margin: 10px 0 0;
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

@media (max-width: 640px) {
  .book-toc::before { left: 28px; top: 10px; bottom: 10px; }
  .toc-entry {
    grid-template-columns: 56px 1fr;
    padding: 12px 2px 14px 0;
  }
  .toc-ord { font-size: 0.76rem; padding-top: 5px; }
  .toc-title { font-size: 1.05rem; }
  .toc-row { column-gap: 6px; }
  .toc-leaders { min-width: 8px; margin-bottom: 5px; }
  .toc-folio { font-size: 0.74rem; }
  .toc-note { font-size: 0.88rem; line-height: 1.55; }
  .toc-tags { font-size: 0.76rem; }
  .toc-ornament { margin-top: 28px; }
  .toc-ornament::before,
  .toc-ornament::after { width: 34px; }
}

/* ============================================================
   Post cards - used by search results (popup + /search page).
   Never appear inside post body content.
   ============================================================ */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.post-card {
  position: relative;
  display: block;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  padding: 18px 22px;
  box-shadow: var(--card-shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--text-tertiary);
  border-left-color: var(--accent-color);
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 6px;
}

.post-card-meta time {
  font-variant-numeric: tabular-nums;
}

.post-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.005em;
}

.post-card-title a {
  color: inherit;
  text-decoration: none;
}

/* Whole-card click target via ::after overlay. Tags sit above it. */
.post-card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

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

.post-card-excerpt {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 12px;
}

.post-card-tags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-chip {
  display: inline-block;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover {
  background: var(--primary-light-bg);
  color: var(--text-primary);
  border-color: var(--border-color);
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pagination a:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.pagination .current {
  background: var(--primary-color);
  color: var(--text-tab);
  border-color: var(--primary-color);
}

.pagination .disabled {
  opacity: 0.4;
  pointer-events: none;
}

.pagination .ellipsis {
  border-color: transparent;
  background: transparent;
  min-width: 16px;
  padding: 0 4px;
  pointer-events: none;
}

/* ============================================================
   Tag cloud
   ============================================================ */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-cloud .tag-chip {
  font-size: 11px;
  padding: 5px 12px;
}

.tag-cloud .tag-chip .count {
  margin-left: 6px;
  color: var(--text-tertiary);
  font-weight: 500;
}

/* ============================================================
   Post page header (surrounds the content, but never reaches in)
   ============================================================ */
.post-header {
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.post-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-color);
  margin: 0 0 10px;
}

.post-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin: 0 0 14px;
  letter-spacing: -0.015em;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  flex-wrap: wrap;
}

.post-meta time {
  font-variant-numeric: tabular-nums;
}

.post-meta .post-card-tags {
  margin-left: auto;
}

/* NOTE: .post-body has NO default styling.
   Each post is responsible for its own <style> block. */

/* ============================================================
   Floating Table of Contents
   On wide screens (>= 1180px) the TOC floats fixed to the left
   edge of the viewport. Collapsed default is a compact rail of
   tick marks (top-level h2 only). Clicking the rail expands it:
   the panel widens, h2 labels reveal, and h3 children appear.
   Click again (or outside, or Escape) to collapse. Hidden
   entirely below 1180px - the prose column needs the space.
   ============================================================ */
.post-layout { position: relative; }

.post-toc { display: none; }

@media (min-width: 1180px) {
  .post-layout.has-toc .post-toc {
    display: block;
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 50;
    max-height: calc(100vh - 120px);
  }
}

.post-toc-inner {
  --toc-collapsed-w: 56px;
  --toc-expanded-w: 280px;
  position: relative;
  width: var(--toc-collapsed-w);
  max-height: inherit;
  padding: 14px 8px 14px 16px;
  background: var(--nav-bg, var(--bg-color));
  border: 1px solid transparent;
  border-left: none;
  cursor: pointer;
  overflow: hidden;
  transition:
    width 220ms ease,
    padding 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.post-toc-inner:focus-visible {
  outline: 2px solid var(--accent-color, var(--text-primary));
  outline-offset: 2px;
}

.post-toc.is-open .post-toc-inner {
  width: var(--toc-expanded-w);
  padding: 18px 18px 18px 20px;
  border-color: var(--border-color);
  box-shadow: 0 12px 40px -16px rgba(0, 0, 0, 0.25);
  cursor: default;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.post-toc-inner::-webkit-scrollbar { width: 4px; }
.post-toc-inner::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 2px;
}

.post-toc-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 180ms ease 60ms, transform 180ms ease 60ms;
  white-space: nowrap;
}
.post-toc.is-open .post-toc-eyebrow { opacity: 1; transform: none; }

.post-toc-list,
.post-toc-sublist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.post-toc-list { gap: 6px; }
.post-toc-sublist {
  gap: 1px;
  margin-top: 2px;
  padding-left: 18px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 220ms ease, opacity 180ms ease;
}
.post-toc.is-open .post-toc-sublist {
  max-height: 600px;
  opacity: 1;
}

.post-toc-item { margin: 0; }

.post-toc-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color 0.15s ease;
  white-space: nowrap;
  pointer-events: none;
}
.post-toc.is-open .post-toc-link { pointer-events: auto; }

.post-toc-link:hover { color: var(--text-primary); }

.post-toc-tick {
  flex: 0 0 auto;
  width: 24px;
  height: 2px;
  background: var(--border-color);
  border-radius: 1px;
  transition: width 180ms ease, background-color 180ms ease;
}

.post-toc-link--l3 .post-toc-tick {
  width: 14px;
  opacity: 0.7;
}

.post-toc-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 160ms ease, transform 200ms ease;
}
.post-toc.is-open .post-toc-label {
  opacity: 1;
  transform: none;
}

.post-toc-link.is-active { color: var(--text-primary); font-weight: 600; }
.post-toc-link.is-active .post-toc-tick {
  background: var(--accent-color, var(--text-primary));
  width: 28px;
}
.post-toc-link--l3.is-active .post-toc-tick { width: 18px; }

.post-toc-link.is-active-parent .post-toc-tick {
  background: var(--accent-color, var(--text-primary));
  opacity: 0.55;
}

html { scroll-padding-top: 80px; }

/* Twemoji: render inline at text size (post detail pages only). */
.post-body img.emoji {
  height: 1em;
  width: 1em;
  margin: 0 0.05em 0 0.1em;
  vertical-align: -0.1em;
  display: inline-block;
}

/* ============================================================
   Search
   ============================================================ */
.search-form {
  margin-bottom: 24px;
}

.search-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

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

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
}

.search-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 14px;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tertiary);
  border: 1px dashed var(--border-color);
}

.empty-state h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin: 0 0 6px;
}

.empty-state code {
  background: var(--input-bg);
  padding: 1px 5px;
  font-size: 0.88em;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
}

/* ============================================================
   404 / not-found page
   Echoes the home-epigraph motif - oversized ghost numeral
   behind a serif title, dinkus ornament, muted return links.
   ============================================================ */
.not-found {
  text-align: center;
  padding: 72px 24px 120px;
}

.not-found-code {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(4.5rem, 14vw, 8rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  opacity: 0.1;
  margin: 0 0 4px;
  user-select: none;
}

[data-theme='dark'] .not-found-code {
  opacity: 0.16;
}

.not-found .page-title {
  font-size: clamp(1.4rem, 3vw, 1.9rem);
}

.not-found .home-epigraph-ornament {
  margin: 22px auto 0;
}

.not-found-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 28px;
  margin-top: 28px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.not-found-links a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 3px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.not-found-links a:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* ============================================================
   403 / restricted page
   The geo-blocked post rendered as a censored dossier - a paper
   plate of redacted lines struck with a brass ink stamp - layered
   over the same ghost-numeral + dinkus vocabulary as the 404.
   --stamp-text is a darker brass than --stamp-ink so the kicker
   stays AA-readable on the light theme; the stamp itself is
   aria-hidden decoration.
   ============================================================ */
.restricted {
  --stamp-ink: #a88440;
  --stamp-text: #8f6f2f;
  padding-bottom: 96px;
}

[data-theme='dark'] .restricted {
  --stamp-ink: #c9a961;
  --stamp-text: #c9a961;
}

.restricted .not-found-code {
  margin-bottom: 30px;
}

.restricted-dossier {
  position: relative;
  width: min(400px, 100%);
  margin: 0 auto;
}

.restricted-doc {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 26px 28px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: var(--card-shadow);
}

.restricted-doc-line {
  display: block;
  width: var(--w, 100%);
  height: 9px;
  border-radius: 2px;
  background: var(--text-primary);
  opacity: 0.13;
}

.restricted-doc-heading {
  width: 56%;
  height: 15px;
  margin-bottom: 5px;
  opacity: 0.22;
}

[data-theme='dark'] .restricted-doc-line {
  opacity: 0.18;
}

[data-theme='dark'] .restricted-doc-heading {
  opacity: 0.3;
}

.restricted-stamp {
  position: absolute;
  top: -20px;
  right: -14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 20px 10px;
  border: 2px solid var(--stamp-ink);
  border-radius: 5px;
  transform: rotate(-7deg);
  opacity: 0.94;
}

.restricted-stamp::before {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px solid var(--stamp-ink);
  border-radius: 3px;
  opacity: 0.65;
}

.restricted-stamp-code {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--stamp-ink);
}

.restricted-stamp-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--stamp-ink);
}

.restricted-kicker {
  margin: 34px 0 12px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--stamp-text);
}

.restricted .page-title {
  margin-bottom: 12px;
}

.restricted .page-subtitle {
  max-width: 460px;
  margin: 0 auto;
  font-size: 0.9rem;
  line-height: 1.65;
}

.restricted .home-epigraph-ornament {
  margin: 26px auto 0;
}

.restricted .not-found-code,
.restricted-dossier,
.restricted-kicker,
.restricted .page-title,
.restricted .page-subtitle,
.restricted .home-epigraph-ornament,
.restricted .not-found-links {
  animation: epigraphRise 700ms ease-out both;
}

.restricted .not-found-code {
  animation-duration: 1200ms;
}
.restricted-dossier {
  animation-delay: 100ms;
}
.restricted-kicker {
  animation-delay: 220ms;
}
.restricted .page-title {
  animation-delay: 300ms;
}
.restricted .page-subtitle {
  animation-delay: 380ms;
}
.restricted .home-epigraph-ornament {
  animation-delay: 460ms;
}
.restricted .not-found-links {
  animation-delay: 540ms;
}

@keyframes restrictedStamp {
  from {
    opacity: 0;
    transform: rotate(-7deg) scale(1.7);
  }
  65% {
    opacity: 1;
    transform: rotate(-7deg) scale(0.95);
  }
  to {
    opacity: 0.94;
    transform: rotate(-7deg) scale(1);
  }
}

.restricted-stamp {
  animation: restrictedStamp 480ms cubic-bezier(0.2, 0.7, 0.35, 1.15) 620ms both;
}

@media (prefers-reduced-motion: reduce) {
  .restricted .not-found-code,
  .restricted-dossier,
  .restricted-kicker,
  .restricted .page-title,
  .restricted .page-subtitle,
  .restricted .home-epigraph-ornament,
  .restricted .not-found-links,
  .restricted-stamp {
    animation: none;
  }
}

@media (max-width: 720px) {
  .restricted .not-found-code {
    margin-bottom: 24px;
  }
  .restricted-dossier {
    width: min(340px, 100%);
  }
  .restricted-doc {
    padding: 22px 20px 20px;
    gap: 10px;
  }
  .restricted-stamp {
    top: -16px;
    right: -6px;
    padding: 9px 16px 8px;
  }
  .restricted-stamp-code {
    font-size: 1.25rem;
  }
}

/* ============================================================
   Home page epigraph
   Oversized ghost quotation mark behind an italic serif line,
   with a dinkus (diamond-and-rule) ornament beneath.
   ============================================================ */
.home-epigraph {
  position: relative;
  max-width: 680px;
  margin: 4px auto 32px;
  padding: 44px 20px 28px;
  text-align: center;
  isolation: isolate;
}

.home-epigraph::before {
  content: "\201C";
  position: absolute;
  top: 0.1em;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
  color: var(--text-primary);
  opacity: 0.08;
  z-index: -1;
  user-select: none;
  pointer-events: none;
}

[data-theme='dark'] .home-epigraph::before {
  opacity: 0.13;
}

.home-epigraph-quote {
  margin: 0;
  padding: 0;
  border: 0;
}

.home-epigraph-quote p {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.4;
  letter-spacing: -0.008em;
  color: var(--text-primary);
  text-wrap: balance;
}

.home-epigraph-quote em {
  font-style: italic;
  font-weight: 500;
  color: var(--text-secondary);
}

.home-epigraph-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.home-epigraph-ornament::before,
.home-epigraph-ornament::after {
  content: '';
  display: block;
  height: 1px;
  width: 28px;
  background: var(--border-color);
}

.home-epigraph-ornament span {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--accent-color);
  transform: rotate(45deg);
}

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

.home-epigraph::before,
.home-epigraph-quote,
.home-epigraph-ornament {
  animation: epigraphRise 900ms ease-out both;
}

.home-epigraph::before {
  animation-duration: 1400ms;
}
.home-epigraph-quote {
  animation-delay: 140ms;
}
.home-epigraph-ornament {
  animation-delay: 280ms;
}

@media (prefers-reduced-motion: reduce) {
  .home-epigraph::before,
  .home-epigraph-quote,
  .home-epigraph-ornament {
    animation: none;
  }
}

@media (max-width: 720px) {
  .home-epigraph {
    padding: 32px 12px 22px;
    margin-bottom: 24px;
  }
  .home-epigraph::before {
    top: 0.15em;
  }
  .home-epigraph-ornament::before,
  .home-epigraph-ornament::after {
    width: 22px;
  }
}

/* ============================================================
   About - "The Shelf"
   A curated reading list of source blogs, presented as numbered
   entries on a shelf. Each item has a left gutter with an ordinal
   and a brass-diamond, a serif title, and an italic note.
   ============================================================ */
.about-page {
  max-width: 720px;
}

.about-page {
  --plate-brass:   #a88440;
  --plate-brass-2: #c9a961;
}
[data-theme='dark'] .about-page {
  --plate-brass:   #c9a961;
  --plate-brass-2: #e3c780;
}

.about-hero {
  text-align: center;
  padding: 12px 0 28px;
}

.about-crown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.about-crown .rule {
  display: block;
  height: 1px;
  width: 56px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-color) 50%,
    transparent 100%
  );
}
.about-crown .diamond {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--plate-brass-2);
  transform: rotate(45deg);
}

.about-title {
  margin: 0 0 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--text-primary);
}

.about-lede {
  margin: 0 auto;
  max-width: 560px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: balance;
}
.about-lede em {
  font-style: italic;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--plate-brass);
  padding-bottom: 1px;
}

/* Latest-subscribers slot - a masked guest ledger of the last 10 readers.
   Hidden until the function call resolves; on failure it stays invisible. */
.about-subscriber {
  margin: 0 auto 28px;
  padding: 16px 20px 14px;
  border: 1px solid var(--border-color);
  border-radius: 3px;
  background: var(--surface-2);
  text-align: center;
  opacity: 0;
  transform: translateY(4px);
  pointer-events: none;
  transition: opacity 420ms ease, transform 420ms ease;
}
.about-subscriber.is-loaded {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.about-subscriber .sub-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: 'Be Vietnam Pro', 'Andada Pro', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.about-subscriber .sub-pulse {
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--plate-brass-2);
  transform: rotate(45deg);
  animation: aboutSubPulse 2.4s ease-in-out infinite;
}
@keyframes aboutSubPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.about-subscriber .sub-count {
  font-weight: 500;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.sub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 8px 14px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.74rem;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}
.sub-list li {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sub-list li:first-child {
  color: var(--text-primary);
  border-bottom: 1px solid var(--plate-brass);
  padding-bottom: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .about-subscriber .sub-pulse { animation: none; opacity: 0.8; }
}

@media (max-width: 640px) {
  .about-subscriber { padding: 12px 14px 12px; margin-bottom: 22px; }
  .about-subscriber .sub-eyebrow { font-size: 0.62rem; letter-spacing: 0.15em; }
  .sub-list { grid-template-columns: repeat(2, 1fr); font-size: 0.7rem; gap: 6px 10px; }
}

.about-shelf {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 12px 0 36px;
  position: relative;
}

/* The spine - a single hairline down the left gutter, shared by all items.
   Reads as a bookshelf edge. */
.about-shelf::before {
  content: '';
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 30px;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--border-color) 10%,
    var(--border-color) 90%,
    transparent 100%
  );
  opacity: 0.7;
}

.shelf-item {
  position: relative;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: start;
  padding: 16px 20px 18px 0;
  border-radius: 2px;
  transition: background-color 180ms ease;
}
.shelf-item:hover {
  background: var(--hover-bg);
}

.shelf-gutter {
  position: relative;
  height: 100%;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2px;
  gap: 10px;
  z-index: 1;
}

.shelf-ord {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--text-tertiary);
}

.shelf-diamond {
  display: block;
  width: 6px;
  height: 6px;
  background: var(--plate-brass);
  transform: rotate(45deg);
  transition: background-color 220ms ease, transform 220ms ease;
}
.shelf-item:hover .shelf-diamond {
  background: var(--plate-brass-2);
  transform: rotate(45deg) scale(1.15);
}

.shelf-body {
  min-width: 0;
}

.shelf-title {
  margin: 0 0 4px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.25;
  letter-spacing: -0.005em;
}
.shelf-title a {
  color: var(--text-primary);
  text-decoration: none;
  background-image: linear-gradient(var(--plate-brass), var(--plate-brass));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: background-size 260ms ease, color 180ms ease;
}
.shelf-title a:hover {
  background-size: 100% 1px;
  color: var(--plate-brass-2);
}

.shelf-meta {
  margin: 0 0 8px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.shelf-host {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.74rem;
  color: var(--text-secondary);
  text-decoration: none;
  letter-spacing: -0.005em;
  border-bottom: 1px dotted var(--border-color);
  padding-bottom: 1px;
  transition: color 180ms ease, border-color 180ms ease;
}
.shelf-host:hover {
  color: var(--plate-brass-2);
  border-bottom-color: var(--plate-brass);
}

.shelf-sep {
  opacity: 0.5;
}

.shelf-tags {
  display: inline-flex;
  gap: 6px;
}

.shelf-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-2);
}

.shelf-note {
  margin: 4px 0 0;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
}

.about-footer {
  text-align: center;
  padding: 16px 0 32px;
}

.about-signature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}

.about-sig-link {
  display: inline-block;
  line-height: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--border-color), 0 6px 20px rgba(0, 0, 0, 0.12);
  transition: transform 220ms ease, box-shadow 220ms ease;
}
.about-sig-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 1px var(--plate-brass), 0 8px 22px rgba(0, 0, 0, 0.18);
}

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

.about-sig-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  line-height: 1.3;
}

.about-sig-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.about-sig-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--plate-brass);
  padding-bottom: 1px;
  transition: color 180ms ease;
}
.about-sig-name:hover {
  color: var(--plate-brass-2);
}

.about-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.about-ornament::before,
.about-ornament::after {
  content: '';
  display: block;
  height: 1px;
  width: 28px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-color) 50%,
    transparent 100%
  );
}
.about-ornament span {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--plate-brass-2);
  transform: rotate(45deg);
}

.about-colophon {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-tertiary);
}
.about-colophon a {
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 1px solid var(--plate-brass);
  padding-bottom: 1px;
  transition: color 180ms ease;
}
.about-colophon a:hover {
  color: var(--plate-brass-2);
}

.about-support {
  margin: 8px auto 0;
  padding: 28px 0 8px;
  border-top: 1px solid var(--border-color);
  text-align: center;
}
.support-eyebrow {
  margin: 0 0 8px;
  font-family: 'Be Vietnam Pro', 'Andada Pro', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.support-title {
  margin: 0 0 10px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.support-deck {
  margin: 0 auto 18px;
  max-width: 520px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: balance;
}
.about-kofi {
  display: flex;
  justify-content: center;
}
.kofi-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 8px;
  background-color: #72a4f2;
  color: #fff !important;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.01em;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  transition: opacity 180ms ease, transform 180ms ease;
}
.kofi-button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.kofi-cup {
  width: 22px;
  height: 15px;
  display: block;
}

@media (max-width: 640px) {
  .about-hero { padding: 6px 0 20px; }
  .about-title { font-size: clamp(1.65rem, 6vw, 2rem); }
  .about-lede { font-size: 0.9rem; line-height: 1.6; }
  .about-shelf { gap: 10px; margin: 8px 0 24px; }
  .about-shelf::before { left: 22px; }
  .shelf-item {
    grid-template-columns: 52px 1fr;
    padding: 14px 12px 16px 0;
  }
  .shelf-gutter { min-height: 42px; gap: 8px; }
  .shelf-ord { font-size: 0.72rem; }
  .shelf-title { font-size: 1.05rem; }
  .shelf-note { font-size: 0.86rem; line-height: 1.55; }
  .shelf-meta { font-size: 0.7rem; gap: 6px; }
  .shelf-host { font-size: 0.7rem; }
}

/* ============================================================
   Page back-link - small uppercase pill that sits above a hero
   to let the reader retreat to the parent index (e.g. /sgd/ and
   /bds/ → /data/).
   ============================================================ */
.page-back {
  margin: 0 0 14px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.page-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-2);
  text-decoration: none;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}
.page-back-link:hover {
  color: var(--plate-brass-2);
  border-color: var(--plate-brass);
  background: var(--hover-bg);
}

.page-back-arrow {
  display: inline-block;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  transition: transform 220ms ease;
}
.page-back-link:hover .page-back-arrow {
  transform: translateX(-2px);
}

.vnd-page .page-back-link,
.bds-page .page-back-link {
  border-radius: 0;
}

@media (max-width: 640px) {
  .page-back { margin-bottom: 10px; }
  .page-back-link { padding: 5px 10px 5px 9px; font-size: 0.68rem; }
}

/* ============================================================
   Data - tracker cards
   Used by /data/. Editorial-card grid, distinct from the row-style
   shelf used on /about/. Two-column on wide viewports, single
   column on phones.
   ============================================================ */
.data-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 12px 0 36px;
}

.data-card {
  position: relative;
  /* .data-grid is a column flex; overflow:hidden below would otherwise let
     cards shrink to nothing inside scroll-capped lists (search popup). */
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: stretch;
  gap: 28px;
  padding: 24px 26px 22px 22px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition:
    border-color 220ms ease,
    background-color 220ms ease,
    transform 220ms ease;
}
.data-card::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--plate-brass) 28%,
    var(--plate-brass-2) 72%,
    transparent 100%
  );
  opacity: 0.45;
  transition: opacity 220ms ease, width 220ms ease;
}

.data-card-ord {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding-right: 24px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  color: var(--text-tertiary);
  transition: color 220ms ease;
}
.data-card-ord::after {
  content: '';
  position: absolute;
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 1px;
  background: var(--border-color);
  transition: background-color 220ms ease;
}

.data-card-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.data-card-title {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  transition: color 220ms ease;
}

.data-card-host {
  margin: 0;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.74rem;
  color: var(--text-secondary);
  letter-spacing: -0.005em;
}

.data-card-note {
  margin: 8px 0 0;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: pretty;
  max-width: 64ch;
}

.data-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-width: 96px;
}

.data-card-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.data-card-tag {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-2);
}

.data-card-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1;
  color: var(--text-tertiary);
  background: var(--surface-2);
  transition:
    transform 260ms ease,
    color 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

/* Tracker card with an engraved cover plate (see rust/generator/mod.rs) -
   the plate replaces the ordinal column and bleeds to the card edge, so
   the card's own padding moves onto the body/meta cells and the brass
   spine ::before is dropped (the plate is the left edge now). */
.data-card.has-cover {
  grid-template-columns: 184px 1fr auto;
  gap: 0;
  padding: 0;
}
.data-card.has-cover::before {
  content: none;
}
.data-card.has-cover .data-card-body {
  padding: 22px 0 20px 26px;
}
.data-card.has-cover .data-card-meta {
  margin-left: 28px;
  padding: 22px 26px 20px 0;
}

@media (max-width: 720px) {
  .data-grid {
    gap: 12px;
    margin: 8px 0 24px;
  }
  .data-card {
    grid-template-columns: 56px 1fr;
    gap: 14px;
    padding: 18px 16px 16px 14px;
  }
  .data-card.has-cover {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
  }
  .data-card.has-cover .data-card-body {
    grid-column: 1;
    padding: 16px 18px 0;
  }
  .data-card.has-cover .data-card-meta {
    grid-column: 1;
    margin: 12px 18px 0;
    padding: 12px 0 16px;
  }
  .data-card-ord {
    font-size: 1.9rem;
    padding-right: 12px;
    justify-content: flex-start;
  }
  .data-card-ord::after { top: 4px; bottom: 4px; }
  .data-card-body { grid-column: 2; }
  .data-card-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }
  .data-card-tags { justify-content: flex-start; }
  .data-card-title { font-size: 1.1rem; }
  .data-card-note { font-size: 0.88rem; line-height: 1.55; }
  .data-card-host { font-size: 0.7rem; }
  .data-card-arrow { width: 28px; height: 28px; font-size: 0.95rem; }
}

/* ============================================================
   Post-list variant of the .data-card - used by the homepage,
   tag pages, and archive. Each card leads with its engraved
   cover plate (generated per slug at /covers/<slug>.svg, see
   rust/generator/mod.rs): [thumb | body] on wide viewports,
   stacked thumb-over-body on phones. The plate is self-colored
   dark brass line-work, so it doesn't follow the page theme -
   like a printed illustration tipped into the folio.

   The card is an <article> (so tag anchors can live inside
   without invalid nested <a>s). The title link's ::after
   expands to cover the whole card; the arrow and the tag chips
   lift above that overlay so they remain individually clickable.
   ============================================================ */
.post-grid {
  --plate-brass:   #a88440;
  --plate-brass-2: #c9a961;
  margin-top: 18px;
}
[data-theme='dark'] .post-grid {
  --plate-brass:   #c9a961;
  --plate-brass-2: #e3c780;
}

article.data-card { cursor: default; }

.data-card-post {
  display: block;
  padding: 24px 28px 22px 28px;
  border: none;
}

/* With a cover plate the card becomes a [thumb | body] grid. The plate is
   the card's left edge, so the brass spine ::before is dropped and the
   card's own padding moves onto the body. */
.data-card-post.has-cover {
  display: grid;
  grid-template-columns: 184px 1fr;
  gap: 0;
  padding: 0;
}
.data-card-post.has-cover::before {
  content: none;
}
.data-card-thumb {
  position: relative;
  background: #211d15;
}
.data-card-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.data-card-post.has-cover .data-card-body {
  padding: 20px 26px 16px 24px;
}

.data-card-post .data-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.data-card-headrow {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 18px;
}

.data-card-post .data-card-title {
  margin: 0;
  position: relative;
}
.data-card-post .data-card-title a {
  color: inherit;
  text-decoration: none;
}
.data-card-post .data-card-title a::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
}

.data-card-post .data-card-arrow {
  align-self: start;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Arrow is its own anchor - lift it above the title link's full-card
   ::after overlay so it receives its own clicks + hover affordance. */
.data-card-post a.data-card-arrow {
  position: relative;
  z-index: 2;
  text-decoration: none;
  transition:
    color 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
}
.data-card-post a.data-card-arrow:hover {
  color: var(--plate-brass-2);
  border-color: var(--plate-brass);
  background: var(--hover-bg);
}

/* Card footer - tag chips on the left, folio date on the right,
   pinned to the bottom of the body so short excerpts don't leave
   the date floating mid-card. */
.data-card-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin: auto 0 0;
  padding-top: 12px;
}
.data-card-post .data-card-tags {
  justify-content: flex-start;
}
.data-card-post a.data-card-tag {
  position: relative;
  z-index: 2;
  text-decoration: none;
  transition: color 180ms ease, border-color 180ms ease;
}
.data-card-post a.data-card-tag:hover {
  color: var(--plate-brass-2);
  border-color: var(--plate-brass);
}

/* Folio date - same SF Mono cadence as /data, lowercased so
   Roman-month and year read as one stamp. */
.data-card-post .data-card-host {
  letter-spacing: 0.02em;
  text-transform: lowercase;
  white-space: nowrap;
}

.data-card-post .data-card-note {
  margin-top: 4px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* Language badge on cards whose post is in the other language (e.g. an
   untranslated Vietnamese post listed on the English home). */
.data-card-lang {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  border: 1px solid var(--border-color, currentColor);
  border-radius: 4px;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  vertical-align: 1px;
}

@media (max-width: 720px) {
  .data-card-post {
    padding: 18px 18px 16px 18px;
  }
  .data-card-post.has-cover {
    grid-template-columns: 1fr;
    padding: 0;
  }
  /* Short cinematic band - the 4:3 plate crops to its middle third, so
     motifs keep their key elements near the vertical center (cover-art.js). */
  .data-card-thumb {
    aspect-ratio: 21 / 9;
  }
  /* Keep the img in flow with the ratio on itself: the band no longer
     depends on the container's aspect-ratio for its height, so browsers
     without aspect-ratio support fall back to the natural 4:3 image
     instead of a 0-height (invisible) plate. */
  .data-card-thumb img {
    position: static;
    height: auto;
    aspect-ratio: 21 / 9;
    object-fit: cover;
  }
  /* The base .data-card mobile rule pins .data-card-body to column 2 (for
     the /data cards' [ord | body] grid); undo that here or the body lands
     in an implicit column beside the thumb instead of below it. */
  .data-card-post.has-cover .data-card-body {
    grid-column: 1;
    padding: 16px 18px 14px;
  }
  .data-card-headrow { column-gap: 12px; }
}

/* ============================================================
   Subscribe - "Dispatches"
   Two surfaces share a vocabulary:
   1. Popup dialog mounted on every page (except /subscribe/)
   2. Full-page form at /subscribe/
   Both echo the home-epigraph ornament motif (diamond + rule).
   ============================================================ */

/* ---- Popup dialog ---- */
.subscribe-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.55);
}

@media (hover: hover) and (pointer: fine) {
  .subscribe-popup-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

[data-theme='light'] .subscribe-popup-overlay {
  background: rgba(20, 20, 20, 0.42);
}

.subscribe-popup-overlay.is-open {
  display: flex;
  animation: subscribeOverlayIn 280ms ease-out both;
}

.subscribe-popup {
  position: relative;
  width: 100%;
  max-width: 460px;
  padding: 38px 30px 30px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow-hover, 0 20px 48px rgba(0, 0, 0, 0.35));
  text-align: center;
  isolation: isolate;
  pointer-events: auto;
  animation: subscribeModalIn 460ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.subscribe-popup::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--border-lighter);
  pointer-events: none;
  z-index: -1;
}

.subscribe-popup::after {
  content: '\2756';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 14px;
  line-height: 1;
  color: var(--accent-color);
  background: var(--bg-color);
  padding: 0 10px;
}

.subscribe-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.subscribe-popup-close:hover,
.subscribe-popup-close:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: var(--surface-1);
  outline: none;
}

@keyframes subscribeOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes subscribeModalIn {
  from { opacity: 0; transform: translateY(28px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes subscribeDrawerIn {
  from { opacity: 0.6; transform: translateY(100%); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .subscribe-popup-overlay.is-open,
  .subscribe-popup {
    animation: none;
  }
}

/* ---- Shared form vocabulary ---- */
.subscribe-eyebrow {
  margin: 0 0 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.subscribe-headline {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.05rem, 1.6vw, 1.35rem);
  line-height: 1.4;
  letter-spacing: -0.005em;
  color: var(--text-primary);
  text-wrap: balance;
}

.subscribe-deck {
  margin: 0 auto 22px;
  max-width: 460px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.subscribe-form {
  margin: 0;
  padding: 0;
}

.subscribe-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.subscribe-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.subscribe-input-row {
  display: flex;
  align-items: stretch;
  max-width: 460px;
  margin: 0 auto;
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.subscribe-input-row:focus-within {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.subscribe-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  outline: none;
}

.subscribe-input::placeholder {
  color: var(--text-tertiary);
  font-style: italic;
}

.subscribe-input:disabled {
  opacity: 0.6;
}

.subscribe-submit {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tab);
  background: var(--primary-color);
  border: 0;
  border-left: 1px solid var(--border-color);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}

.subscribe-submit:hover:not(:disabled),
.subscribe-submit:focus-visible:not(:disabled) {
  background: var(--accent-color);
  color: #000;
  outline: none;
}

.subscribe-submit:disabled {
  cursor: progress;
  opacity: 0.7;
}

.subscribe-submit-arrow {
  font-weight: 400;
  transition: transform 0.2s ease;
}

.subscribe-submit:hover:not(:disabled) .subscribe-submit-arrow {
  transform: translateX(3px);
}

.subscribe-status {
  min-height: 1.25em;
  margin: 14px 0 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}

.subscribe-status[data-state='loading'] {
  color: var(--text-secondary);
}

.subscribe-status[data-state='success'] {
  color: var(--positive-color);
}

.subscribe-status[data-state='error'] {
  color: var(--negative-color);
}

.subscribe-thank-you {
  text-align: center;
  padding: 8px 0 4px;
  animation: subscribeFadeIn 400ms ease-out both;
}

.subscribe-thank-you-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--positive-color);
  margin: 0 0 6px;
}

.subscribe-thank-you-note {
  font-size: 12px;
  color: var(--text-tertiary);
  margin: 0;
  letter-spacing: 0.03em;
}

/* ---- Inline post gate ---- */
.post-newsletter-gate {
  position: relative;
  margin: 30px 0 34px;
  background:
    linear-gradient(135deg, rgba(16, 185, 129, 0.08), transparent 42%),
    var(--card-bg);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-color);
  text-align: left;
  overflow: hidden;
}

.post-newsletter-gate[hidden],
.post-newsletter-gated-content[hidden] {
  display: none !important;
}

html[data-subscribed='true'] .post-newsletter-gate {
  display: none !important;
}

html[data-subscribed='true'] .post-newsletter-gated-content[hidden] {
  display: block !important;
}

.post-newsletter-gate-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 28px;
  align-items: center;
  padding: 28px 28px 24px;
}

.post-newsletter-gate-copy,
.post-newsletter-gate-action {
  min-width: 0;
}

.post-newsletter-gate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.post-newsletter-gate-eyebrow::after {
  content: '';
  display: block;
  width: 34px;
  height: 1px;
  background: var(--border-color);
}

.post-newsletter-gate-title {
  margin: 0 0 9px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.post-newsletter-gate-deck {
  max-width: 470px;
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

.post-newsletter-gate-action {
  padding-top: 2px;
}

.post-newsletter-gate .subscribe-input-row {
  max-width: none;
  margin: 0;
  background: var(--bg-color);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

[data-theme='dark'] .post-newsletter-gate .subscribe-input-row {
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.22);
}

.post-newsletter-gate .subscribe-input {
  padding: 13px 15px;
}

.post-newsletter-gate .subscribe-submit {
  min-height: 48px;
  padding: 0 16px;
}

.post-newsletter-gate .subscribe-status {
  min-height: 16px;
  margin-top: 9px;
  text-align: left;
}

.post-newsletter-gate-note {
  margin: 9px 0 0;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-tertiary);
}

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

.subscribe-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.subscribe-ornament::before,
.subscribe-ornament::after {
  content: '';
  display: block;
  height: 1px;
  width: 28px;
  background: var(--border-color);
}

.subscribe-ornament span {
  display: block;
  width: 5px;
  height: 5px;
  background: var(--accent-color);
  transform: rotate(45deg);
}

@media (max-width: 560px) {
  .subscribe-popup-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .subscribe-popup {
    max-width: none;
    padding: 36px 20px 28px;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    animation: subscribeDrawerIn 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .subscribe-input-row {
    flex-direction: column;
  }
  .subscribe-submit {
    justify-content: center;
    padding: 12px 18px;
    border-left: 0;
    border-top: 1px solid var(--border-color);
  }
  .post-newsletter-gate {
    margin: 26px 0 30px;
  }
  .post-newsletter-gate-inner {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 23px 18px 20px;
  }
  .post-newsletter-gate-title {
    font-size: 1.35rem;
  }
  .post-newsletter-gate-deck {
    font-size: 0.88rem;
  }
  .post-newsletter-gate .subscribe-submit {
    min-height: 44px;
  }
  .post-newsletter-gate-note,
  .post-newsletter-gate .subscribe-status {
    text-align: center;
  }
}

/* ============================================================
   Admin - /admin subscribers page (hidden, noindex).
   ============================================================ */
.admin-page {
  max-width: 780px;
}

.admin-gate {
  margin-top: 8px;
  padding: 20px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.admin-gate-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.admin-gate-row {
  display: flex;
  gap: 8px;
}

.admin-gate-input {
  flex: 1 1 auto;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  outline: none;
}

.admin-gate-input:focus {
  border-color: var(--primary-color);
}

.admin-gate-submit {
  padding: 10px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--primary-color);
  color: var(--text-tab);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  cursor: pointer;
}

.admin-gate-submit:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.admin-gate-status {
  margin: 10px 0 0;
  font-size: 0.85rem;
  min-height: 1.2em;
  color: var(--text-secondary);
}

.admin-gate-status[data-state='error'] {
  color: var(--negative-color);
}

.admin-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 0.9rem;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-lighter);
}

.admin-table thead th {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-color);
}

.admin-table tbody tr:last-child td {
  border-bottom: 0;
}

.admin-table tbody tr:hover {
  background: var(--hover-bg);
}

.admin-num {
  color: var(--text-tertiary);
  width: 3rem;
  font-variant-numeric: tabular-nums;
}

.admin-email {
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  word-break: break-all;
}

.admin-date {
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-empty {
  text-align: center;
  color: var(--text-secondary);
  padding: 32px 16px;
}

.admin-stuck {
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--negative-color);
  border-radius: 8px;
}

.admin-stuck-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.admin-stuck-title {
  font-size: 0.92rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.admin-stuck-count {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--negative-color);
  font-variant-numeric: tabular-nums;
}

.admin-stuck-sub {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.admin-stuck-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-stuck-item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-lighter);
  border-radius: 6px;
}

.admin-stuck-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.admin-stuck-email {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.86rem;
  color: var(--text-primary);
  word-break: break-all;
}

.admin-stuck-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.admin-stuck-badge[data-status='welcome_failed'] {
  color: var(--negative-color);
  border-color: var(--negative-color);
}

.admin-stuck-date {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.admin-stuck-resend {
  padding: 5px 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-stuck-resend:hover:not(:disabled) {
  color: var(--surface-1);
  background: var(--text-primary);
  border-color: var(--text-primary);
}

.admin-stuck-resend:disabled {
  opacity: 0.6;
  cursor: progress;
}

.admin-stuck-status {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: var(--text-tertiary);
  min-height: 1em;
}

.admin-stuck-status[data-state='ok'] {
  color: var(--positive-color, #2a8f4a);
}

.admin-stuck-status[data-state='error'] {
  color: var(--negative-color);
}

/* ============================================================
   Search popup
   ============================================================ */
.search-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 24px 24px;
  background: rgba(0, 0, 0, 0.55);
  overflow-y: auto;
}

@media (hover: hover) and (pointer: fine) {
  .search-popup-overlay {
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
}

[data-theme='light'] .search-popup-overlay {
  background: rgba(20, 20, 20, 0.42);
}

.search-popup-overlay.is-open {
  display: flex;
  animation: searchOverlayIn 220ms ease-out both;
}

.search-popup {
  position: relative;
  width: 100%;
  max-width: 640px;
  padding: 28px 26px 24px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  isolation: isolate;
  animation: searchModalIn 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.search-popup::before {
  content: '';
  position: absolute;
  inset: 6px;
  border: 1px solid var(--border-lighter);
  pointer-events: none;
  z-index: -1;
}

.search-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.search-popup-close:hover,
.search-popup-close:focus-visible {
  color: var(--text-primary);
  border-color: var(--border-color);
  background: var(--surface-1);
  outline: none;
}

.search-popup-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 14px;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.search-popup-form {
  position: relative;
  margin: 0 0 14px;
}

.search-popup-icon {
  position: absolute;
  top: 50%;
  left: 12px;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
  display: inline-flex;
}

.search-popup-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-popup-input::placeholder {
  color: var(--text-tertiary);
}

.search-popup-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.15);
}

.search-popup-status {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 10px;
}

/* Cover cards inside the narrow popup panel - slimmer plate column than
   the full-width lists, and the usual stacked banner on phones. */
.search-popup-results .data-card-post.has-cover {
  grid-template-columns: 132px 1fr;
}
.search-popup-results .data-card-post.has-cover .data-card-body {
  padding: 16px 18px 14px;
}
@media (max-width: 720px) {
  .search-popup-results .data-card-post.has-cover {
    grid-template-columns: 1fr;
  }
}

.search-popup-results {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 50vh;
  overflow-y: auto;
  margin: 0 -6px;
  padding: 2px 6px 4px;
}

.search-popup-tags {
  margin: 18px -6px 0;
  padding: 16px 6px 4px;
  border-top: 1px dashed var(--border-color);
}
.search-popup-tags[hidden] { display: none; }

.search-popup-tags-title {
  margin: 0 0 10px;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}

.search-popup-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 34vh;
  overflow-y: auto;
  padding-bottom: 2px;
}
.search-popup-tag-cloud .tag-chip {
  font-size: 10px;
  padding: 3px 9px;
}
.search-popup-tag-cloud .tag-chip .count {
  margin-left: 5px;
  color: var(--text-tertiary);
  font-weight: 500;
  opacity: 0.85;
}

.search-popup-locked {
  overflow: hidden;
}

@keyframes searchOverlayIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes searchModalIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .search-popup-overlay.is-open,
  .search-popup {
    animation: none;
  }
}

@media (max-width: 560px) {
  .search-popup-overlay {
    padding: 48px 12px 12px;
  }
  .search-popup {
    padding: 24px 18px 20px;
  }
}

/* ============================================================
   Post share - quiet editorial bar above the comments section.
   Same eyebrow + serif-italic title vocabulary as comments,
   icon-led pill buttons with hairline borders.
   ============================================================ */
.post-share {
  border-top: 1px solid var(--border-color);
}

.post-share-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 20px;
  text-align: center;
}

.post-share-header {
  margin-bottom: 24px;
}

.post-share-eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.post-share-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0;
}

.post-share-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.post-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.post-share-btn:hover,
.post-share-btn:focus-visible {
  color: var(--text-primary);
  border-color: var(--accent-color);
  outline: none;
  transform: translateY(-1px);
}

.post-share-btn:active {
  transform: none;
}

.post-share-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}

.post-share-icon svg {
  width: 100%;
  height: 100%;
}

.post-share-btn:hover .post-share-icon,
.post-share-btn:focus-visible .post-share-icon {
  color: var(--accent-color);
}

.post-share-copy[data-state='success'] {
  color: var(--positive-color);
  border-color: var(--positive-color);
}

.post-share-copy[data-state='success'] .post-share-icon {
  color: var(--positive-color);
}

.post-share-copy[data-state='error'] {
  color: var(--negative-color);
  border-color: var(--negative-color);
}

@media (max-width: 640px) {
  .post-share-inner {
    padding: 44px 20px 20px;
  }
  .post-share-actions {
    gap: 8px;
  }
  .post-share-btn {
    padding: 7px 12px;
    font-size: 10px;
  }
}

/* ============================================================
   Post engagement - like button + view counter, sits between
   the share bar and the comments section. Same hairline
   pill-button vocabulary as post-share.
   ============================================================ */
.post-engagement {
  border-top: 1px solid var(--border-color);
}

.post-engagement-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 24px 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.post-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.post-like-btn:hover:not(:disabled),
.post-like-btn:focus-visible:not(:disabled) {
  color: var(--text-primary);
  border-color: var(--accent-color);
  outline: none;
  transform: translateY(-1px);
}

.post-like-btn:active:not(:disabled) {
  transform: none;
}

.post-like-btn:disabled {
  cursor: default;
}

.post-like-icon {
  display: inline-flex;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  transition: color 0.2s ease, transform 0.2s ease;
}

.post-like-icon svg {
  width: 100%;
  height: 100%;
}

.post-like-btn:hover:not(:disabled) .post-like-icon {
  color: var(--negative-color, #d8536b);
}

.post-like-btn.is-liked,
.post-like-btn[aria-pressed='true'] {
  color: var(--text-primary);
  border-color: var(--negative-color, #d8536b);
  background: color-mix(in srgb, var(--negative-color, #d8536b) 10%, transparent);
}

.post-like-btn.is-liked .post-like-icon,
.post-like-btn[aria-pressed='true'] .post-like-icon {
  color: var(--negative-color, #d8536b);
  transform: scale(1.08);
}

.post-like-btn.is-liking .post-like-icon {
  animation: post-like-pulse 0.45s ease-out;
}

@keyframes post-like-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1.08); }
}

.post-like-count {
  font-variant-numeric: tabular-nums;
  min-width: 1ch;
}

@media (max-width: 640px) {
  .post-engagement-inner {
    padding: 28px 20px 24px;
    gap: 14px;
  }
  .post-like-btn {
    padding: 7px 14px;
    font-size: 11px;
  }
}

/* ============================================================
   Post related - "Read next"
   Sits between the article and share/comments. Same eyebrow +
   serif-italic deck vocabulary; cards are link-only with date,
   title, and a few tags inline.
   ============================================================ */
.post-related {
  border-top: 1px solid var(--border-color);
}

.post-related-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 56px 24px 20px;
}

.post-related-header {
  margin-bottom: 24px;
  text-align: center;
}

.post-related-eyebrow {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.post-related-deck {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0;
}

.post-related-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.post-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: transparent;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.post-related-card:hover,
.post-related-card:focus-visible {
  border-color: var(--accent-color);
  transform: translateY(-1px);
  outline: none;
}

.post-related-card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.post-related-card-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.3;
  color: var(--text-primary);
  letter-spacing: -0.005em;
}

.post-related-card:hover .post-related-card-title,
.post-related-card:focus-visible .post-related-card-title {
  color: var(--accent-color);
}

.post-related-card-tags {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}

.post-related-tag-sep {
  color: var(--text-tertiary);
  opacity: 0.5;
}

@media (max-width: 640px) {
  .post-related-inner {
    padding: 44px 20px 20px;
  }
  .post-related-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .post-related-card {
    padding: 14px 16px;
  }
}

/* ============================================================
   Post comments - "Discussion"
   Editorial marginalia: sharp rules, open writing surface,
   square monograms, and no radius or elevation.
   ============================================================ */
.comments {
  border-top: 1px solid var(--border-color);
}

.comments-inner {
  max-width: 820px;
  margin: 0 auto;
  padding: 72px 24px 88px;
}

/* ---- Header ---- */
.comments-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  align-items: end;
  gap: 48px;
  margin-bottom: 36px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--text-primary);
}

.comments-heading {
  min-width: 0;
}

.comments-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-color);
}

.comments-eyebrow span {
  min-width: 24px;
  padding-right: 10px;
  border-right: 1px solid var(--border-color);
  color: var(--text-tertiary);
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-weight: 500;
  letter-spacing: 0.08em;
}

.comments-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3.1rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  margin: 0;
}

.comments-deck {
  margin: 0;
  padding-left: 16px;
  border-left: 2px solid var(--accent-color);
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
  text-wrap: pretty;
}

/* ---- Form ---- */
.comments-form {
  position: relative;
  padding: 28px 0 0;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
}

.comments-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 52px;
  height: 2px;
  background: var(--accent-color);
}

.comments-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  margin-bottom: 30px;
}

.comments-field {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
}

.comments-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.comments-field:focus-within .comments-label {
  color: var(--accent-color);
}

.comments-label span[aria-hidden='true'] {
  color: var(--accent-color);
}

.comments-optional {
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: none;
  opacity: 0.7;
}

/* Bottom-border-only inputs - clean, editorial */
.comments-input,
.comments-textarea {
  width: 100%;
  padding: 10px 0 12px;
  font-family: inherit;
  font-size: 0.94rem;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border-color);
  border-radius: 0;
  transition: border-color 0.18s ease;
  outline: none;
  box-shadow: none;
}

.comments-textarea {
  resize: none;
  min-height: 128px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 1rem;
  line-height: 1.75;
}

.comments-input::placeholder,
.comments-textarea::placeholder {
  color: var(--text-tertiary);
  opacity: 0.55;
}

.comments-input:focus,
.comments-textarea:focus {
  border-bottom-color: var(--accent-color);
  box-shadow: none;
}

.comments-input:disabled,
.comments-textarea:disabled {
  opacity: 0.45;
  cursor: progress;
}

.comments-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.comments-turnstile {
  margin-top: 20px;
  display: flex;
  justify-content: flex-start;
  min-height: 65px;
}

.comments-turnstile .cf-turnstile iframe {
  max-width: 100%;
}

.comments-form-foot {
  margin-top: 20px;
  padding-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

/* ---- Status messages ---- */
.comments-status {
  margin: 0;
  min-height: 1.2em;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: transparent;
  transition: color 0.2s ease;
}

.comments-status[data-state='loading'] { color: var(--text-tertiary); }
.comments-status[data-state='success'] { color: var(--positive-color); }
.comments-status[data-state='error']   { color: var(--negative-color); }

/* ---- Submit button ---- */
.comments-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0 11px 18px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-primary);
  background: transparent;
  border: 0;
  border-left: 1px solid var(--border-color);
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.comments-submit:hover:not(:disabled),
.comments-submit:focus-visible:not(:disabled) {
  color: var(--accent-color);
  border-color: var(--accent-color);
  outline: 1px solid transparent;
  outline-offset: 4px;
}

.comments-submit:disabled {
  cursor: progress;
  opacity: 0.45;
  transform: none;
}

.comments-submit-arrow {
  font-weight: 300;
  font-size: 1rem;
  line-height: 1;
  transition: transform 0.2s ease;
  opacity: 0.8;
}

.comments-submit:hover:not(:disabled) .comments-submit-arrow {
  transform: translateX(4px);
  opacity: 1;
}

/* Reader-notes index */
.comments-list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 56px 0 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--text-primary);
}

.comments-list-label,
.comments-count {
  margin: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.comments-list-label {
  color: var(--text-primary);
}

.comments-count {
  color: var(--text-tertiary);
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-weight: 500;
  letter-spacing: 0.08em;
}

/* ---- List ---- */
.comments-list-wrap {
  margin-top: 0;
}

.comments-list-status {
  margin: 0;
  padding: 30px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  text-align: left;
}

.comments-list-status[data-state='error'] {
  color: var(--negative-color);
}

.comments-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

/* Open layout - hairline separators, no card boxes */
.comments-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 18px;
  padding: 24px 0 26px;
  border-bottom: 1px solid var(--border-color);
  background: none;
  border-left: none;
  box-shadow: none;
}

/* Square monogram, like an editorial proof mark */
.comments-avatar {
  width: 40px;
  height: 40px;
  border-radius: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-color);
  border-bottom-color: var(--accent-color);
  color: var(--accent-color);
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
  user-select: none;
  flex-shrink: 0;
  overflow: hidden;
}

.comments-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.comments-item.is-author > .comments-avatar,
.comments-item--reply.is-author .comments-avatar {
  background: transparent;
  border-color: var(--accent-color);
  padding: 0;
}

.comments-body {
  min-width: 0;
  padding-top: 2px;
}

.comments-byline {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.comments-author {
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text-primary);
  letter-spacing: 0;
}

.comments-time {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.comments-text {
  margin: 0;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-secondary);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.comments-text a {
  color: var(--accent-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.comments-text a:hover {
  border-bottom-color: currentColor;
}

/* ---- Reply banner (above textarea when replying) ---- */
.comments-reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 16px;
  background: rgba(16, 185, 129, 0.07);
  border-left: 2px solid var(--accent-color);
  border-radius: 0;
  box-shadow: none;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.comments-reply-banner strong {
  color: var(--text-primary);
  font-weight: 600;
}

.comments-reply-banner-cancel {
  background: none;
  border: none;
  color: var(--text-tertiary);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.comments-reply-banner-cancel:hover {
  color: var(--text-primary);
}

/* ---- Reply button on each comment ---- */
.comments-reply-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  cursor: pointer;
  margin-left: auto;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease;
}

.comments-reply-btn:hover {
  color: var(--accent-color);
  border-bottom-color: currentColor;
}

/* ---- Nested replies ---- */
.comments-replies {
  list-style: none;
  margin: 0;
  padding: 0 0 0 58px;
  display: flex;
  flex-direction: column;
}

.comments-item--reply {
  grid-template-columns: 30px 1fr;
  gap: 14px;
  padding: 18px 0 20px;
  border-bottom: none;
  border-top: 1px solid var(--border-lighter);
  border-left: none;
  box-shadow: none;
  background: none;
}

.comments-item--reply:first-child {
  border-top: 1px solid var(--border-lighter);
}

.comments-item--reply .comments-avatar {
  width: 30px;
  height: 30px;
  font-size: 9px;
  background: var(--surface-2);
  border-color: var(--border-light);
  color: var(--text-tertiary);
}

/* ---- "Liked by author" badge ---- */
.comments-liked {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e0245e;
  background: transparent;
  border: 0;
  border-bottom: 1px solid currentColor;
  border-radius: 0;
  box-shadow: none;
  line-height: 1;
}

.comments-liked-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
}

.comments-liked-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================
   Mobile - comments
   ============================================================ */
@media (max-width: 640px) {
  .comments-inner {
    padding: 52px 20px 68px;
  }
  .comments-header {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 20px;
    margin-bottom: 30px;
  }
  .comments-title {
    font-size: clamp(2.15rem, 12vw, 2.8rem);
  }
  .comments-deck {
    max-width: 34rem;
  }
  .comments-form {
    padding: 26px 0 0;
  }
  .comments-field-row {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .comments-form-foot {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 12px;
  }
  .comments-submit {
    justify-content: center;
    width: auto;
    align-self: flex-end;
  }
  .comments-status {
    text-align: center;
  }
  .comments-list-head {
    margin-top: 44px;
  }
  .comments-item {
    grid-template-columns: 34px 1fr;
    gap: 12px;
    padding: 20px 0 22px;
  }
  .comments-avatar {
    width: 34px;
    height: 34px;
    font-size: 10px;
  }
  .comments-replies {
    padding-left: 46px;
  }
  .comments-item--reply {
    grid-template-columns: 26px 1fr;
    gap: 10px;
  }
  .comments-item--reply .comments-avatar {
    width: 26px;
    height: 26px;
    font-size: 9px;
  }
}

/* ============================================================
   Admin - tabs, comments panel, delete controls.
   Extends the subscribers-era admin styles above.
   ============================================================ */
.admin-shell {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.admin-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0;
  flex-wrap: wrap;
}

.admin-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: -1px;
  background: transparent;
  border: 1px solid transparent;
  border-bottom: 0;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.admin-tab:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.admin-tab.is-active {
  color: var(--text-primary);
  background: var(--bg-color);
  border-color: var(--border-color);
  border-bottom: 1px solid var(--bg-color);
}

.admin-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 18px;
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  font-variant-numeric: tabular-nums;
}

.admin-tab.is-active .admin-tab-count {
  color: var(--text-primary);
  background: var(--primary-light-bg);
  border-color: var(--border-color);
}

.admin-logout {
  margin-left: auto;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-logout:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: var(--hover-bg);
}

.admin-panel {
  display: none;
}

.admin-panel.is-active {
  display: block;
}

.admin-table-wrap {
  overflow-x: auto;
}

/* Engagement admin tab */
.admin-engagement-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.admin-engagement-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-right: 4px;
}

.admin-engagement-sort {
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding: 6px 12px;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.admin-engagement-sort:hover {
  color: var(--text-primary);
  border-color: var(--accent-color);
}

.admin-engagement-sort.is-active {
  color: var(--text-primary);
  border-color: var(--accent-color);
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
}

.admin-engagement-totals {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

.admin-engagement-post {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.admin-engagement-post a {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 600;
}

.admin-engagement-post a:hover {
  color: var(--accent-color);
}

.admin-engagement-slug {
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  font-size: 10px;
  color: var(--text-tertiary);
}

.admin-num-col {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .admin-engagement-totals {
    margin-left: 0;
    width: 100%;
  }
}

/* Page-views chart in the Engagement tab */
.admin-views-chart {
  margin: 0 0 20px;
  padding: 16px 18px 14px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.admin-views-chart-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 14px;
}

.admin-views-chart-eyebrow {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.admin-views-chart-title {
  margin: 2px 0 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.admin-views-range {
  display: inline-flex;
  background: var(--surface-2, var(--surface-1));
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px;
}

.admin-views-range-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary, var(--text-tertiary));
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.admin-views-range-btn:hover {
  color: var(--text-primary);
}

.admin-views-range-btn.is-active {
  background: var(--accent-color);
  color: var(--accent-contrast, #fff);
}

.admin-views-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

.admin-views-stat {
  background: var(--surface-2, var(--surface-1));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.admin-views-stat-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-tertiary);
}

.admin-views-stat-value {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.admin-views-stat-value--sm {
  font-size: 0.9rem;
  font-weight: 600;
}

.admin-views-stat-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.admin-views-stat-delta {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}

.admin-views-stat-delta[data-state="up"] {
  color: var(--success-color, #2fa34b);
}

.admin-views-stat-delta[data-state="down"] {
  color: var(--danger-color, #d6536d);
}

.admin-views-chart-body {
  position: relative;
  width: 100%;
}

.admin-views-svg {
  display: block;
  width: 100%;
  height: 200px;
  overflow: visible;
}

.admin-views-bar rect {
  fill: url(#admin-views-grad);
  opacity: 0.85;
  transition: opacity 0.15s ease, filter 0.15s ease;
}

.admin-views-bar.is-weekend rect {
  opacity: 0.55;
}

.admin-views-bar.is-today rect {
  filter: drop-shadow(0 0 0 var(--accent-color));
  stroke: var(--accent-color);
  stroke-width: 1;
}

.admin-views-bar.is-peak rect {
  opacity: 1;
}

.admin-views-bar:hover rect,
.admin-views-bar.is-active rect {
  opacity: 1;
  filter: brightness(1.15);
}

.admin-views-grad-top {
  stop-color: var(--accent-color);
  stop-opacity: 1;
}

.admin-views-grad-bottom {
  stop-color: var(--accent-color);
  stop-opacity: 0.55;
}

.admin-views-grid {
  stroke: var(--border-lighter, var(--border-color));
  stroke-width: 1;
  stroke-dasharray: 2 4;
  opacity: 0.55;
}

.admin-views-avg {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 4 4;
  opacity: 0.55;
}

.admin-views-avg-label {
  fill: var(--text-tertiary);
  font-size: 9px;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
}

.admin-views-guide {
  stroke: var(--text-secondary, var(--text-tertiary));
  stroke-width: 1;
  stroke-dasharray: 2 3;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.admin-views-ytick,
.admin-views-xtick {
  fill: var(--text-tertiary);
  font-size: 10px;
  font-family: 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

.admin-views-chart-empty {
  padding: 32px 8px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.admin-views-chart-tooltip {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 5;
  min-width: 140px;
  max-width: 220px;
  background: var(--surface-2, var(--surface-1));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  color: var(--text-primary);
}

.admin-views-tt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.admin-views-tt-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, var(--text-tertiary));
  letter-spacing: 0.02em;
}

.admin-views-tt-pill {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--border-lighter, var(--border-color));
  color: var(--text-tertiary);
}

.admin-views-tt-value {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.2;
}

.admin-views-tt-unit {
  font-size: 11px;
  font-weight: 500;
  margin-left: 4px;
  color: var(--text-tertiary);
}

.admin-views-tt-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.admin-views-chart-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
  font-size: 11px;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.admin-views-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.admin-views-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  background: var(--accent-color);
  display: inline-block;
}

.admin-views-legend-swatch--weekend {
  background: var(--accent-color);
  opacity: 0.5;
}

.admin-views-legend-swatch--avg {
  height: 0;
  border-top: 2px dashed var(--text-tertiary);
  background: transparent;
  width: 14px;
  border-radius: 0;
}

@media (max-width: 640px) {
  .admin-views-chart-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .admin-views-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-views-svg {
    height: 170px;
  }
  .admin-views-chart-tooltip {
    min-width: 120px;
  }
}

/* Comments admin layout */
.admin-comments {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.admin-comment-group {
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.admin-comment-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-color);
}

.admin-comment-slug {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.82rem;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1px;
  transition: color 0.15s ease, border-color 0.15s ease;
  word-break: break-all;
}

.admin-comment-slug:hover {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.admin-comment-group-count {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  white-space: nowrap;
}

.admin-comment-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.admin-comment {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-lighter);
}

.admin-comment:last-child {
  border-bottom: 0;
}

.admin-comment-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.admin-comment-author {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.admin-comment-email {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-family: 'Inter', system-ui, sans-serif;
  word-break: break-all;
}

.admin-comment-time {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}

.admin-comment-delete,
.admin-row-delete {
  padding: 5px 10px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--negative-color);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-comment-delete:hover:not(:disabled),
.admin-row-delete:hover:not(:disabled) {
  color: #fff;
  background: var(--negative-color);
  border-color: var(--negative-color);
}

.admin-comment-delete:disabled,
.admin-row-delete:disabled {
  opacity: 0.6;
  cursor: progress;
}

.admin-comment-like {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.admin-comment-like .admin-comment-like-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
}

.admin-comment-like .admin-comment-like-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.admin-comment-like:hover:not(:disabled) {
  color: #e0245e;
  border-color: rgba(224, 36, 94, 0.5);
}

.admin-comment-like[aria-pressed='true'] {
  color: #e0245e;
  border-color: rgba(224, 36, 94, 0.45);
  background: rgba(224, 36, 94, 0.09);
}

.admin-comment-like:disabled {
  opacity: 0.6;
  cursor: progress;
}

.admin-actions {
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.admin-actions-col {
  width: 1%;
}

.admin-comment-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Newsletter tab */
.admin-newsletter {
  padding: 4px 0;
}

.admin-nl-analytics {
  --nl-open-color: #17835c;
  --nl-click-color: #3f68c5;
  margin-bottom: 34px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
}

[data-theme='dark'] .admin-nl-analytics {
  --nl-open-color: #4fc493;
  --nl-click-color: #7ea2f2;
}

.admin-nl-analytics-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.admin-nl-analytics-head .admin-nl-label {
  margin-bottom: 4px;
}

.admin-nl-analytics-title {
  margin: 0;
  color: var(--text-primary);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.admin-nl-analytics-note {
  max-width: 430px;
  margin: 0;
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.5;
  text-align: right;
}

.admin-nl-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
}

.admin-nl-metric {
  padding: 15px 17px;
  background: var(--surface-1);
}

.admin-nl-metric + .admin-nl-metric {
  border-left: 1px solid var(--border-color);
}

.admin-nl-metric-label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nl-metric-value {
  display: block;
  color: var(--text-primary);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.55rem;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.admin-nl-metric-value--open {
  color: var(--nl-open-color);
}

.admin-nl-metric-value--click {
  color: var(--nl-click-color);
}

.admin-nl-metric-sub {
  display: block;
  min-height: 1.35em;
  margin-top: 6px;
  color: var(--text-secondary);
  font-size: 10px;
  line-height: 1.35;
}

.admin-nl-chart {
  margin: 16px 0 24px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--surface-1);
  overflow: hidden;
}

.admin-nl-chart-head,
.admin-nl-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.admin-nl-chart-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  background: var(--surface-2);
}

.admin-nl-chart-eyebrow {
  display: block;
  margin-bottom: 2px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.admin-nl-chart-title {
  display: block;
  color: var(--text-primary);
  font-size: 12.5px;
  line-height: 1.35;
}

.admin-nl-chart-legend {
  display: flex;
  gap: 14px;
  color: var(--text-secondary);
  font-size: 10px;
}

.admin-nl-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.admin-nl-legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.admin-nl-legend-dot--open {
  color: var(--nl-open-color);
}

.admin-nl-legend-dot--click {
  color: var(--nl-click-color);
}

.admin-nl-chart-body {
  display: grid;
}

.admin-nl-chart-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(280px, 1.4fr);
  gap: 24px;
  align-items: center;
  padding: 13px 16px;
}

.admin-nl-chart-row + .admin-nl-chart-row {
  border-top: 1px solid var(--border-lighter);
}

.admin-nl-chart-meta {
  min-width: 0;
}

.admin-nl-chart-meta strong,
.admin-nl-chart-meta span {
  display: block;
}

.admin-nl-chart-meta strong {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 11.5px;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nl-chart-meta span {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 9.5px;
}

.admin-nl-chart-series {
  display: grid;
  gap: 5px;
}

.admin-nl-chart-line {
  display: grid;
  grid-template-columns: 35px minmax(80px, 1fr) 42px;
  gap: 8px;
  align-items: center;
}

.admin-nl-chart-series-label {
  color: var(--text-secondary);
  font-size: 9px;
  text-transform: uppercase;
}

.admin-nl-chart-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}

.admin-nl-chart-bar {
  display: block;
  height: 100%;
  border-radius: inherit;
  transition: width 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .admin-nl-chart-bar {
    transition: none;
  }
}

.admin-nl-chart-bar--open {
  background: var(--nl-open-color);
}

.admin-nl-chart-bar--click {
  background: var(--nl-click-color);
}

.admin-nl-chart-line strong {
  color: var(--text-primary);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.admin-nl-chart-empty {
  margin: 0;
  padding: 28px 16px;
  color: var(--text-secondary);
  font-size: 12px;
  text-align: center;
}

.admin-nl-history-head {
  margin-bottom: 10px;
}

.admin-nl-history-caption {
  color: var(--text-secondary);
  font-size: 10px;
}

.admin-nl-history-wrap {
  border-radius: 8px;
}

.admin-nl-history .admin-num-col strong,
.admin-nl-history .admin-num-col span {
  display: block;
}

.admin-nl-history .admin-num-col span {
  margin-top: 2px;
  color: var(--text-secondary);
  font-size: 10px;
}

.admin-nl-history-subject,
.admin-nl-history-date {
  display: block;
}

.admin-nl-history-subject {
  max-width: 460px;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-nl-history-date {
  margin-top: 3px;
  color: var(--text-secondary);
  font-size: 10px;
}

.admin-nl-compose-head {
  margin-bottom: 18px;
}

.admin-nl-compose-head .admin-nl-label {
  margin-bottom: 4px;
}

.admin-nl-field {
  margin-bottom: 24px;
}

.admin-nl-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.admin-nl-label-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.admin-nl-label-row .admin-nl-label {
  margin-bottom: 0;
}

.admin-nl-toggle-all {
  background: none;
  border: none;
  padding: 0;
  font-size: 11px;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.admin-nl-toggle-all:hover {
  color: var(--text-primary);
}

.admin-nl-input {
  width: 100%;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  padding: 9px 12px;
  outline: none;
  transition: border-color 0.15s;
}

.admin-nl-input:focus {
  border-color: var(--text-secondary);
}

.admin-nl-posts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 4px;
}

.admin-nl-post {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.1s;
  line-height: 1.4;
}

.admin-nl-post:hover {
  background: var(--hover-bg);
}

.admin-nl-checkbox {
  flex-shrink: 0;
  accent-color: var(--text-primary);
  margin-top: 1px;
}

.admin-nl-post-date {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.admin-nl-post-title {
  font-size: 13px;
  color: var(--text-primary);
}

.admin-nl-actions {
  margin-bottom: 14px;
}


.admin-nl-status {
  font-size: 13px;
  min-height: 20px;
  color: var(--text-secondary);
}

.admin-nl-status[data-state="error"] {
  color: #e05c5c;
}

.admin-nl-status[data-state="ok"] {
  color: #5cb85c;
}

/* Newsletter preview modal */
.nl-preview-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 100;
}

@media (hover: hover) and (pointer: fine) {
  .nl-preview-backdrop {
    backdrop-filter: blur(2px);
  }
}

.nl-preview-dialog {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0; /* override UA dialog margin: auto */
  z-index: 101;
  width: min(760px, 96vw);
  height: min(680px, 92vh);
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--card-shadow-hover);
}

.nl-preview-dialog[hidden] { display: none; }
.nl-preview-dialog::backdrop { display: none; }

.nl-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.nl-preview-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.nl-preview-meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.nl-preview-subject {
  font-size: 13px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nl-preview-close {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 3px;
  flex-shrink: 0;
}

.nl-preview-close:hover { color: var(--text-primary); }

.nl-preview-body {
  flex: 1;
  overflow: hidden;
  background: #f2f2f2;
}

.nl-preview-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.nl-preview-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.nl-preview-recipients {
  font-size: 12px;
  color: var(--text-secondary);
}

.nl-preview-footer-actions {
  display: flex;
  gap: 8px;
}

.nl-preview-cancel {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
}

.nl-preview-cancel:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.nl-preview-send {
  background: var(--primary-color);
  color: var(--text-tab);
  border: 1px solid var(--primary-color);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.nl-preview-send:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.nl-preview-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-nl-preview {
  background: var(--primary-color);
  color: var(--text-tab);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 22px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.admin-nl-preview:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.admin-nl-preview:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Newsletter test section */
.admin-nl-test {
  margin-top: 32px;
  padding: 18px 20px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}

.admin-nl-test-head {
  margin-bottom: 14px;
}

.admin-nl-test-title {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.admin-nl-test-sub {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.admin-nl-test-recipient {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  padding: 1px 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: 3px;
  color: var(--text-primary);
}

.admin-nl-test-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.admin-nl-test-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.05s;
}

.admin-nl-test-btn:hover:not(:disabled) {
  border-color: var(--text-secondary);
  background: var(--hover-bg);
}

.admin-nl-test-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.admin-nl-test-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.admin-nl-test-btn-label {
  font-size: 13px;
  font-weight: 600;
}

.admin-nl-test-btn-hint {
  font-size: 11px;
  color: var(--text-secondary);
}

.admin-nl-test-status {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  min-height: 18px;
}

.admin-nl-test-status[data-state="error"] { color: #e05c5c; }
.admin-nl-test-status[data-state="ok"] { color: #5cb85c; }

@media (max-width: 640px) {
  .admin-nl-analytics-head {
    display: block;
  }

  .admin-nl-analytics-note {
    margin-top: 8px;
    text-align: left;
  }

  .admin-nl-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-nl-metric + .admin-nl-metric {
    border-left: 1px solid var(--border-color);
  }

  .admin-nl-metric:nth-child(3) {
    border-top: 1px solid var(--border-color);
    border-left: 0;
  }

  .admin-nl-metric:nth-child(4) {
    border-top: 1px solid var(--border-color);
  }

  .admin-nl-chart-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .admin-nl-history-caption {
    display: none;
  }

  .admin-tab {
    padding: 8px 12px;
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .admin-logout {
    margin-left: 0;
  }
  .admin-comment-time {
    margin-left: 0;
  }
}

/* Admin visual refresh */
.admin-page {
  max-width: 1080px;
  padding-top: 36px;
}

.admin-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-color);
}

.admin-eyebrow,
.admin-stat-label,
.admin-panel-subtitle,
.admin-stat-note {
  color: var(--text-secondary);
}

.admin-eyebrow {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.admin-title {
  font-size: clamp(2.25rem, 5vw, 4.15rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.admin-subtitle {
  max-width: 720px;
  margin-bottom: 0;
  font-size: 0.94rem;
}

.admin-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--surface-1);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: var(--card-shadow);
}

.admin-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-color) 16%, transparent);
}

.admin-gate {
  max-width: 560px;
  padding: 24px;
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.admin-gate-row {
  gap: 10px;
}

.admin-gate-input,
.admin-nl-input {
  min-height: 44px;
  border-radius: 7px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.admin-gate-input:focus,
.admin-nl-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color) 16%, transparent);
}

.admin-gate-submit,
.admin-nl-preview,
.nl-preview-send {
  border-radius: 7px;
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-color);
}

.admin-gate-submit:hover,
.admin-nl-preview:hover:not(:disabled),
.nl-preview-send:hover:not(:disabled) {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.admin-shell {
  gap: 22px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.admin-stat-card {
  position: relative;
  min-height: 138px;
  padding: 18px 18px 16px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

.admin-stat-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-color), #c9a961 48%, var(--text-primary));
}

.admin-stat-label {
  display: block;
  margin-bottom: 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.admin-stat-value {
  display: block;
  min-height: 48px;
  color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.admin-stat-note {
  display: block;
  margin-top: 10px;
  font-size: 0.8rem;
}

.admin-tabs {
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--surface-1);
  box-shadow: var(--card-shadow);
}

.admin-tab {
  min-height: 38px;
  margin-bottom: 0;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  letter-spacing: 0.08em;
}

.admin-tab:hover {
  background: var(--hover-bg);
}

.admin-tab.is-active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-color);
}

.admin-tab-count {
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary) 7%, transparent);
}

.admin-tab.is-active .admin-tab-count {
  color: var(--text-primary);
  background: var(--bg-color);
  border-color: transparent;
}

.admin-logout {
  min-height: 38px;
  border-radius: 7px;
}

.admin-panel {
  padding: 22px;
  background: var(--surface-1);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}

.admin-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.admin-panel-head--split {
  align-items: flex-end;
}

.admin-panel-title {
  margin: 0 0 5px;
  color: var(--text-primary);
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.45rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.admin-panel-subtitle {
  margin: 0;
  max-width: 560px;
  font-size: 0.86rem;
  line-height: 1.55;
}

.admin-table {
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  box-shadow: none;
}

.admin-table th,
.admin-table td {
  padding: 13px 16px;
}

.admin-table thead th {
  background: var(--surface-2);
}

.admin-table tbody tr {
  transition: background 0.12s ease;
}

.admin-table tbody tr:hover {
  background: color-mix(in srgb, var(--accent-color) 7%, transparent);
}

.admin-email,
.admin-engagement-post a,
.admin-comment-author {
  letter-spacing: 0;
}

.admin-stuck {
  border-left: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--negative-color) 5%, var(--surface-1));
  box-shadow: none;
}

.admin-stuck-item,
.admin-comment-group,
.admin-nl-posts {
  border-radius: 8px;
}

.admin-stuck-resend,
.admin-comment-delete,
.admin-row-delete,
.admin-comment-like,
.admin-engagement-sort,
.nl-preview-cancel {
  border-radius: 999px;
}

.admin-engagement-controls {
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 0;
}

.admin-engagement-totals {
  flex-basis: 100%;
  margin-left: 0;
  text-align: right;
}

.admin-comments {
  gap: 16px;
}

.admin-comment-group {
  box-shadow: none;
}

.admin-comment-group-head {
  padding: 12px 16px;
}

.admin-comment {
  padding: 16px;
}

.admin-comment-text {
  color: var(--text-secondary);
}

.admin-newsletter {
  padding: 0;
}

.admin-nl-posts {
  max-height: 420px;
  padding: 8px;
}

.admin-nl-post {
  border-radius: 6px;
  padding: 10px 12px;
}

.admin-nl-post:has(.admin-nl-checkbox:checked) {
  background: color-mix(in srgb, var(--accent-color) 10%, transparent);
}

.nl-preview-dialog {
  border-radius: 8px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

.admin-tab-count.is-loading,
.admin-stat-value.is-loading,
.admin-skeleton-line,
.admin-skeleton-pill {
  position: relative;
  overflow: hidden;
  color: transparent;
  background: var(--surface-3);
}

.admin-tab-count.is-loading {
  min-width: 28px;
}

.admin-stat-value.is-loading {
  width: 88px;
  height: 44px;
  min-height: 44px;
  border-radius: 7px;
}

.admin-skeleton-line,
.admin-skeleton-pill {
  display: block;
  height: 12px;
  border-radius: 999px;
}

.admin-skeleton-line {
  width: min(100%, 220px);
}

.admin-skeleton-line--0 {
  width: 64px;
}

.admin-skeleton-line--1 {
  width: 132px;
}

.admin-skeleton-line--2 {
  width: min(100%, 280px);
}

.admin-skeleton-pill {
  width: 72px;
  height: 22px;
}

.admin-comment-text .admin-skeleton-line + .admin-skeleton-line {
  margin-top: 8px;
}

.admin-tab-count.is-loading::after,
.admin-stat-value.is-loading::after,
.admin-skeleton-line::after,
.admin-skeleton-pill::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--bg-color) 56%, transparent),
    transparent
  );
  animation: admin-skeleton-shimmer 1.35s ease-in-out infinite;
}

@keyframes admin-skeleton-shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .admin-tab-count.is-loading::after,
  .admin-stat-value.is-loading::after,
  .admin-skeleton-line::after,
  .admin-skeleton-pill::after {
    animation: none;
  }
}

@media (max-width: 820px) {
  .admin-page {
    padding-inline: 16px;
  }

  .admin-hero,
  .admin-panel-head,
  .admin-panel-head--split {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-hero-badge {
    align-self: flex-start;
  }

  .admin-stats {
    grid-template-columns: 1fr;
  }

  .admin-panel {
    padding: 16px;
  }

  .admin-engagement-controls {
    justify-content: flex-start;
  }

  .admin-engagement-totals {
    text-align: left;
  }
}

@media (max-width: 560px) {
  .admin-title {
    font-size: 2.35rem;
  }

  .admin-gate-row {
    flex-direction: column;
  }

  .admin-tabs {
    align-items: stretch;
  }

  .admin-tab,
  .admin-logout {
    flex: 1 1 auto;
    justify-content: center;
  }

  .admin-logout {
    width: 100%;
  }

  .admin-comment-head {
    align-items: flex-start;
  }
}

/* ============================================================
   About - Contact form
   A quiet form below the shelf for sending a private note.
   Mirrors the comments form aesthetic (shared brass accent,
   monospace status line, serif labels) without re-using its
   class names so the layouts can drift independently.
   ============================================================ */
.contact {
  margin: 8px auto 28px;
  padding: 28px 0 8px;
  border-top: 1px solid var(--border-color);
}

.contact-header {
  text-align: center;
  margin-bottom: 22px;
}

.contact-eyebrow {
  margin: 0 0 8px;
  font-family: 'Be Vietnam Pro', 'Andada Pro', sans-serif;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.contact-title {
  margin: 0 0 10px;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.contact-deck {
  margin: 0 auto;
  max-width: 520px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text-secondary);
  text-wrap: balance;
}

.contact-form {
  margin: 0 auto;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.contact-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.contact-label {
  font-family: 'Be Vietnam Pro', 'Andada Pro', sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.contact-optional {
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: none;
  font-style: italic;
  color: var(--text-tertiary);
  margin-left: 4px;
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.contact-textarea {
  resize: vertical;
  min-height: 140px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
}

.contact-input:focus,
.contact-textarea:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.contact-input:disabled,
.contact-textarea:disabled {
  opacity: 0.45;
  cursor: progress;
}

.contact-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.contact-turnstile {
  margin-top: 4px;
  display: flex;
  justify-content: flex-start;
  min-height: 65px;
}

.contact-turnstile .cf-turnstile iframe {
  max-width: 100%;
}

.contact-form-foot {
  margin-top: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.contact-status {
  margin: 0;
  min-height: 1.2em;
  font-family: 'Be Vietnam Pro', 'Andada Pro', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: transparent;
  transition: color 0.2s ease;
}

.contact-status[data-state='loading'] { color: var(--text-tertiary); }
.contact-status[data-state='success'] { color: var(--positive-color); }
.contact-status[data-state='error']   { color: var(--negative-color); }

.contact-submit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tab);
  background: var(--primary-color);
  border: 1px solid var(--border-color);
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.contact-submit:hover:not(:disabled),
.contact-submit:focus-visible:not(:disabled) {
  background: var(--accent-color);
  color: #000;
  outline: none;
}

.contact-submit:disabled {
  cursor: progress;
  opacity: 0.7;
}

.contact-submit-arrow {
  font-weight: 400;
  transition: transform 0.2s ease;
}

.contact-submit:hover:not(:disabled) .contact-submit-arrow {
  transform: translateX(3px);
}

.contact-thank-you {
  margin: 0 auto;
  max-width: 560px;
  text-align: center;
  padding: 20px 0 4px;
  animation: contactFadeIn 400ms ease-out both;
}

.contact-thank-you-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--positive-color);
  margin: 0 0 8px;
}

.contact-thank-you-note {
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.6;
}

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

@media (max-width: 560px) {
  .contact-form-foot {
    justify-content: flex-start;
  }
  .contact-submit {
    width: 100%;
    justify-content: center;
  }
}


/* ============================================================
   SGD Rate page - /sgd/
   Visualisation of USDT/VND, XSGD/USDT, SGDVND official (Wise)
   and SGDVND parallel (crypto route).
   ============================================================ */
.sgd-page {
  --sgd-line-wise:   #c33;
  --sgd-line-crypto: #2d7d32;
  --sgd-line-usdt:   #a88440;
  --sgd-line-xsgd:   #4f6dff;
  --vnd-line-overnight: #2a78d6;
  --sgd-grid-color:  var(--border-light);
  --vnd-chapter-rates:    #a8783a;
  --vnd-chapter-growth:   #3a6ea8;
  --vnd-chapter-fx:       #1f8f7a;
  --vnd-chapter-reserves: #7a5cb8;
  max-width: 980px;
}
[data-theme='dark'] .sgd-page {
  --sgd-line-wise:   #f06868;
  --sgd-line-crypto: #4caf50;
  --sgd-line-usdt:   #c9a961;
  --sgd-line-xsgd:   #7d92ff;
  --vnd-line-overnight: #3987e5;
  --vnd-chapter-rates:    #d9a655;
  --vnd-chapter-growth:   #6c9bdb;
  --vnd-chapter-fx:       #3fbaa2;
  --vnd-chapter-reserves: #a481dd;
}

.sgd-hero {
  text-align: center;
  padding: 8px 0 22px;
  border-bottom: 1px solid var(--border-lighter);
  margin-bottom: 28px;
}
.sgd-crown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
  opacity: 0.7;
}
.sgd-crown .rule {
  width: 60px;
  height: 1px;
  background: var(--border-color);
}
.sgd-crown .diamond {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--text-tertiary);
}
.sgd-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sgd-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.1rem;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--text-primary);
  letter-spacing: -0.015em;
}
.sgd-lede {
  max-width: 620px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}
.sgd-lede em {
  color: var(--text-primary);
  font-style: normal;
  border-bottom: 1px dotted var(--border-color);
}

.sgd-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}
.sgd-card--primary {
  grid-column: span 2;
}
@media (min-width: 720px) {
  .sgd-card--primary {
    grid-column: span 1;
  }
}
@media (max-width: 640px) {
  .sgd-grid { grid-template-columns: 1fr; }
  .sgd-card--primary { grid-column: span 1; }
}

.sgd-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--card-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.sgd-card:hover {
  box-shadow: var(--card-shadow-hover);
}
.sgd-card--primary {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  border-color: rgba(var(--primary-rgb), 0.35);
  background: linear-gradient(180deg, var(--primary-light-bg), var(--card-bg) 60%);
  overflow: hidden;
  isolation: isolate;
}
/* Slow ambient sweep across the primary cards - a hint that data is live. */
.sgd-card--primary::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(
    115deg,
    transparent 35%,
    rgba(var(--primary-rgb), 0.08) 50%,
    transparent 65%
  );
  transform: translateX(-100%);
  animation: sgd-card-sweep 6s ease-in-out infinite;
  pointer-events: none;
}
.sgd-card--primary > * {
  position: relative;
  z-index: 1;
}
@keyframes sgd-card-sweep {
  0%, 12%   { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .sgd-card--primary::before { animation: none; opacity: 0; }
}
.sgd-card-eyebrow {
  margin: 0 0 6px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
}
.sgd-card--primary .sgd-card-eyebrow {
  font-size: 0.72rem;
  margin-bottom: 10px;
  color: var(--text-secondary);
}
.sgd-card-value {
  margin: 0 0 4px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.sgd-card--primary .sgd-card-value {
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.sgd-card-meta {
  margin: 0;
  font-size: 0.72rem;
  color: var(--text-secondary);
}
.sgd-card--primary .sgd-card-meta {
  font-size: 0.8rem;
  margin-top: auto;
}

.sgd-rate-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 10px 0 10px;
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  overflow: hidden;
  background: var(--border-lighter);
}
.sgd-rate-breakdown-item {
  min-width: 0;
  min-height: 76px;
  padding: 10px 12px;
  background: color-mix(in srgb, var(--card-bg) 86%, transparent);
}
.sgd-rate-breakdown-label {
  margin: 0 0 5px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sgd-rate-breakdown-value {
  margin: 0 0 4px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.sgd-rate-breakdown-meta {
  margin: 0;
  font-size: 0.66rem;
  line-height: 1.35;
  color: var(--text-secondary);
}
.sgd-rate-breakdown--official .sgd-rate-breakdown-value {
  letter-spacing: 0.02em;
}

.sgd-card--network {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 184px;
  padding: 17px 18px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.18);
}
.sgd-card--network > * {
  position: relative;
  z-index: 1;
}
.sgd-card--network::before {
  content: '';
  position: absolute;
  z-index: 0;
  top: 15px;
  right: 18px;
  width: 32px;
  height: 23px;
  border-radius: 6px;
  background:
    linear-gradient(90deg, transparent 31%, rgba(84, 54, 10, 0.38) 31% 34%, transparent 34% 66%, rgba(84, 54, 10, 0.38) 66% 69%, transparent 69%),
    linear-gradient(0deg, transparent 43%, rgba(84, 54, 10, 0.32) 43% 47%, transparent 47%),
    linear-gradient(135deg, #f7d982, #b8872a);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.34), 0 8px 18px rgba(0, 0, 0, 0.18);
  opacity: 0.9;
}
.sgd-card--network .sgd-card-eyebrow,
.sgd-card--network .sgd-card-meta,
.sgd-card--network .sgd-card-spread-label {
  color: rgba(255, 255, 255, 0.68);
}
.sgd-card--network .sgd-card-eyebrow {
  padding-right: 50px;
  line-height: 1.35;
}
.sgd-card--network .sgd-card-value,
.sgd-card--network .sgd-card-spread-value {
  color: #fff;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.2);
}
.sgd-card--network .sgd-card-value {
  margin-top: 10px;
}
.sgd-card--network .sgd-card-spreads {
  padding-top: 8px;
  margin-bottom: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.sgd-card--network .sgd-card-meta {
  padding-right: 72px;
}
.sgd-card--network .sgd-card-spread-value.is-positive {
  color: #9befb5;
}
.sgd-card--network .sgd-card-spread-value.is-negative {
  color: #ffaca7;
}
.sgd-card--network::after {
  content: '';
  position: absolute;
  z-index: 0;
  right: 18px;
  bottom: 17px;
  pointer-events: none;
}
.sgd-card--mastercard {
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 184, 91, 0.22), transparent 30%),
    linear-gradient(145deg, #191817 0%, #312821 54%, #141313 100%);
}
.sgd-card--mastercard::after {
  width: 48px;
  height: 30px;
  background:
    radial-gradient(circle at 40% 50%, rgba(235, 0, 27, 0.9) 0 33%, transparent 34%),
    radial-gradient(circle at 60% 50%, rgba(247, 158, 27, 0.9) 0 33%, transparent 34%),
    radial-gradient(circle at 50% 50%, rgba(255, 111, 33, 0.72) 0 18%, transparent 19%);
  filter: saturate(1.04);
}
.sgd-card--visa {
  background:
    radial-gradient(circle at 14% 16%, rgba(255, 214, 82, 0.22), transparent 28%),
    linear-gradient(145deg, #123c75 0%, #1a5fb4 52%, #0d2147 100%);
}
.sgd-card--visa::after {
  content: 'VISA';
  right: 18px;
  bottom: 19px;
  color: rgba(255, 255, 255, 0.94);
  font-family: 'Inter', 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.98rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  font-style: italic;
  line-height: 1;
  transform: skewX(-8deg);
}
.sgd-card--network .sgd-skel {
  background: rgba(255, 255, 255, 0.14);
}

/* "LIVE" badge - small pulsing dot beside the eyebrow on primary cards. */
.sgd-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 7px 2px 6px;
  margin-right: 6px;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--negative-color);
  background: var(--negative-bg);
  vertical-align: 1px;
}
.sgd-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--negative-color);
  position: relative;
  display: inline-block;
}
.sgd-live-dot::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--negative-color);
  opacity: 0.6;
  animation: sgd-live-pulse 1.6s ease-out infinite;
}
@keyframes sgd-live-pulse {
  0%   { transform: scale(0.6); opacity: 0.55; }
  70%  { transform: scale(1.8); opacity: 0;    }
  100% { transform: scale(1.8); opacity: 0;    }
}
@media (prefers-reduced-motion: reduce) {
  .sgd-live-dot::after { animation: none; opacity: 0; }
}

/* Brief flash applied to a card-value when JS writes a fresh number. */
.sgd-card-value.is-updated {
  animation: sgd-value-flash 1.4s ease-out;
}
@keyframes sgd-value-flash {
  0%   { background: rgba(var(--primary-rgb), 0); }
  18%  { background: rgba(var(--primary-rgb), 0.18); }
  100% { background: rgba(var(--primary-rgb), 0); }
}
@media (prefers-reduced-motion: reduce) {
  .sgd-card-value.is-updated { animation: none; }
}

.sgd-card-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.sgd-card--primary .sgd-card-row {
  margin-bottom: 4px;
}
.sgd-card-delta {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  padding: 2px 7px;
  border-radius: 999px;
  color: var(--text-tertiary);
  background: var(--surface-2);
  white-space: nowrap;
}
.sgd-card-delta.is-positive {
  color: var(--positive-color);
  background: rgba(76, 175, 80, 0.10);
}
.sgd-card-delta.is-negative {
  color: var(--negative-color);
  background: rgba(244, 67, 54, 0.10);
}

.sgd-card-spreads {
  margin: 6px 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.72rem;
}
.sgd-card-spread-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.sgd-card-spread-label {
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.sgd-card-spread-value {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}
.sgd-card-spread-value.is-positive { color: var(--positive-color); }
.sgd-card-spread-value.is-negative { color: var(--negative-color); }

.sgd-card-spark {
  margin: 6px 0 8px;
  height: 56px;
  width: 100%;
  position: relative;
}
.sgd-spark-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.sgd-card-spark .sgd-spark-grid {
  stroke: var(--sgd-grid-color);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.6;
}
.sgd-card-spark .sgd-line {
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
}

.sgd-spread {
  --sgd-spread-strength: 22%;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.95fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 18px 18px 20px;
  border-color: color-mix(in srgb, var(--positive-color) 24%, var(--border-color));
  background:
    linear-gradient(135deg, rgba(45, 125, 50, 0.08), transparent 42%),
    var(--card-bg);
  margin: -2px 0 2px;
}
.sgd-spread-main {
  min-width: 0;
}
.sgd-spread-kicker {
  margin: 0 0 8px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sgd-spread-headline {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 10px;
}
.sgd-spread-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.sgd-spread-value {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1;
}
.sgd-spread-value.is-positive { color: var(--positive-color); }
.sgd-spread-value.is-negative { color: var(--negative-color); }
.sgd-spread-value.is-hot { color: var(--negative-color); }
.sgd-spread-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}
.sgd-spread-status.is-positive {
  background: rgba(76, 175, 80, 0.11);
  color: var(--positive-color);
}
.sgd-spread-status.is-negative {
  background: rgba(244, 67, 54, 0.11);
  color: var(--negative-color);
}
.sgd-spread-status.is-watch {
  background: rgba(var(--primary-rgb), 0.10);
  color: var(--primary-color);
}
.sgd-spread-status.is-hot {
  background: rgba(244, 67, 54, 0.13);
  color: var(--negative-color);
}
.sgd-spread-note {
  margin: 7px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-tertiary);
}
.sgd-spread-visual {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface-2) 72%, transparent);
}
.sgd-spread-scale,
.sgd-spread-caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.68rem;
  color: var(--text-tertiary);
}
.sgd-spread-scale {
  margin-bottom: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.sgd-spread-caption {
  margin-top: 9px;
  line-height: 1.25;
}
.sgd-spread-meter {
  position: relative;
  height: 20px;
}
.sgd-spread-meter-track,
.sgd-spread-meter-fill {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  border-radius: 999px;
  transform: translateY(-50%);
}
.sgd-spread-meter-track {
  background: linear-gradient(90deg, var(--sgd-line-wise), var(--border-lighter), var(--sgd-line-crypto));
  opacity: 0.34;
}
.sgd-spread-meter-fill {
  right: auto;
  width: var(--sgd-spread-strength);
  min-width: 28px;
  max-width: 100%;
  background: linear-gradient(90deg, var(--sgd-line-wise), var(--sgd-line-crypto));
  box-shadow: 0 0 0 1px rgba(var(--primary-rgb), 0.08), 0 8px 20px rgba(45, 125, 50, 0.16);
}
.sgd-spread-meter-dot {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 3px solid var(--card-bg);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px var(--border-color);
}
.sgd-spread-meter-dot--official {
  left: 0;
  background: var(--sgd-line-wise);
}
.sgd-spread-meter-dot--parallel {
  left: var(--sgd-spread-strength);
  background: var(--sgd-line-crypto);
}
.sgd-spread.is-negative {
  border-color: color-mix(in srgb, var(--negative-color) 30%, var(--border-color));
  background:
    linear-gradient(135deg, rgba(244, 67, 54, 0.08), transparent 42%),
    var(--card-bg);
}
.sgd-spread.is-negative .sgd-spread-meter-fill {
  box-shadow: 0 0 0 1px rgba(244, 67, 54, 0.08), 0 8px 20px rgba(244, 67, 54, 0.14);
}
.sgd-spread.is-hot {
  border-color: color-mix(in srgb, var(--negative-color) 36%, var(--border-color));
  background:
    linear-gradient(135deg, rgba(244, 67, 54, 0.10), transparent 42%),
    var(--card-bg);
}
.sgd-spread.is-hot .sgd-spread-meter-fill {
  box-shadow: 0 0 0 1px rgba(244, 67, 54, 0.10), 0 8px 22px rgba(244, 67, 54, 0.18);
}

.sgd-alert-trigger {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-lighter);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sgd-alert-trigger:hover {
  background: var(--card-bg);
  border-color: var(--positive-color);
  color: var(--positive-color);
}
.sgd-alert-trigger .sgd-alert-bell {
  color: var(--positive-color);
  display: inline-flex;
}
.sgd-spread > .sgd-alert-trigger {
  justify-self: end;
  align-self: center;
  min-width: 96px;
  min-height: 40px;
  justify-content: center;
  background: var(--surface-2);
  color: var(--text-primary);
  border-color: var(--border-color);
  font-weight: 700;
  box-shadow: none;
}
.sgd-spread > .sgd-alert-trigger:hover {
  background: var(--card-bg);
  border-color: var(--positive-color);
  color: var(--positive-color);
}
.sgd-spread > .sgd-alert-trigger .sgd-alert-bell {
  color: var(--positive-color);
}

@media (max-width: 760px) {
  .sgd-spread {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .sgd-spread > .sgd-alert-trigger {
    justify-self: stretch;
    align-self: center;
  }
}
@media (max-width: 440px) {
  .sgd-spread {
    padding: 16px;
  }
  .sgd-spread-value {
    font-size: 1.7rem;
  }
  .sgd-spread-status {
    white-space: normal;
  }
}

.sgd-alert-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}
.sgd-alert-popup-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}
.sgd-alert-popup {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: var(--card-bg);
  border: 1px solid var(--border-lighter);
  border-radius: 12px;
  padding: 28px 26px 22px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  transform: translateY(8px) scale(0.98);
  transition: transform 0.18s ease;
}
.sgd-alert-popup-overlay.is-open .sgd-alert-popup {
  transform: translateY(0) scale(1);
}
.sgd-alert-popup-close {
  position: absolute;
  top: 10px;
  right: 10px;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sgd-alert-popup-close:hover {
  background: var(--surface-2);
  color: var(--text-primary);
}

.sgd-alert-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--positive-color);
}
.sgd-alert-bell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sgd-alert-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--text-primary);
}
.sgd-alert-deck {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.sgd-alert-deck strong {
  color: var(--text-primary);
  font-weight: 600;
}

.sgd-alert-form.is-submitted .sgd-alert-row,
.sgd-alert-form.is-submitted .sgd-alert-fineprint {
  opacity: 0.55;
  pointer-events: none;
}

.sgd-alert-form { margin-top: 18px; }
.sgd-alert-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}
.sgd-alert-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sgd-alert-field-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sgd-alert-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.sgd-alert-input {
  width: 100%;
  appearance: none;
  background: var(--card-bg);
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.92rem;
  color: var(--text-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.sgd-alert-input:focus {
  outline: none;
  border-color: var(--positive-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--positive-color) 20%, transparent);
}
.sgd-alert-input--num {
  padding-right: 28px;
  font-variant-numeric: tabular-nums;
}
.sgd-alert-suffix {
  position: absolute;
  right: 12px;
  font-size: 0.85rem;
  color: var(--text-tertiary);
  pointer-events: none;
}
.sgd-alert-submit {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  background: var(--primary-color);
  color: var(--text-tab);
  border: 0;
  border-radius: 8px;
  padding: 12px 16px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.sgd-alert-submit:hover { background: var(--primary-hover, var(--primary-color)); }
.sgd-alert-submit:active { transform: translateY(1px); }
.sgd-alert-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.sgd-alert-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.sgd-alert-status {
  margin: 12px 0 0;
  font-size: 0.82rem;
  line-height: 1.5;
  min-height: 1.2em;
}
.sgd-alert-status[data-state="error"] { color: var(--negative-color); }
.sgd-alert-status[data-state="success"] { color: var(--positive-color); }
.sgd-alert-status[data-state="pending"] { color: var(--text-secondary); }
.sgd-alert-fineprint {
  margin: 8px 0 0;
  font-size: 0.72rem;
  color: var(--text-tertiary);
  line-height: 1.5;
}

@media (max-width: 480px) {
  .sgd-alert-popup {
    padding: 24px 20px 20px;
  }
  .sgd-alert-row {
    grid-template-columns: 1fr;
  }
}

.sgd-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.sgd-section-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.sgd-chart-tabs {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border-lighter);
  border-radius: 999px;
  padding: 3px;
}
.sgd-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.sgd-tab:hover { color: var(--text-primary); }
.sgd-tab.is-active {
  background: var(--primary-color);
  color: var(--text-tab);
}

.sgd-chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.sgd-overlay-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-lighter);
  border-radius: 999px;
  padding: 5px 12px 5px 10px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.sgd-overlay-toggle:hover {
  color: var(--text-primary);
  border-color: var(--vnd-line-overnight);
}
.sgd-overlay-toggle-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--vnd-line-overnight);
  background: transparent;
  transition: background 0.15s ease;
}
.sgd-overlay-toggle.is-active {
  color: var(--text-primary);
  border-color: var(--vnd-line-overnight);
  background: var(--surface-2);
}
.sgd-overlay-toggle.is-active .sgd-overlay-toggle-dot {
  background: var(--vnd-line-overnight);
}

.sgd-chart-section {
  margin-bottom: 36px;
}
.sgd-chart-wrap {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--card-shadow);
}
.sgd-chart {
  display: block;
  width: 100%;
  height: 300px;
}
.sgd-chart .sgd-grid {
  stroke: var(--sgd-grid-color);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.6;
}
.sgd-chart .sgd-axis {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 10px;
  fill: var(--text-tertiary);
}
.sgd-chart .sgd-line {
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  fill: none;
}
.sgd-line--wise   { stroke: var(--sgd-line-wise); }
.sgd-line--crypto { stroke: var(--sgd-line-crypto); }
.sgd-line--usdt   { stroke: var(--sgd-line-usdt); }
.sgd-line--xsgd   { stroke: var(--sgd-line-xsgd); }
.sgd-dot--wise   { fill: var(--sgd-line-wise); }
.sgd-dot--crypto { fill: var(--sgd-line-crypto); }
.sgd-dot--usdt   { fill: var(--sgd-line-usdt); }
.sgd-dot--xsgd   { fill: var(--sgd-line-xsgd); }

.sgd-chart-legend {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-lighter);
}
.sgd-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.sgd-legend-swatch {
  width: 14px;
  height: 2px;
  border-radius: 2px;
}
.sgd-legend-swatch--wise   { background: var(--sgd-line-wise); }
.sgd-legend-swatch--crypto { background: var(--sgd-line-crypto); }
.sgd-legend-swatch--usdt   { background: var(--sgd-line-usdt); }
.sgd-legend-swatch--xsgd   { background: var(--sgd-line-xsgd); }

.sgd-chart-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  font-size: 0.85rem;
  background: var(--card-bg);
}
.sgd-chart-empty[hidden] {
  display: none;
}

.sgd-chart-stage {
  position: relative;
  cursor: crosshair;
}
.sgd-chart .sgd-hover-line {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  opacity: 0.7;
}
.sgd-chart .sgd-hover-dot {
  stroke: var(--card-bg);
  stroke-width: 2;
  pointer-events: none;
}

.sgd-tooltip {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  min-width: 180px;
  max-width: 260px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  box-shadow: var(--card-shadow-hover);
  font-size: 0.78rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.sgd-tooltip[hidden] {
  display: none;
}
.sgd-tt-date {
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border-lighter);
}
.sgd-tt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 3px 0;
}
.sgd-tt-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
}
.sgd-tt-val {
  font-weight: 600;
  color: var(--text-primary);
}
.sgd-tt-val.is-positive { color: var(--positive-color); }
.sgd-tt-val.is-negative { color: var(--negative-color); }
.sgd-tt-spread {
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px dashed var(--border-lighter);
}
.sgd-tt-swatch {
  width: 10px;
  height: 2px;
  border-radius: 2px;
  display: inline-block;
}
.sgd-tt-swatch--wise   { background: var(--sgd-line-wise); }
.sgd-tt-swatch--crypto { background: var(--sgd-line-crypto); }
.sgd-tt-swatch--usdt   { background: var(--sgd-line-usdt); }
.sgd-tt-swatch--xsgd   { background: var(--sgd-line-xsgd); }

/* ---------- Chart event markers ---------- */
.sgd-chart .sgd-event-line {
  stroke: var(--accent-color);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  opacity: 0.4;
  pointer-events: none;
  transition: opacity 0.12s ease;
}
.sgd-chart .sgd-event-dot {
  fill: var(--accent-color);
  stroke: var(--card-bg);
  stroke-width: 1.5;
  pointer-events: none;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.12s ease;
}
.sgd-chart .sgd-event-hit {
  fill: transparent;
  cursor: pointer;
}
.sgd-event:hover .sgd-event-line,
.sgd-event.is-active .sgd-event-line {
  opacity: 1;
}
.sgd-event:hover .sgd-event-dot,
.sgd-event.is-active .sgd-event-dot {
  transform: scale(1.4);
}

.sgd-legend-item--events {
  color: var(--text-tertiary);
}
.sgd-legend-swatch--event {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-color);
}

.sgd-tooltip--event {
  max-width: 300px;
}
.sgd-event-tt-title {
  margin: 0 0 4px;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
  line-height: 1.4;
}
.sgd-event-tt-detail {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ---------- Chart citations (collapsed sources under the chart) ---------- */
.sgd-citations {
  margin-top: 14px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-bg);
  overflow: hidden;
}
.sgd-citations[hidden] {
  display: none;
}
.sgd-citations-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
}
.sgd-citations-summary::-webkit-details-marker {
  display: none;
}
.sgd-citations-summary::marker {
  content: '';
}
.sgd-citations-summary:hover {
  background: var(--hover-bg);
}
.sgd-citations-summary-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.sgd-citations-title {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-primary);
}
.sgd-citations-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.sgd-citations-toggle svg {
  width: 13px;
  height: 13px;
  transition: transform 0.15s ease;
}
.sgd-citations[open] .sgd-citations-toggle svg {
  transform: rotate(180deg);
}
.sgd-citations-list {
  margin: 0;
  padding: 4px 16px 16px;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px dashed var(--border-lighter);
}
.sgd-citations-item {
  padding-top: 12px;
}
.sgd-citations-item-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 3px;
}
.sgd-citations-item-date {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}
.sgd-citations-item-tag {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-color);
}
.sgd-citations-item-title {
  margin: 0 0 4px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}
.sgd-citations-item-detail {
  margin: 0 0 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}
.sgd-citations-item-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary-color);
  text-decoration: none;
}
.sgd-citations-item-link:hover {
  text-decoration: underline;
}

/* ---------- Loading skeletons ---------- */
.sgd-skel {
  display: inline-block;
  vertical-align: middle;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
  border-radius: 6px;
}
.sgd-skel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--surface-3) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: sgd-shimmer 1.4s ease-in-out infinite;
}
@keyframes sgd-shimmer {
  100% { transform: translateX(100%); }
}
@media (prefers-reduced-motion: reduce) {
  .sgd-skel::after { animation: none; }
}

.sgd-skel-value {
  width: 70%;
  height: 2.4rem;
  border-radius: 8px;
}
.sgd-skel-value--sm {
  height: 1.4rem;
  width: 60%;
}
.sgd-skel-spread {
  width: 56px;
  height: 1rem;
}
.sgd-skel-line {
  width: 80%;
  height: 0.78rem;
}
.sgd-skel-pill {
  width: 110px;
  height: 12px;
  border-radius: 999px;
}
.sgd-skel-cell {
  width: 80%;
  height: 0.85rem;
}

.sgd-chart-skel {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
  z-index: 2;
  background: var(--card-bg);
}
.sgd-skel-chart {
  flex: 1;
  height: 100%;
  border-radius: 6px;
}

/* Skeleton placeholders inside cards/spread are wiped naturally when JS calls
   `setText(...)`/`textContent = ...`. The chart overlay needs explicit gating. */
.sgd-page:not(.is-loading-history) .sgd-chart-skel {
  display: none;
}
.sgd-skel-row td {
  vertical-align: middle;
}

.sgd-table-section {
  margin: 0 0 42px;
}
.sgd-table-section > .sgd-section-title {
  margin-bottom: 14px;
}
.sgd-table-wrap {
  overflow-x: auto;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: var(--card-shadow);
}
.sgd-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.sgd-table th,
.sgd-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-lighter);
  text-align: left;
  vertical-align: middle;
}
.sgd-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sgd-table tbody tr:last-child td {
  border-bottom: 0;
}
.sgd-table tbody tr:hover td {
  background: var(--surface-2);
}
.sgd-table .num,
.sgd-table th.num,
.sgd-table td.num {
  text-align: right;
  white-space: nowrap;
}
.sgd-table .is-positive {
  color: var(--positive-color);
  font-weight: 600;
}
.sgd-table .is-negative {
  color: var(--negative-color);
  font-weight: 600;
}
.sgd-table-empty {
  padding: 18px 14px;
  color: var(--text-tertiary);
  text-align: center;
}
.sgd-table-section:not(.is-expanded) .sgd-row-extra {
  display: none;
}
.sgd-table-foot {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
.sgd-table-toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sgd-table-toggle:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.sgd-table-toggle:focus-visible {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
[data-theme='dark'] .sgd-table-toggle:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.sgd-table-toggle-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}
.sgd-table-toggle-icon svg {
  width: 14px;
  height: 14px;
}
.sgd-table-section.is-expanded .sgd-table-toggle-icon {
  transform: rotate(180deg);
}

.sgd-explainer {
  position: relative;
  margin: 0 0 42px;
  padding: 26px;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--primary-rgb), 0.08), transparent 42%),
    linear-gradient(180deg, var(--card-bg), var(--surface-1, var(--card-bg)));
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.sgd-explainer::before {
  content: '';
  position: absolute;
  inset: 0;
  border-top: 3px solid rgba(var(--primary-rgb), 0.28);
  pointer-events: none;
}
.sgd-explainer-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  list-style: none;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.sgd-explainer-summary::-webkit-details-marker {
  display: none;
}
.sgd-explainer-summary::marker {
  content: '';
}
.sgd-explainer-summary:focus-visible {
  outline: none;
}
.sgd-explainer-summary:focus-visible .sgd-explainer-toggle {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
[data-theme='dark'] .sgd-explainer-summary:focus-visible .sgd-explainer-toggle {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.sgd-explainer-summary-copy {
  display: block;
  max-width: 720px;
  min-width: 0;
}
.sgd-explainer-kicker {
  display: block;
  margin: 0 0 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sgd-explainer-deck {
  display: block;
  margin: 8px 0 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}
.sgd-explainer-toggle {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.sgd-explainer-summary:hover .sgd-explainer-toggle {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.sgd-explainer-toggle span::before {
  content: 'Open';
}
.sgd-explainer-toggle > span {
  font-size: 0;
}
.sgd-explainer[open] .sgd-explainer-toggle span::before {
  content: 'Close';
  font-size: 0.78rem;
}
.sgd-explainer-toggle span::before {
  font-size: 0.78rem;
}
.sgd-explainer-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 0.15s ease;
}
.sgd-explainer[open] .sgd-explainer-toggle svg {
  transform: rotate(180deg);
}
.sgd-explainer-body {
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.sgd-rate-map {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  position: relative;
  z-index: 1;
}
.sgd-rate-node {
  border: 1px solid var(--border-lighter);
  border-radius: 10px;
  padding: 18px;
  background: color-mix(in srgb, var(--card-bg) 88%, transparent);
  min-width: 0;
}
.sgd-rate-node--official {
  border-top: 3px solid var(--sgd-line-wise);
}
.sgd-rate-node--parallel {
  border-top: 3px solid var(--sgd-line-crypto);
}
.sgd-rate-node-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  color: var(--text-tertiary);
}
.sgd-rate-token {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  height: 34px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}
.sgd-rate-node--official .sgd-rate-token:nth-of-type(2) {
  min-width: 118px;
}
.sgd-rate-node--official .sgd-rate-node-top {
  flex-wrap: nowrap;
}
.sgd-rate-node--official .sgd-rate-arrow {
  flex: 1 1 34px;
  min-width: 28px;
  max-width: 58px;
}
.sgd-rate-arrow {
  display: inline-flex;
  align-items: center;
  flex: 1 1 54px;
  min-width: 48px;
  max-width: 96px;
}
.sgd-rate-arrow svg {
  display: block;
  width: 100%;
  height: 20px;
}
.sgd-rate-buyer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  margin: 0 0 16px;
  padding: 12px 14px 12px 16px;
  border: 1px solid var(--border-lighter);
  border-radius: 10px;
  background:
    linear-gradient(90deg, color-mix(in srgb, currentColor 10%, transparent), transparent 72%),
    var(--surface-2);
  color: var(--text-secondary);
  overflow: hidden;
}
.sgd-rate-buyer::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: currentColor;
}
.sgd-rate-buyer--official {
  color: var(--sgd-line-wise);
}
.sgd-rate-buyer--parallel {
  color: var(--sgd-line-crypto);
}
.sgd-rate-buyer-label {
  color: var(--text-tertiary);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sgd-rate-buyer strong {
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.25;
}
.sgd-rate-buyer span:last-child {
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}
.sgd-rate-node h3 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.08rem;
  color: var(--text-primary);
}
.sgd-rate-node p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.62;
}
.sgd-rate-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}
.sgd-rate-facts div {
  min-width: 0;
  padding-top: 10px;
  border-top: 1px dashed var(--border-lighter);
}
.sgd-rate-facts dt {
  margin: 0 0 3px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.sgd-rate-facts dd {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 600;
}

.sgd-rate-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 38px;
  color: var(--text-tertiary);
}
.sgd-rate-divider span {
  width: 1px;
  flex: 1;
  min-height: 34px;
  background: linear-gradient(180deg, transparent, var(--border-color), transparent);
}
.sgd-rate-divider strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sgd-rate-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 12px 14px;
  border: 1px solid var(--border-lighter);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  position: relative;
  z-index: 1;
}
.sgd-rate-equation span,
.sgd-rate-equation strong {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--card-bg);
  border: 1px solid var(--border-lighter);
  white-space: nowrap;
}
.sgd-rate-equation b {
  color: var(--text-tertiary);
  font-weight: 700;
}
.sgd-rate-equation strong {
  color: var(--sgd-line-crypto);
}

.sgd-rate-reading {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  position: relative;
  z-index: 1;
}
.sgd-rate-reading div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  padding: 14px;
  border-radius: 10px;
  background: rgba(var(--primary-rgb), 0.045);
  border: 1px solid var(--border-lighter);
}
.sgd-rate-mark {
  grid-row: span 2;
  width: 10px;
  height: 100%;
  min-height: 54px;
  border-radius: 999px;
  margin-top: 2px;
}
.sgd-rate-mark--wide {
  background: linear-gradient(180deg, var(--sgd-line-crypto), var(--positive-color));
}
.sgd-rate-mark--tight {
  background: linear-gradient(180deg, var(--sgd-line-wise), var(--text-tertiary));
}
.sgd-rate-reading h3 {
  margin: 0 0 4px;
  font-size: 0.9rem;
  color: var(--text-primary);
}
.sgd-rate-reading p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.55;
}

.sgd-spread-conditions {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px dashed var(--border-lighter);
  position: relative;
  z-index: 1;
}
.sgd-spread-conditions-head {
  max-width: 760px;
  margin-bottom: 16px;
}
.sgd-spread-conditions-head h3 {
  margin: 0 0 8px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.08rem;
  color: var(--text-primary);
}
.sgd-spread-conditions-head p:last-child {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}
.sgd-pressure-gauge {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  color: var(--text-tertiary);
}
.sgd-pressure-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sgd-pressure-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sgd-line-wise), var(--sgd-line-crypto));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  overflow: hidden;
}
.sgd-pressure-track::before,
.sgd-pressure-track::after {
  content: '';
  position: absolute;
  top: -4px;
  width: 1px;
  height: 18px;
  background: rgba(255, 255, 255, 0.55);
}
.sgd-pressure-track::before { left: 33.33%; }
.sgd-pressure-track::after { left: 66.66%; }
.sgd-pressure-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
}

.sgd-spread-viz {
  margin: 0 0 16px;
  border: 1px solid var(--border-lighter);
  border-radius: 10px;
  background:
    radial-gradient(circle at 62% 28%, rgba(var(--primary-rgb), 0.10), transparent 32%),
    var(--card-bg);
  overflow: hidden;
}
.sgd-spread-viz-svg {
  display: block;
  width: 100%;
  height: auto;
  color: var(--sgd-line-crypto);
}
.sgd-spread-viz-grid line {
  stroke: var(--border-lighter);
  stroke-width: 1;
  stroke-dasharray: 3 7;
}
.sgd-spread-viz-band {
  fill: url(#sgd-spread-band);
  opacity: 0;
  animation: sgd-spread-band-in 1.1s ease 0.65s forwards;
}
.sgd-spread-viz-official,
.sgd-spread-viz-parallel {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
  stroke-dasharray: 900;
  stroke-dashoffset: 900;
  vector-effect: non-scaling-stroke;
  animation: sgd-spread-line-draw 1.45s ease forwards;
}
.sgd-spread-viz-official {
  stroke: var(--sgd-line-wise);
  animation-delay: 0.05s;
}
.sgd-spread-viz-parallel {
  stroke: var(--sgd-line-crypto);
  animation-delay: 0.22s;
}
.sgd-spread-viz-gap line {
  stroke: var(--sgd-line-crypto);
  stroke-width: 1.6;
  stroke-dasharray: 4 5;
  opacity: 0;
  animation: sgd-spread-gap-pulse 2.6s ease-in-out 1.05s infinite;
}
.sgd-spread-viz-gap circle {
  fill: var(--card-bg);
  stroke: var(--sgd-line-crypto);
  stroke-width: 2;
  opacity: 0;
  animation: sgd-spread-dot-in 0.5s ease 1.05s forwards;
}
.sgd-spread-viz-labels text {
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  fill: var(--text-primary);
  font-size: 16px;
  font-weight: 700;
}
.sgd-spread-viz-labels .sgd-spread-viz-small {
  fill: var(--text-tertiary);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.sgd-spread-viz-labels .sgd-spread-viz-key {
  font-size: 11px;
  font-weight: 700;
}
.sgd-spread-viz-key--official {
  fill: var(--sgd-line-wise);
}
.sgd-spread-viz-key--parallel {
  fill: var(--sgd-line-crypto);
}
.sgd-spread-viz-marker {
  offset-path: path("M58 166 C150 163 216 158 292 146 C370 133 420 86 494 80 C580 72 641 124 718 142");
  animation: sgd-spread-marker-run 5.8s ease-in-out 1.15s infinite;
}
.sgd-spread-viz-marker circle {
  fill: var(--sgd-line-crypto);
  stroke: var(--card-bg);
  stroke-width: 2;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.18));
}

@keyframes sgd-spread-line-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes sgd-spread-band-in {
  to { opacity: 1; }
}
@keyframes sgd-spread-dot-in {
  to { opacity: 1; }
}
@keyframes sgd-spread-gap-pulse {
  0%, 100% { opacity: 0.28; }
  50% { opacity: 0.86; }
}
@keyframes sgd-spread-marker-run {
  0%, 8% { offset-distance: 0%; opacity: 0; }
  18% { opacity: 1; }
  72% { opacity: 1; }
  92%, 100% { offset-distance: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sgd-spread-viz-band,
  .sgd-spread-viz-official,
  .sgd-spread-viz-parallel,
  .sgd-spread-viz-gap line,
  .sgd-spread-viz-gap circle,
  .sgd-spread-viz-marker {
    animation: none;
  }
  .sgd-spread-viz-band,
  .sgd-spread-viz-gap line,
  .sgd-spread-viz-gap circle {
    opacity: 1;
  }
  .sgd-spread-viz-official,
  .sgd-spread-viz-parallel {
    stroke-dashoffset: 0;
  }
  .sgd-spread-viz-marker {
    display: none;
  }
}

.sgd-condition-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.sgd-condition-card {
  padding: 16px;
  border: 1px solid var(--border-lighter);
  border-radius: 10px;
  background: color-mix(in srgb, var(--card-bg) 90%, transparent);
}
.sgd-condition-card--broad {
  border-left: 3px solid var(--sgd-line-crypto);
}
.sgd-condition-card--narrow {
  border-left: 3px solid var(--sgd-line-wise);
}
.sgd-condition-card h4 {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text-primary);
}
.sgd-condition-card ul {
  margin: 0;
  padding-left: 18px;
}
.sgd-condition-card li {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.55;
}
.sgd-condition-card li:last-child {
  margin-bottom: 0;
}
.sgd-condition-card strong {
  color: var(--text-primary);
  font-weight: 700;
}

.sgd-spread-lens {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 14px;
  border: 1px solid var(--border-lighter);
  border-radius: 10px;
  overflow: hidden;
  background: var(--border-lighter);
}
.sgd-spread-lens div {
  min-width: 0;
  padding: 12px 14px;
  background: var(--surface-2);
}
.sgd-spread-lens span {
  display: block;
  margin-bottom: 4px;
  color: var(--text-tertiary);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.sgd-spread-lens strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .sgd-title { font-size: 1.7rem; }
  .sgd-card { padding: 12px 14px; }
  .sgd-card--primary { padding: 18px 18px; }
  .sgd-card-value { font-size: 1.25rem; }
  .sgd-card--primary .sgd-card-value { font-size: 1.95rem; }

  .sgd-chart-wrap { padding: 12px 10px 10px; }
  .sgd-chart { height: 240px; }
  .sgd-chart-stage { cursor: default; }
  .sgd-chart .sgd-axis { font-size: 9px; }

  .sgd-section-head {
    gap: 10px;
    margin-bottom: 10px;
  }
  .sgd-chart-tabs {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .sgd-chart-tabs::-webkit-scrollbar { display: none; }
  .sgd-tab {
    flex: 1 1 auto;
    text-align: center;
    white-space: nowrap;
    padding: 7px 10px;
  }

  .sgd-chart-legend {
    gap: 12px;
    margin-top: 8px;
    padding-top: 8px;
  }
  .sgd-legend-item { font-size: 0.74rem; }

  .sgd-tooltip {
    min-width: 0;
    max-width: calc(100vw - 60px);
    width: max-content;
    padding: 8px 10px;
    font-size: 0.74rem;
  }
  .sgd-tt-row { gap: 10px; padding: 2px 0; }
  .sgd-tt-date { font-size: 0.7rem; margin-bottom: 4px; padding-bottom: 4px; }

  .sgd-explainer {
    padding: 20px 16px;
    border-radius: 10px;
  }
  .sgd-rate-map {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .sgd-rate-divider {
    flex-direction: row;
    min-width: 0;
  }
  .sgd-rate-divider span {
    width: auto;
    height: 1px;
    min-height: 0;
  }
  .sgd-rate-reading {
    grid-template-columns: 1fr;
  }
  .sgd-condition-grid {
    grid-template-columns: 1fr;
  }
  .sgd-spread-lens {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .sgd-chart { height: 220px; }
  .sgd-chart-wrap { padding: 10px 6px 8px; border-radius: 8px; }
  .sgd-section-title { font-size: 1.05rem; }
  .sgd-tab { font-size: 0.74rem; padding: 6px 8px; }
  .sgd-rate-node {
    padding: 15px;
  }
  .sgd-rate-token {
    min-width: 48px;
    height: 32px;
    font-size: 0.72rem;
  }
  .sgd-rate-node--official .sgd-rate-token {
    min-width: 42px;
    padding: 0 8px;
  }
  .sgd-rate-node--official .sgd-rate-token:nth-of-type(2) {
    min-width: 104px;
  }
  .sgd-rate-node--official .sgd-rate-arrow {
    flex-basis: 24px;
    min-width: 20px;
  }
  .sgd-rate-equation {
    justify-content: flex-start;
  }
}

/* /sgd uses square-edged UI throughout. Keep this scoped to the route so
   shared components and chart classes retain their existing shape elsewhere. */
.sgd-route,
.sgd-route *,
.sgd-route *::before,
.sgd-route *::after {
  border-radius: 0 !important;
}

/* BDS property switcher: a wrap-friendly tag list designed to scale to 10+
   properties without breaking mobile layouts. Each tag is a button acting as
   a radio inside a [role="radiogroup"]. */
.bds-property-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 720px;
  margin: -4px auto 16px;
}
.bds-window-picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 28px;
}
.bds-window-picker .bds-property-label {
  padding-left: 0;
}
.bds-property-label {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
  padding-left: 2px;
}

/* City tabs read like exchange tickers (mono code, muted full name below) so
   the picker scans as structural navigation, distinct from the property
   pills it filters. Underline indicator, not a filled pill - that visual
   weight is reserved for the property selection itself. */
.bds-city-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border-light);
  overflow-x: auto;
  scrollbar-width: none;
}
.bds-city-tabs::-webkit-scrollbar {
  display: none;
}
.bds-city-tab {
  appearance: none;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 7px 16px 9px 2px;
  margin: 0 12px -1px 0;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease;
}
.bds-city-tab:last-child {
  margin-right: 0;
}
.bds-city-tab.is-active {
  border-bottom-color: var(--primary-color);
}
.bds-city-tab:focus-visible {
  outline: none;
  border-radius: 3px;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
[data-theme='dark'] .bds-city-tab:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.bds-city-tab-code {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}
.bds-city-tab:hover .bds-city-tab-code {
  color: var(--text-secondary);
}
.bds-city-tab.is-active .bds-city-tab-code {
  color: var(--text-primary);
}
.bds-city-tab-count {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.4;
}
.bds-city-tab.is-active .bds-city-tab-count {
  color: var(--text-tab);
  background: var(--primary-color);
  border-color: var(--primary-color);
}
.bds-city-tab-name {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  transition: color 0.15s ease;
}
.bds-city-tab.is-active .bds-city-tab-name {
  color: var(--text-secondary);
}

.bds-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bds-tag {
  appearance: none;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-secondary);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bds-tag:hover {
  background: var(--hover-bg);
  color: var(--text-primary);
  border-color: var(--text-tertiary);
}
.bds-tag:focus-visible {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}
[data-theme='dark'] .bds-tag:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}
.bds-tag.is-selected {
  background: var(--primary-color);
  color: var(--text-tab);
  border-color: var(--primary-color);
}
.bds-tag.is-selected:hover {
  background: var(--primary-color);
  color: var(--text-tab);
  border-color: var(--primary-color);
}
.bds-tag-name {
  display: inline-block;
}
.bds-tag-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 1px 7px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  background: var(--surface-2);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  line-height: 1.4;
}
.bds-tag.is-selected .bds-tag-badge {
  color: var(--text-tab);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
}
[data-theme='dark'] .bds-tag.is-selected .bds-tag-badge {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(0, 0, 0, 0.3);
}

@media (max-width: 600px) {
  .bds-tag {
    font-size: 0.8rem;
    padding: 6px 12px;
    min-height: 34px;
  }
  .bds-tag-badge {
    font-size: 0.58rem;
    padding: 1px 6px;
    margin-left: 6px;
  }
  .bds-city-tab {
    padding: 6px 12px 8px 2px;
    margin-right: 8px;
  }
  .bds-city-tab-code {
    font-size: 0.84rem;
  }
  .bds-city-tab-name {
    font-size: 0.58rem;
  }
}

/* Property dossier - a compact "field file" for the selected listing: photo
   (muted/grayscale, archival rather than glossy-marketing), a small ticker-
   style city tag echoing .bds-city-tab-code, a spec-sheet fact list, and a
   serif pull-line description. Sits between the hero and the property
   picker; its fields are swapped by assets/bds.js on selection change. */
.bds-dossier {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
  max-width: 720px;
  margin: 0 auto 24px;
}
.bds-dossier.no-media {
  grid-template-columns: 1fr;
}
.bds-dossier.no-media .bds-dossier-media {
  display: none;
}
@media (max-width: 640px) {
  .bds-dossier {
    grid-template-columns: 1fr;
    gap: 14px;
  }
}

.bds-dossier-media {
  position: relative;
  margin: 0;
}
.bds-dossier-photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--surface-2);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  filter: grayscale(12%) contrast(1.02);
}
.bds-dossier-tag {
  position: absolute;
  z-index: 1;
  top: 8px;
  left: 8px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  background: rgba(var(--primary-rgb), 0.08);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 2px 6px;
  backdrop-filter: blur(2px);
}
[data-theme='dark'] .bds-dossier-tag {
  background: rgba(0, 0, 0, 0.45);
}
.bds-dossier-credit {
  margin-top: 6px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  text-align: right;
}
.bds-dossier-credit a {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}
.bds-dossier-credit a:hover {
  color: var(--text-secondary);
}

.bds-dossier-body {
  min-width: 0;
}
.bds-dossier-eyebrow {
  margin: 0 0 10px;
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  font-weight: 600;
}
.bds-dossier-facts {
  margin: 0;
}
.bds-dossier-fact {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-lighter);
}
.bds-dossier-fact:last-child {
  border-bottom: none;
}
.bds-dossier-fact dt {
  flex: none;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-top: 2px;
}
.bds-dossier-fact dd {
  margin: 0;
  text-align: right;
  color: var(--text-primary);
  font-size: 0.86rem;
  line-height: 1.45;
}
.bds-dossier-desc {
  margin: 14px 0 0;
  padding-left: 14px;
  border-left: 3px solid var(--border-color);
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--text-secondary);
}
@media (max-width: 640px) {
  .bds-dossier-fact dd {
    text-align: left;
  }
  .bds-dossier-fact {
    flex-direction: column;
    gap: 2px;
  }
}

.bds-pi-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border-lighter);
}
.bds-pi-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.bds-pi-label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.bds-pi-value {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.sgd-card-sub {
  margin: 2px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}
.bds-chart-note {
  margin-top: 14px;
  padding: 10px 14px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-secondary);
  background: var(--surface-2);
  border: 1px solid var(--border-lighter);
  border-left: 3px solid var(--text-tertiary);
  border-radius: 6px;
}
.bds-chart-note strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Top progress bar - shown only while .bds-page is in the loading state.
   Fixed to the viewport top so it stays visible while users scroll between
   property switches. The inner bar uses an indeterminate sweep since the
   underlying fetch has no measurable progress. */
.bds-top-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 1000;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.bds-page.is-loading-history .bds-top-progress {
  opacity: 1;
}
.bds-top-progress-bar {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 40%;
  background: var(--primary-color);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.18);
  transform: translateX(-100%);
}
.bds-page.is-loading-history .bds-top-progress-bar {
  animation: bds-top-progress-slide 1.1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes bds-top-progress-slide {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}
@media (prefers-reduced-motion: reduce) {
  .bds-page.is-loading-history .bds-top-progress-bar {
    animation: none;
    width: 100%;
    transform: translateX(0);
    opacity: 0.6;
  }
}

@media (max-width: 600px) {
  .bds-pi-value {
    font-size: 1.2rem;
  }
}

/* ============================================================
   BDS → "Query this dataset from an AI agent" MCP connect panel.
   Sits at the foot of /bds. Reuses the page's existing vocabulary
   (SF Mono for anything literal, the post-share-copy pill button,
   the bds-dossier-fact dt/dd spec-sheet pattern) rather than
   introducing new UI language.
   ============================================================ */
.bds-mcp {
  margin: 40px 0 36px;
  padding: 22px 24px 24px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
}
.bds-mcp-eyebrow {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-color);
}
.bds-mcp .sgd-section-title {
  margin-bottom: 10px;
}
.bds-mcp-lede {
  max-width: 640px;
  margin: 0 0 18px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
}
.bds-mcp-lede abbr {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}

.bds-mcp-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-lighter);
  border-radius: 8px;
}
.bds-mcp-endpoint-label {
  flex: 0 0 auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.bds-mcp-endpoint-url {
  flex: 1 1 auto;
  min-width: 0;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.86rem;
  color: var(--text-primary);
  overflow-x: auto;
  white-space: nowrap;
}

.bds-mcp-copy {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}
.bds-mcp-copy:hover,
.bds-mcp-copy:focus-visible {
  color: var(--text-primary);
  border-color: var(--accent-color);
  outline: none;
  transform: translateY(-1px);
}
.bds-mcp-copy:active {
  transform: none;
}
.bds-mcp-copy-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}
.bds-mcp-copy-icon svg {
  width: 100%;
  height: 100%;
}
.bds-mcp-copy:hover .bds-mcp-copy-icon,
.bds-mcp-copy:focus-visible .bds-mcp-copy-icon {
  color: var(--accent-color);
}
.bds-mcp-copy[data-state='success'] {
  color: var(--positive-color);
  border-color: var(--positive-color);
}
.bds-mcp-copy[data-state='success'] .bds-mcp-copy-icon {
  color: var(--positive-color);
}
.bds-mcp-copy[data-state='error'] {
  color: var(--negative-color);
  border-color: var(--negative-color);
}

.bds-mcp-connect {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border-lighter);
}
.bds-mcp-connect-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 4px 10px;
  align-items: baseline;
}
.bds-mcp-connect-row dt {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}
.bds-mcp-connect-row dd {
  margin: 0;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
}
.bds-mcp-connect-row code {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.78rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.bds-mcp-tools {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
}
.bds-mcp-tool {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 4px 10px;
  align-items: baseline;
}
.bds-mcp-tool dt {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-color);
}
.bds-mcp-tool dd {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.bds-mcp-note {
  margin: 0;
  font-size: 0.74rem;
  color: var(--text-tertiary);
}

@media (max-width: 640px) {
  .bds-mcp {
    padding: 18px 16px 20px;
  }
  .bds-mcp-connect-row,
  .bds-mcp-tool {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .bds-mcp-endpoint {
    flex-direction: column;
    align-items: stretch;
  }
  .bds-mcp-copy {
    align-self: flex-start;
  }
}

/* ============================================================
   Footer legal nav (Privacy / Terms)
   ============================================================ */
.site-footer-legal {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
}

/* ============================================================
   About → Contact CTA (replaces the inline form)
   ============================================================ */
.about-contact-cta {
  margin: 48px auto 0;
  max-width: 620px;
  padding: 28px 24px;
  text-align: center;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.about-contact-cta-text {
  margin: 0 0 10px;
  font-family: 'Andada Pro', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.about-contact-cta-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--text-secondary);
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.about-contact-cta-link:hover {
  color: var(--accent-color, var(--text-primary));
  border-bottom-color: var(--accent-color, var(--text-primary));
}

/* ============================================================
   Contact page hero + info
   ============================================================ */
.contact-page-hero {
  text-align: center;
  margin: 0 0 36px;
}

.contact-page-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 10px;
}

.contact-page-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 14px;
  line-height: 1.15;
}

.contact-page-lede {
  max-width: 600px;
  margin: 0 auto;
  font-family: 'Andada Pro', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--text-secondary);
  text-wrap: balance;
}

.contact-page-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0 0;
}

.contact-page-divider span {
  display: inline-block;
  width: 64px;
  height: 1px;
  background: var(--border-color);
}

.contact-page-info {
  margin: 56px auto 0;
  max-width: 620px;
  padding-top: 28px;
  border-top: 1px solid var(--border-color);
}

.contact-page-info-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
}

.contact-page-info-list {
  margin: 0 0 18px;
  padding: 0;
}

.contact-page-info-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-color);
  font-size: 0.92rem;
}

.contact-page-info-row:last-child {
  border-bottom: none;
}

.contact-page-info-row dt {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  padding-top: 3px;
}

.contact-page-info-row dd {
  margin: 0;
  color: var(--text-secondary);
}

.contact-page-info-row dd a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
}

.contact-page-info-row dd a:hover {
  border-bottom-color: var(--text-primary);
}

.contact-page-info-note {
  margin: 14px 0 0;
  font-size: 12.5px;
  color: var(--text-tertiary);
  line-height: 1.55;
}

.contact-page-info-note a {
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
  text-decoration: none;
}

.contact-page-info-note a:hover {
  color: var(--text-primary);
  border-bottom-color: var(--text-primary);
}

/* ============================================================
   Legal pages (Privacy Policy, Terms of Service)
   ============================================================ */
.legal-page {
  max-width: 760px;
}

.legal-hero {
  text-align: center;
  margin: 0 0 36px;
}

.legal-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin: 0 0 10px;
}

.legal-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 12px;
  line-height: 1.1;
}

.legal-updated {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  margin: 0;
}

.legal-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 22px 0 0;
}

.legal-divider span {
  display: inline-block;
  width: 64px;
  height: 1px;
  background: var(--border-color);
}

.legal-prose {
  font-family: 'Andada Pro', Georgia, serif;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--text-primary);
}

.legal-prose p {
  margin: 0 0 1.1em;
}

.legal-prose h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  margin: 2.2em 0 0.8em;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  letter-spacing: -0.005em;
  scroll-margin-top: 80px;
}

.legal-prose h2:first-child {
  margin-top: 0;
}

.legal-prose ul {
  margin: 0 0 1.2em;
  padding-left: 1.4em;
}

.legal-prose li {
  margin: 0 0 0.5em;
}

.legal-prose strong {
  font-weight: 700;
  color: var(--text-primary);
}

.legal-prose a {
  color: var(--text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--border-color);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.legal-prose a:hover {
  color: var(--accent-color, var(--text-primary));
  border-bottom-color: var(--accent-color, var(--text-primary));
}

@media (max-width: 600px) {
  .legal-title {
    font-size: 1.85rem;
  }
  .legal-prose {
    font-size: 0.95rem;
    line-height: 1.7;
  }
  .legal-prose h2 {
    font-size: 1.18rem;
  }
  .contact-page-title {
    font-size: 1.75rem;
  }
  .contact-page-info-row {
    grid-template-columns: 70px 1fr;
    gap: 10px;
  }
}

/* /vnd-interest - reuses .sgd-page hero/chart system. The indicator groups
   render as a "ticker board": ledger cells with tabular figures and a
   directional glyph, rather than a plain data table. */
.vnd-updated {
  margin-top: 18px;
  font-size: 0.86rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}
.vnd-updated .sgd-skel {
  display: inline-block;
  width: min(280px, 60%);
  height: 0.9em;
  vertical-align: middle;
}
.vnd-stat-section + .vnd-stat-section {
  margin-top: 24px;
}

.vnd-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}
.vnd-tick {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 122px;
  padding: 16px 18px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.vnd-tick:hover {
  background: var(--surface-2);
}
.vnd-tick-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.vnd-tick-label {
  margin: 0;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-tertiary);
  line-height: 1.4;
}
.vnd-tick-glyph {
  flex: none;
  font-size: 0.68rem;
  line-height: 1.5;
  color: var(--text-tertiary);
  opacity: 0.6;
}
.vnd-tick[data-trend='up'] .vnd-tick-glyph {
  color: var(--positive-color);
  opacity: 1;
}
.vnd-tick[data-trend='down'] .vnd-tick-glyph {
  color: var(--negative-color);
  opacity: 1;
}
.vnd-tick-value {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  line-height: 1.05;
}
.vnd-tick-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.vnd-tick-delta {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}
.vnd-tick-delta.is-positive { color: var(--positive-color); }
.vnd-tick-delta.is-negative { color: var(--negative-color); }
.vnd-tick-period {
  font-size: 0.68rem;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.vnd-tick-prev {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-tertiary);
  opacity: 0.75;
}
.vnd-tick--skel {
  gap: 12px;
  justify-content: flex-start;
}
.vnd-tick--skel .sgd-skel-value--sm {
  margin-top: 4px;
}
.vnd-board-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 18px;
  font-size: 0.86rem;
  color: var(--text-tertiary);
  text-align: center;
}
@media (max-width: 480px) {
  .vnd-board {
    grid-template-columns: 1fr;
  }
}

.vnd-error {
  margin: 24px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--border-light);
  border-left-width: 3px;
  border-left-color: var(--accent, currentColor);
  border-radius: 6px;
  background: var(--card-bg, transparent);
  color: var(--text-muted);
  font-size: 0.92rem;
}
.vnd-section-head-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Rate-history chart - interbank overnight rate. --vnd-line-overnight is
   declared on the shared .sgd-page root (both /vnd and /sgd use it) so the
   /sgd overlay series resolves the same color. */
.sgd-line--overnight { stroke: var(--vnd-line-overnight); }
.sgd-dot--overnight   { fill: var(--vnd-line-overnight); }
.sgd-tt-swatch--overnight { background: var(--vnd-line-overnight); }
.sgd-legend-swatch--overnight { background: var(--vnd-line-overnight); }

.vnd-history-note {
  margin: 0 0 14px;
  font-size: 0.82rem;
  color: var(--text-tertiary);
}
.vnd-history-note .sgd-skel {
  display: inline-block;
  width: min(360px, 70%);
  height: 0.9em;
  vertical-align: middle;
}

/* ────────────────────────────────────────────────────────────────────
   Editorial glossary - "Reading the numbers"
   A reference-manual treatment: italic Playfair numerals as chapter
   anchors, hairline rules, small-caps labels, no card chrome.
   ──────────────────────────────────────────────────────────────────── */

.vnd-glossary {
  position: relative;
  margin: 64px 0 28px;
  padding: 60px 0 8px;
  border-top: 1px solid var(--border-light);
}

/* Diamond ornament centered atop the opening rule. */
.vnd-glossary::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 11px;
  height: 11px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  transform: translateX(-50%) rotate(45deg);
}

/* ── Glossary head: title page ─────────────────────────────────────── */
.vnd-glossary-head {
  max-width: 640px;
  margin: 0 auto 64px;
  text-align: center;
}
.vnd-glossary-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 24px;
  padding: 0;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.vnd-glossary-mark {
  width: 5px;
  height: 5px;
  background: var(--accent-color);
  transform: rotate(45deg);
  opacity: 0.85;
}
.vnd-glossary-title {
  margin: 0 0 22px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.012em;
  color: var(--text-primary);
}
.vnd-glossary-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-color);
}
.vnd-glossary-lede {
  max-width: 56ch;
  margin: 0 auto;
  font-family: 'Andada Pro', Georgia, serif;
  font-size: 1.02rem;
  line-height: 1.72;
  color: var(--text-secondary);
}
.vnd-glossary-meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin: 28px 0 0;
  padding: 12px 22px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}
.vnd-glossary-meta b {
  color: var(--text-primary);
  font-weight: 600;
}
.vnd-meta-sep {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

/* ── Chapter jump-nav ──────────────────────────────────────────────── */
.vnd-chapter-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 0 56px;
}
.vnd-chapter-nav-item {
  --chapter-accent: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px 9px 12px;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}
.vnd-chapter-nav-item[data-chapter='rates']    { --chapter-accent: var(--vnd-chapter-rates); }
.vnd-chapter-nav-item[data-chapter='growth']   { --chapter-accent: var(--vnd-chapter-growth); }
.vnd-chapter-nav-item[data-chapter='fx']       { --chapter-accent: var(--vnd-chapter-fx); }
.vnd-chapter-nav-item[data-chapter='reserves'] { --chapter-accent: var(--vnd-chapter-reserves); }
.vnd-chapter-nav-item:hover,
.vnd-chapter-nav-item:focus-visible {
  border-color: var(--chapter-accent);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--chapter-accent) 8%, transparent);
}
.vnd-chapter-nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--chapter-accent);
}
.vnd-chapter-nav-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 0.9rem;
  color: var(--chapter-accent);
}

/* ── Chapter ───────────────────────────────────────────────────────── */
.vnd-chapter {
  --chapter-accent: var(--text-tertiary);
  scroll-margin-top: 88px;
}
.vnd-chapter[data-chapter='rates']    { --chapter-accent: var(--vnd-chapter-rates); }
.vnd-chapter[data-chapter='growth']   { --chapter-accent: var(--vnd-chapter-growth); }
.vnd-chapter[data-chapter='fx']       { --chapter-accent: var(--vnd-chapter-fx); }
.vnd-chapter[data-chapter='reserves'] { --chapter-accent: var(--vnd-chapter-reserves); }
.vnd-chapter + .vnd-chapter {
  margin-top: 56px;
}
.vnd-chapter-head {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: end;
  column-gap: 22px;
  margin-bottom: 32px;
}
.vnd-chapter-numeral {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.6rem, 5.4vw, 3.8rem);
  font-style: italic;
  font-weight: 400;
  line-height: 0.78;
  letter-spacing: -0.05em;
  color: var(--chapter-accent);
  opacity: 0.8;
  /* Optical alignment with the title baseline */
  margin-bottom: -2px;
}
.vnd-chapter-title {
  margin: 0;
  padding-bottom: 6px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-primary);
  white-space: nowrap;
}
.vnd-chapter-rule {
  display: block;
  height: 1px;
  margin-bottom: 12px;
  background: linear-gradient(
    90deg,
    var(--chapter-accent) 0%,
    var(--border-light) 70%,
    transparent 100%
  );
  opacity: 0.6;
}
.vnd-chapter-count {
  padding-bottom: 6px;
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
}

/* ── Entries list ──────────────────────────────────────────────────── */
.vnd-entries {
  list-style: none;
  margin: 0;
  padding: 0;
}
.vnd-entry {
  position: relative;
  display: grid;
  grid-template-columns: 84px 1fr;
  column-gap: 28px;
  padding: 26px 4px 30px;
  border-top: 1px dashed var(--border-light);
  transition: background-color 0.25s ease;
}
.vnd-entry:first-child {
  border-top: 1px solid var(--border-color);
}
.vnd-entry:last-child {
  border-bottom: 1px solid var(--border-color);
}

/* The accent dash that slides in on hover, anchored at left margin */
.vnd-entry::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 32px;
  width: 0;
  height: 1px;
  background: var(--chapter-accent);
  transition: width 0.32s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.vnd-entry:hover {
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--chapter-accent) 7%, transparent) 0%,
    transparent 60%
  );
}
.vnd-entry:hover::before {
  width: 24px;
}

.vnd-entry-counter {
  font-family: 'SF Mono', Monaco, 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--text-tertiary);
  padding-top: 8px;
  align-self: start;
  /* Hairline below counter, decorative */
  position: relative;
}
.vnd-entry-counter::after {
  content: '';
  position: absolute;
  left: 0;
  top: 25px;
  width: 22px;
  height: 1px;
  background: var(--border-color);
  transition: background 0.25s ease, width 0.25s ease;
}
.vnd-entry:hover .vnd-entry-counter {
  color: var(--text-secondary);
}
.vnd-entry:hover .vnd-entry-counter::after {
  background: var(--chapter-accent);
  width: 30px;
}

.vnd-entry-body {
  min-width: 0;
}
.vnd-entry-title {
  margin: 0 0 14px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.18rem, 1.7vw, 1.32rem);
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: -0.008em;
  color: var(--text-primary);
}

.vnd-entry-def {
  margin: 0 0 16px;
  font-family: 'Andada Pro', Georgia, serif;
  font-size: 0.96rem;
  line-height: 1.68;
  color: var(--text-secondary);
}
.vnd-entry-def em {
  font-style: italic;
  color: var(--text-primary);
  font-weight: 500;
}

/* Signal callout - the "so what" half of each entry, set apart from the
   plain definition above it so the two read as distinct tiers, not a
   uniform stack of dt/dd rows. */
.vnd-entry-signal {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  padding: 14px 18px 14px 16px;
  border-left: 2px solid var(--chapter-accent);
  background: color-mix(in srgb, var(--chapter-accent) 6%, transparent);
}
.vnd-entry-signal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  color: var(--chapter-accent);
  background: color-mix(in srgb, var(--chapter-accent) 14%, transparent);
}
.vnd-entry-signal-body {
  min-width: 0;
}
.vnd-entry-signal-tag {
  display: block;
  margin: 0 0 6px;
  font-family: 'Be Vietnam Pro', system-ui, sans-serif;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--chapter-accent);
}
.vnd-entry-signal-body p {
  margin: 0;
  font-family: 'Andada Pro', Georgia, serif;
  font-size: 0.94rem;
  line-height: 1.66;
  color: var(--text-secondary);
}
.vnd-entry-signal-body p em {
  font-style: italic;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Closing ornament ──────────────────────────────────────────────── */
.vnd-glossary-end {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 56px auto 8px;
  max-width: 240px;
  color: var(--border-color);
}
.vnd-glossary-end-rule {
  flex: 1;
  height: 1px;
  background: currentColor;
}
.vnd-glossary-end-mark {
  width: 6px;
  height: 6px;
  background: var(--accent-color);
  transform: rotate(45deg);
  opacity: 0.7;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .vnd-glossary {
    margin-top: 48px;
    padding-top: 44px;
  }
  .vnd-glossary-head {
    text-align: left;
    margin-bottom: 44px;
  }
  .vnd-glossary-eyebrow { gap: 10px; letter-spacing: 0.24em; }
  .vnd-glossary-lede { margin: 0; max-width: none; }
  .vnd-glossary-meta { justify-content: flex-start; }

  .vnd-chapter-nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    margin: 0 0 40px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .vnd-chapter-nav-item { flex: 0 0 auto; }

  .vnd-chapter + .vnd-chapter { margin-top: 44px; }
  .vnd-chapter-head {
    grid-template-columns: auto 1fr auto;
    column-gap: 14px;
    row-gap: 4px;
    align-items: baseline;
    margin-bottom: 22px;
  }
  .vnd-chapter-numeral {
    grid-row: span 2;
    margin-bottom: 0;
  }
  .vnd-chapter-title {
    white-space: normal;
    padding-bottom: 0;
    letter-spacing: 0.16em;
    font-size: 0.78rem;
  }
  .vnd-chapter-rule { display: none; }

  .vnd-entry {
    grid-template-columns: 1fr;
    row-gap: 14px;
    column-gap: 0;
    padding: 22px 0 24px;
  }
  .vnd-entry-counter {
    padding-top: 0;
    font-size: 0.68rem;
    color: var(--text-secondary);
  }
  .vnd-entry-counter::after { display: none; }
  .vnd-entry-title { margin-bottom: 12px; }

  .vnd-entry-signal {
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }
  .vnd-entry-signal-icon { display: none; }
}
