/* Reset & base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
}

body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
  color: #222;
  background: #fff;
  margin: 0;
  padding: 0;
}

/* Wrapper */
.wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid #e8e8e8;
  padding: 1.25rem 0;
  margin-bottom: 2rem;
}

.site-header .wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s;
}

.site-title:hover { color: #1a6bb5; }

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

.site-nav .page-link {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: #1a6bb5;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.2s;
  border-radius: 4px;
}

.site-nav .page-link + .page-link {
  margin-left: 1.25rem;
  padding-left: 1.25rem;
  border-left: 1px solid #e8e8e8;
}

.site-nav .page-link:hover { color: #0d4a82; }

.site-nav .page-link:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

/* Home call-to-action buttons */
.home-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 2rem;
}

.home-cta__btn {
  display: inline-block;
  text-decoration: none;
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  color: #fff;
  background: #222;
  border: 1px solid #222;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.home-cta__btn:hover { background: #444; border-color: #444; }

.home-cta__btn--secondary {
  color: #222;
  background: #fff;
}

.home-cta__btn--secondary:hover {
  background: #f5f5f5;
  color: #222;
  border-color: #999;
}

/* Post list (home) */
.home h2.post-list-heading {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  border-bottom: 1px solid #e8e8e8;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

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

.post-list li {
  margin-bottom: 2rem;
}

.post-meta {
  font-size: 0.85rem;
  color: #888;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.post-list h3 { margin: 0.25rem 0 0.5rem; }

.post-link {
  font-size: 1.3rem;
  font-weight: 700;
  color: #222;
  text-decoration: none;
}

.post-link:hover { text-decoration: underline; }

.post-excerpt {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

/* AI Summary */
.ai-summary {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}

.ai-summary__heading {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin: 0 0 0.5rem;
}

.ai-summary__text {
  font-size: 0.95rem;
  color: #222;
  margin: 0 0 0.75rem;
  line-height: 1.6;
}

.ai-summary__cta {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #888;
  margin: 0;
  font-style: italic;
}

/* AI Meter */
.ai-meter {
  display: block;
  width: 50%;
  margin: 0 0 0.75rem 0;
  padding: 0;
  background: transparent;
  border: none;
  float: right;
  clear: right;
}

.ai-meter__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.3rem;
}

.ai-meter__heading {
  font-size: 0.65rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin: 0;
}

.ai-meter__info-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem;
  background: none;
  border: none;
  color: #1a6bb5;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.ai-meter__info-btn:hover {
  background: rgba(26, 107, 181, 0.1);
  color: #0d4a82;
}

.ai-meter__info-btn:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.ai-meter__thermometer {
  position: relative;
  margin-bottom: 0.3rem;
}

.ai-meter__track {
  position: relative;
  height: 10px;
  background: linear-gradient(to right, #e3f2fd 0%, #fff8e1 50%, #f1f8e9 100%);
  border: 1px solid #e8e8e8;
  border-radius: 5px;
  overflow: hidden;
}

.ai-meter__fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to right, #1976d2, #4caf50);
  border-radius: 5px 0 0 5px;
  transition: width 0.3s ease;
}

.ai-meter__icons {
  display: flex;
  justify-content: space-between;
  margin-top: 0.2rem;
}

.ai-meter__icon {
  display: inline-flex;
  align-items: center;
  color: #888;
}

.ai-meter__icon--ai svg {
  stroke: #1976d2;
  width: 12px;
  height: 12px;
}

.ai-meter__icon--human svg {
  stroke: #4caf50;
  width: 12px;
  height: 12px;
}

.ai-meter__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.65rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #1a6bb5;
  background: none;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.ai-meter__toggle:hover {
  background: #fff;
  border-color: #1a6bb5;
}

.ai-meter__toggle:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.ai-meter__toggle-text {
  font-weight: 500;
}

.ai-meter__toggle-icon {
  transition: transform 0.2s;
}

.ai-meter__details {
  margin-top: 0.6rem;
  padding-top: 0.6rem;
  border-top: 1px solid #e8e8e8;
}

.ai-meter__dimensions {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ai-meter__dimension {
  display: grid;
  grid-template-columns: 70px 1fr 35px;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.ai-meter__dimension:last-child {
  margin-bottom: 0;
}

.ai-meter__dimension-label {
  font-size: 0.65rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #888;
  text-transform: capitalize;
}

.ai-meter__dimension-bar {
  position: relative;
  height: 6px;
  background: #f0f0f0;
  border-radius: 3px;
  overflow: hidden;
}

.ai-meter__dimension-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(to right, #1976d2, #4caf50);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.ai-meter__dimension-value {
  font-size: 0.65rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #888;
  text-align: right;
  font-weight: 400;
}

/* AI Meter Modal */
.ai-meter-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.ai-meter-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.ai-meter-modal__content {
  position: relative;
  max-width: 560px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1;
}

.ai-meter-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid #e8e8e8;
}

.ai-meter-modal__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: #222;
}

.ai-meter-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem;
  background: none;
  border: none;
  color: #555;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

.ai-meter-modal__close:hover {
  background: #f5f5f5;
  color: #222;
}

.ai-meter-modal__close:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.ai-meter-modal__body {
  padding: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #222;
}

.ai-meter-modal__body p {
  margin: 0 0 1rem;
}

.ai-meter-modal__body p:last-child {
  margin-bottom: 0;
}

.ai-meter-modal__body ul {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.ai-meter-modal__body li {
  margin-bottom: 0.5rem;
}

.ai-meter-modal__body strong {
  color: #222;
  font-weight: 600;
}

/* Chart fullscreen functionality */
.chart-fullscreen-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.75rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  color: #1a6bb5;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.chart-fullscreen-btn:hover {
  background: #fff;
  border-color: #1a6bb5;
  color: #0d4a82;
}

.chart-fullscreen-btn:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.chart-fullscreen-btn svg {
  width: 14px;
  height: 14px;
  margin-right: 0.35rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.chart-fullscreen-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.chart-fullscreen-modal--active {
  display: flex;
}

.chart-fullscreen-modal__overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(2px);
}

.chart-fullscreen-modal__content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  max-height: 800px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

.chart-fullscreen-modal__header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #e8e8e8;
  flex-shrink: 0;
}

.chart-fullscreen-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.75rem;
  background: none;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  color: #555;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.chart-fullscreen-modal__close:hover {
  background: #f5f5f5;
  color: #222;
  border-color: #ccc;
}

.chart-fullscreen-modal__close:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.chart-fullscreen-modal__close svg {
  width: 14px;
  height: 14px;
  margin-right: 0.35rem;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.chart-fullscreen-modal__body {
  flex: 1;
  padding: 1.5rem;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-fullscreen-modal__body canvas {
  /* Chart.js controls canvas dimensions; no CSS overrides */
}

@media (max-width: 600px) {
  .chart-fullscreen-modal__content {
    max-width: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .chart-fullscreen-modal__header {
    padding: 0.5rem 0.75rem;
  }

  .chart-fullscreen-modal__body {
    padding: 0.75rem;
    align-items: stretch;
    min-height: min(72vh, 560px);
  }

  .chart-fullscreen-modal__body canvas {
    /* Chart.js controls canvas dimensions; no CSS overrides */
  }

  .chart-fullscreen-btn {
    /* On mobile, flow the button naturally above the canvas instead of
       overlapping the Chart.js title with absolute positioning. */
    position: static;
    display: flex;
    width: fit-content;
    margin-left: auto;
    margin-bottom: 0.35rem;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    box-shadow: none;
  }

  .chart-fullscreen-btn svg {
    width: 12px;
    height: 12px;
    margin-right: 0.25rem;
  }
}

/* Table of Contents */
.toc {
  margin: 0 0 2rem;
  padding: 1rem 1.25rem;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}

.toc__heading {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin: 0 0 0.75rem;
}

.toc__list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: toc-h2;
}

.toc__item {
  margin: 0.25rem 0;
  font-size: 0.95rem;
}

.toc__item:not(.toc__item--sub) {
  counter-increment: toc-h2;
  counter-reset: toc-h3;
}

.toc__item:not(.toc__item--sub)::before {
  content: counter(toc-h2) ". ";
}

.toc__item--sub {
  margin-left: 1.5rem;
  font-size: 0.9rem;
  counter-increment: toc-h3;
}

.toc__item--sub::before {
  content: counter(toc-h2) "." counter(toc-h3) " ";
}

.toc__link {
  color: #1a6bb5;
  text-decoration: none;
}

.toc__link:hover {
  color: #0d4a82;
  text-decoration: underline;
}

.toc__link:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

/* Post */
.post-header {
  margin-bottom: 2rem;
  overflow: auto;
}

.post-title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.5rem;
}

.post-content h2 { font-size: 1.4rem; margin-top: 2.5rem; }
.post-content h3 { font-size: 1.15rem; margin-top: 2rem; }

.post-content a { color: #1a6bb5; }
.post-content a:hover { color: #0d4a82; }

/* Footnote references (kramdown automatic styling) */
.post-content sup {
  line-height: 0;
}

.post-content .footnote,
.post-content .reversefootnote {
  text-decoration: none;
  padding: 0 0.2em;
}

.post-content .footnote:hover,
.post-content .reversefootnote:hover {
  text-decoration: underline;
}

/* Footnotes section */
.post-content .footnotes {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8e8e8;
  font-size: 0.9rem;
  color: #555;
}

.post-meta-section {
  margin-top: 3rem;
}

.post-meta-section .expand-detail__toggle {
  width: 100%;
  justify-content: flex-start;
  padding: 0.55rem 0.85rem;
}

.expand-detail__body > .glossary-section,
.expand-detail__body > .footnotes {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.post-content .footnotes::before {
  content: "References";
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  margin-bottom: 1rem;
}

.post-content .footnotes ol {
  padding-left: 1.5rem;
}

.post-content .footnotes li {
  margin-bottom: 0.75rem;
  scroll-margin-top: 2rem;
  border-radius: 4px;
}

.post-content .footnotes li.footnote-target--highlighted,
.glossary-entry.footnote-target--highlighted {
  background: #fff3cd;
}

.post-content .footnotes p {
  margin: 0;
}

/* PDF link styling (distinctive icon) */
.post-content a[href$=".pdf"]::after {
  content: " \1F4C4";  /* 📄 Document emoji */
  font-size: 0.85em;
  opacity: 0.7;
}

.post-content blockquote {
  border-left: 4px solid #e8e8e8;
  margin: 1.5rem 0;
  padding: 0.5rem 1.25rem;
  color: #555;
  font-style: italic;
}

.post-content code {
  background: #f5f5f5;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.875em;
}

.post-content pre {
  background: #f5f5f5;
  padding: 1rem;
  overflow-x: auto;
  border-radius: 4px;
}

.post-content pre code {
  background: none;
  padding: 0;
}

/* Responsive iframe wrapper */
.iframe-container {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}

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

/* MathJax display equations — scroll horizontally on narrow viewports */
mjx-container[display="true"] {
  display: block !important;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100% !important;
  -webkit-overflow-scrolling: touch;
}

/* Chart wrapper */
.chart-container {
  position: relative;
  width: 100%;
  margin: 2rem 0;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e8e8e8;
  padding: 1.5rem 0;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: #888;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* Utility */
@media (max-width: 600px) {
  body { font-size: 16px; }
  .post-title { font-size: 1.5rem; }

  .ai-meter {
    width: 100%;
    float: none;
  }

  .ai-meter__dimension {
    grid-template-columns: 65px 1fr 35px;
    gap: 0.35rem;
  }

  .ai-meter-modal__content {
    max-width: 100%;
    max-height: 90vh;
  }

  .ai-meter-modal__header {
    padding: 1rem;
  }

  .ai-meter-modal__body {
    padding: 1rem;
  }
}

/* Tags */
.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #f0f0f0;
  color: #555;
  padding: 0.15em 0.6em;
  border-radius: 3px;
  text-transform: lowercase;
}

/* Articles page */
.articles-heading {
  font-size: 2rem;
  margin: 0 0 1.5rem;
}

.articles-search {
  margin-bottom: 1rem;
}

.search-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus {
  border-color: #1a6bb5;
}

.tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
}

.tag-filter {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #f0f0f0;
  color: #555;
  border: 1px solid #ddd;
  padding: 0.25em 0.75em;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.tag-filter:hover {
  background: #e0e0e0;
}

.tag-filter.active {
  background: #222;
  color: #fff;
  border-color: #222;
}

.tag-toggle {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: transparent;
  color: #1a6bb5;
  border: 1px dashed #c8c8c8;
  padding: 0.25em 0.75em;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.tag-toggle:hover {
  background: #f4f8fc;
  border-color: #1a6bb5;
}

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

.article-item {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #f0f0f0;
}

.article-item:last-child {
  border-bottom: none;
}

.no-results {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: #888;
  font-style: italic;
}

.random-article-btn {
  font-size: 0.875rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-style: normal;
  color: #1a6bb5;
  background: none;
  border: 1px solid #1a6bb5;
  border-radius: 20px;
  padding: 0.2em 0.75em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.random-article-btn:hover {
  background: #1a6bb5;
  color: #fff;
}

.random-article-btn:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

/* Engagement section */
.post-engagement {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e8e8e8;
}

/* Engagement bar – 4-button row */
.engagement-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.engagement-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.engagement-btn:hover {
  background: #e8e8e8;
}

.engagement-btn--active {
  background: #e8f0fe;
  border-color: #1a6bb5;
}

.engagement-btn__icon {
  font-size: 1rem;
  line-height: 1;
}

.engagement-btn__label {
  font-weight: 600;
  color: #333;
}

.engagement-btn__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
}

/* Sign-in prompt (shown on demand) */
.engagement-signin[hidden] {
  display: none;
}

/* Unsubscribe note (shown briefly after toggling off) */
.engagement-unsub-note {
  font-size: 0.8rem;
  color: #666;
  margin: -0.75rem 0 1rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.engagement-signin__inner {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
}

.engagement-signin__note {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 0.75rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

/* Comments & Reactions */
.comments-note {
  font-size: 0.85rem;
  color: #888;
  margin: 0 0 1rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.comments-empty {
  font-style: italic;
}

/* Auth forms */
.comments-auth {
  margin-bottom: 1.5rem;
}

.auth-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 480px;
}

.auth-input {
  flex: 1 1 200px;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.auth-input:focus {
  border-color: #1a6bb5;
}

.auth-button {
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  color: #fff;
  background: #222;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.auth-button:hover {
  background: #444;
}

.auth-button:disabled {
  background: #999;
  cursor: default;
}

.auth-message {
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  margin: 0.5rem 0 0;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
}

.auth-message--success {
  color: #155724;
  background: #d4edda;
}

.auth-message--error {
  color: #721c24;
  background: #f8d7da;
}

/* Embedded browser warning (e.g. Gmail in-app browser) */
.auth-embedded-warning {
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
}

.auth-embedded-warning p {
  margin: 0 0 0.35rem;
}

.auth-embedded-warning p:last-child {
  margin-bottom: 0;
}

/* Auth error banner (persistent, dismissable) */
.auth-error-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #721c24;
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  border-radius: 6px;
}

.auth-error-banner[hidden] {
  display: none;
}

.auth-error-banner__message {
  flex: 1;
  word-break: break-word;
}

.auth-error-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
  align-items: center;
}

.auth-error-banner__copy,
.auth-error-banner__dismiss {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  padding: 0.15em 0.35em;
  border-radius: 3px;
  color: #721c24;
}

.auth-error-banner__copy:hover,
.auth-error-banner__dismiss:hover {
  background: rgba(0, 0, 0, 0.08);
}

.auth-link-button {
  background: none;
  border: none;
  color: #1a6bb5;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

.auth-link-button:hover {
  color: #0d4a82;
}

/* Signed-in user bar */
.comments-user-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  margin-bottom: 1rem;
  color: #555;
}

/* Comment form */
.comment-form {
  margin-bottom: 1.5rem;
}

.comment-reply-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: #f5f5f5;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #555;
}

.comment-reply-context__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.comment-input {
  width: 100%;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s;
  margin-bottom: 0.5rem;
}

.comment-input:focus {
  border-color: #1a6bb5;
}

/* Comments list */
.comments-list {
  margin-top: 1rem;
}

.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.comment--nested {
  margin-left: 1rem;
  padding-left: 0.75rem;
  border-left: 2px solid #e8e8e8;
}

.comment--depth-2 {
  margin-left: 1.5rem;
}

.comment--depth-3 {
  margin-left: 2rem;
}

.comment--depth-4 {
  margin-left: 2.5rem;
}

.comment--depth-5 {
  margin-left: 3rem;
}

.comment-children {
  margin-top: 0.35rem;
}

.comment:last-child {
  border-bottom: none;
}

.comment-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.comment-depth-label {
  font-size: 0.75rem;
  color: #888;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-weight: normal;
}

.comment-author {
  font-size: 0.9rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #222;
}

.comment-time {
  font-size: 0.8rem;
  color: #888;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.comment-body {
  font-size: 0.95rem;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-reply-btn {
  margin-top: 0.45rem;
  padding: 0;
  border: none;
  background: none;
  color: #1a6bb5;
  font-size: 0.82rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  cursor: pointer;
  text-decoration: underline;
  transition: color 0.2s;
}

.comment-reply-btn:hover {
  color: #0d4a82;
}

.comment-reply-btn:focus,
.comment-reply-context__cancel:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

/* Legacy reactions (kept for backward compatibility) */
.reactions {
  margin-bottom: 1.5rem;
}

.reactions-bar {
  display: flex;
  gap: 0.5rem;
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.95rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.reaction-btn:hover {
  background: #e8e8e8;
}

.reaction-btn--active {
  background: #e8f0fe;
  border-color: #1a6bb5;
}

.reaction-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.reaction-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: #555;
}

/* Subscribe section */
.subscribe-section {
  margin-top: 3rem;
  padding: 2rem 0;
  border-top: 1px solid #e8e8e8;
}

.subscribe-heading {
  font-size: 1.25rem;
  margin: 0 0 0.25rem;
}

.subscribe-description {
  color: #555;
  margin: 0 0 1rem;
  font-size: 0.95rem;
}

.subscribe-form__fields {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 480px;
}

.subscribe-form__input {
  flex: 1 1 200px;
  padding: 0.55rem 0.75rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
}

.subscribe-form__input:focus {
  border-color: #1a6bb5;
}

.subscribe-form__button {
  padding: 0.55rem 1.25rem;
  font-size: 0.95rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  color: #fff;
  background: #222;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.subscribe-form__button:hover {
  background: #444;
}

/* Honeypot — visually hidden from users, catches bots */
.subscribe-form__hp {
  position: absolute;
  left: -9999px;
  height: 0;
  width: 0;
  overflow: hidden;
  opacity: 0;
}

/* Subscribe opt-in checkbox in standalone subscribe form */
.subscribe-auth-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #555;
  margin-top: 0.5rem;
  cursor: pointer;
}

.subscribe-auth-option input[type="checkbox"] {
  margin: 0;
  cursor: pointer;
}

/* Signed-in subscribe state */
.subscribe-signed-in[hidden] {
  display: none;
}

.subscribe-signed-in {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  max-width: 480px;
}

.subscribe-signed-in__text {
  font-size: 0.9rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #555;
  margin: 0;
}

.subscribe-signed-in__status {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #155724;
}

/* Subscribe prompt for signed-in users */
.subscribe-prompt {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.subscribe-prompt__button {
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-weight: 600;
  color: #555;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.subscribe-prompt__button:hover {
  background: #e8e8e8;
  border-color: #ccc;
}

.subscribe-prompt__button:disabled {
  cursor: default;
  opacity: 0.8;
}

.subscribe-prompt__status {
  font-size: 0.8rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #155724;
}

.subscribe-rss {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: #888;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.subscribe-rss a {
  color: #1a6bb5;
  text-decoration: none;
}

.subscribe-rss a:hover {
  text-decoration: underline;
}

/* Screen-reader-only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Footer */
.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.footer-subscribe {
  margin: 0;
}

.footer-subscribe a {
  color: #888;
  text-decoration: none;
  font-size: 0.85rem;
}

.footer-subscribe a:hover {
  color: #222;
}

/* Sign-in page */
.signin-page {
  text-align: center;
  padding: 1.5rem 0;
}

.signin-heading {
  font-size: 1.35rem;
  margin: 0 0 0.2rem;
}

.signin-description {
  color: #555;
  margin: 0 0 1rem;
  font-size: 0.875rem;
}

.signin-form {
  max-width: 300px;
  margin: 0 auto;
}

/* Fix: in a column flex context, flex-basis applies to height; reset it */
.signin-form .auth-input {
  flex: none;
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  font-size: 0.9rem;
}

/* Stacked form layout for sign-in and welcome pages */
.signin-form--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.signin-form__button {
  width: 100%;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
}

/* OTP section on sign-in page (shown as a swap, no border needed) */
.otp-section {
  margin-top: 0;
}

/* OTP code input: monospace font, centered */
#otp-code {
  font-family: "Courier New", Courier, monospace;
  text-align: center;
}

.otp-back-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #1a6bb5;
  background: none;
  border: none;
  text-decoration: none;
  cursor: pointer;
  font-family: "Helvetica Neue", Arial, sans-serif;
  transition: color 0.2s;
}

.otp-back-link:hover {
  color: #0d4a82;
  text-decoration: underline;
}

.otp-back-link:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Welcome page */
.welcome-page {
  text-align: center;
  padding: 2rem 0;
}

.welcome-heading {
  font-size: 1.6rem;
  margin: 0 0 0.5rem;
}

.welcome-text {
  color: #555;
  font-size: 0.95rem;
  margin: 0.5rem 0;
}

.welcome-text a {
  color: #1a6bb5;
}

.welcome-text a:hover {
  color: #0d4a82;
}

.welcome-display-name {
  color: #333;
}

.welcome-sub-section {
  margin: 1.25rem 0;
  padding: 1rem 1.25rem;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: #f5f5f5;
  text-align: center;
}

.welcome-sub-status {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 0.75rem;
}

.welcome-sub-toggle {
  display: inline-block;
  background: #1a6bb5;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  padding: 0.5rem 1.25rem;
  text-decoration: none;
  transition: background 0.2s;
}

.welcome-sub-toggle:hover {
  background: #0d4a82;
}

.welcome-sub-toggle:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.welcome-sub-toggle:disabled {
  background: #888;
  cursor: default;
}

.welcome-sub-toggle--active {
  background: #fff;
  color: #222;
  border: 1px solid #ccc;
}

.welcome-sub-toggle--active:hover {
  background: #f5f5f5;
  border-color: #999;
}

.welcome-sub-logo {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.welcome-status {
  color: #888;
  font-size: 0.95rem;
}

/* Welcome page action buttons */
.welcome-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.welcome-action-btn {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  min-width: 140px;
}

.welcome-action-btn--secondary {
  background: #fff;
  color: #222;
  border: 1px solid #ccc;
}

.welcome-action-btn--secondary:hover {
  background: #f5f5f5;
  border-color: #999;
}

/* Nav user icon */
.nav-user-icon {
  display: inline-flex;
  align-items: center;
  margin-left: 1.25rem;
  padding-left: 1.25rem;
  border-left: 1px solid #e8e8e8;
  color: #1a6bb5;
  text-decoration: none;
  vertical-align: middle;
  transition: color 0.2s;
}

.nav-user-icon:hover { color: #0d4a82; }

.nav-user-icon:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Welcome page — premium member section */
.welcome-premium-section {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e8e8e8;
  border-top: 3px solid #1a6bb5;
  border-radius: 4px;
  background: #f5f5f5;
  text-align: center;
}

.welcome-premium-badge {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a6bb5;
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
}

.welcome-premium-text {
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 1rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.welcome-premium-drafts-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: #1a6bb5;
  color: #fff;
  border-radius: 4px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}

.welcome-premium-drafts-link:hover {
  background: #0d4a82;
  color: #fff;
  text-decoration: none;
}

.welcome-premium-drafts-link:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Sign-in link button (used in engagement prompt) */
.engagement-signin__link {
  display: inline-block;
  text-decoration: none;
  text-align: center;
}

/* ── Simulation Labs ───────────────────────────────────── */

/* Simulation panel container */
.sim-panel {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
}

/* Controls section */
.sim-controls {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e8e8e8;
}

/* Input row (label + input) */
.sim-input-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.sim-input-row label {
  flex: 0 0 auto;
  min-width: 140px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #555;
}

.sim-input-row input[type="number"] {
  flex: 1 1 auto;
  max-width: 200px;
  padding: 0.4rem 0.6rem;
  font-size: 0.95rem;
  font-family: Georgia, "Times New Roman", serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  transition: border-color 0.2s;
}

.sim-input-row input[type="number"]:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-color: #1a6bb5;
}

/* Helper text */
.sim-helper-text {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: #fff;
  border-left: 3px solid #1a6bb5;
  font-size: 0.9rem;
  color: #555;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

.sim-helper-text p {
  margin: 0.5rem 0;
}

.sim-helper-text p:first-child {
  margin-top: 0;
}

.sim-helper-text p:last-child {
  margin-bottom: 0;
}

.sim-helper-text strong {
  color: #222;
  font-weight: 600;
}

/* Status text (e.g., "Running..." or "Completed in 2.3s") */
.sim-status {
  display: inline-block;
  margin-left: 1rem;
  font-size: 0.85rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #888;
  font-style: italic;
}

/* Charts grid */
.sim-charts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.sim-chart-container {
  position: relative;
  background: #fff;
  padding: 1rem;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  min-width: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.sim-chart-container canvas {
  display: block;
}

.sim-chart-caption {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  color: #555;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  border-top: 1px solid #e8e8e8;
  padding-top: 0.5rem;
}

/* Responsive layout */
@media (max-width: 600px) {
  .sim-panel {
    padding: 1rem;
  }

  .sim-input-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
  }

  .sim-input-row label {
    min-width: auto;
  }

  .sim-input-row input[type="number"] {
    width: 100%;
    max-width: 100%;
  }

  .sim-status {
    display: block;
    margin-left: 0;
    margin-top: 0.5rem;
  }

  .sim-chart-container {
    padding: 0.75rem;
  }

  .sim-chart-container canvas {
    /* Chart.js controls canvas dimensions; no CSS overrides */
  }
}

/* ─── Accessibility: Plain-language callout ──────────────────────────────── */
.callout {
  margin: 1.25rem 0;
  padding: 0.85rem 1.1rem;
  background: #f5f5f5;
  border-left: 3px solid #1a6bb5;
  border-radius: 0 4px 4px 0;
}

.callout__heading {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #1a6bb5;
  margin: 0 0 0.4rem;
}

.callout__body {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  color: #222;
  margin: 0;
  line-height: 1.65;
}

/* ─── Accessibility: Expand-for-detail block ─────────────────────────────── */
.expand-detail {
  margin: 1rem 0;
}

.expand-detail__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  padding: 0.35rem 0.75rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a6bb5;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.expand-detail__toggle:hover {
  background: #f5f5f5;
  border-color: #1a6bb5;
}

.expand-detail__toggle:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.expand-detail__icon {
  flex-shrink: 0;
  transition: transform 0.2s;
}

.expand-detail__toggle[aria-expanded="true"] .expand-detail__icon {
  transform: rotate(180deg);
}

.expand-detail__body {
  margin-top: 0.75rem;
  padding: 0.9rem 1.1rem;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.expand-detail__body > *:first-child { margin-top: 0; }
.expand-detail__body > *:last-child  { margin-bottom: 0; }

/* ─── Glossary component ──────────────────────────────────────────────── */
.glossary-section {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e8e8e8;
}

#glossary-wrapper .glossary-section {
  margin-top: 0;
}

.glossary-section__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  margin: 0 0 1rem;
}

.glossary-list {
  margin: 0;
  padding: 0;
}

.glossary-entry {
  margin-bottom: 1.25rem;
  scroll-margin-top: 2rem;
  padding: 0.75rem;
  border-radius: 4px;
  transition: background 0.3s;
}

.glossary-entry:last-child {
  margin-bottom: 0;
}

.glossary-entry--highlighted {
  background: #fff3cd;
}

.glossary-entry__term {
  font-weight: 700;
  font-size: 1rem;
  color: #222;
  margin: 0 0 0.4rem;
}

.glossary-entry__abbr {
  font-weight: 400;
  color: #888;
  font-size: 0.9rem;
  margin-left: 0.3rem;
}

.glossary-entry__definition {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Inline glossary term styling */
.post-content .glossary-term {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: #1a6bb5;
  text-underline-offset: 2px;
  cursor: help;
  color: inherit;
  border: none;
  transition: color 0.2s, text-decoration-color 0.2s;
}

.post-content .glossary-term:hover {
  color: #1a6bb5;
  text-decoration-style: solid;
}

.post-content .glossary-term:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-radius: 2px;
}

/* ─── Accessibility: Difficulty badge ───────────────────────────────────── */
.post-reader-info {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-top: 0.6rem;
}

.difficulty-badge {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  white-space: nowrap;
}

.difficulty-badge--beginner    { background: #e6f2e6; color: #2a6b2a; }
.difficulty-badge--intermediate { background: #fff3cd; color: #7a5a00; }
.difficulty-badge--advanced    { background: #fbe9e9; color: #8b1a1a; }

.post-prerequisites {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: #555;
}

.post-prerequisites strong {
  color: #222;
}

/* ─── Accessibility: Quick Read structured summary ───────────────────────── */
.ai-summary__structured {
  margin: 0 0 0.75rem;
}

.ai-summary__quick {
  margin: 0;
  padding: 0;
}

.ai-summary__quick-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 0.3rem 0.75rem;
  margin-bottom: 0.55rem;
  align-items: baseline;
}

.ai-summary__quick-row:last-child {
  margin-bottom: 0;
}

.ai-summary__quick dt {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #555;
  padding-top: 0.05rem;
}

.ai-summary__quick dd {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.95rem;
  color: #222;
  line-height: 1.6;
  margin: 0;
}

@media (max-width: 520px) {
  .ai-summary__quick-row {
    grid-template-columns: 1fr;
    gap: 0.1rem;
    margin-bottom: 0.75rem;
  }

  .ai-summary__quick dt {
    margin-bottom: 0.15rem;
  }
}

/* ── Ask a Question page ─────────────────────────────── */

.ask-page__header {
  margin-bottom: 2.5rem;
}

.ask-page__header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  color: #222;
}

.ask-page__description {
  font-size: 1rem;
  color: #555;
  margin: 0;
}

.ask-page__submission {
  margin-bottom: 3rem;
}

.ask-page__list h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  color: #222;
}

.ask-page__list-description {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1.5rem;
}

/* Ask form */

.ask-form-header {
  margin-bottom: 1.5rem;
}

.ask-form-header h2 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: #222;
}

.ask-user-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: #555;
  padding: 0.5rem 0;
}

.ask-user-bar strong {
  color: #222;
}

.ask-form {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 1.25rem;
}

.ask-form__label {
  display: block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 0.5rem;
}

.ask-form__input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  font-family: Georgia, "Times New Roman", serif;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
  min-height: 100px;
}

.ask-form__input:focus {
  border-color: #1a6bb5;
}

.ask-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
}

.ask-form__char-count {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  color: #888;
}

/* Sign-in and profile prompts */

.ask-signin {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
}

.ask-signin__note {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1rem;
}

/* Quota counter */

.ask-quota {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.85rem;
  color: #555;
  padding: 0.5rem 0.875rem;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.ask-quota__dots {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}

.ask-quota__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ask-quota__dot--available {
  background: #1a6bb5;
}

.ask-quota__dot--used {
  background: #ccc;
}

.ask-quota__label {
  color: #555;
}

/* Step indicator */

.ask-step {
  display: inline-block;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  background: #f5f5f5;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  padding: 0.25rem 0.75rem;
  margin-bottom: 1rem;
}

.ask-step--retry {
  color: #1a6bb5;
  background: #eef4fb;
  border-color: #c2d9f0;
}

/* Rate limit message */

.ask-rate-limit {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 1.25rem;
  margin-top: 1rem;
}

.ask-rate-limit__message {
  font-size: 0.95rem;
  color: #856404;
  margin: 0 0 0.5rem 0;
}

.ask-rate-limit__upgrade {
  font-size: 0.85rem;
  color: #856404;
  margin: 0;
  font-style: italic;
}

/* Questions list */

.questions-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-card {
  display: flex;
  gap: 1rem;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 1rem;
  transition: box-shadow 0.2s;
}

.question-card:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-card__votes {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.vote-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #888;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.2s;
  line-height: 1;
}

.vote-btn:hover {
  color: #1a6bb5;
}

.vote-btn:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-radius: 4px;
}

.vote-btn--active {
  color: #1a6bb5;
}

.vote-count {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #222;
  min-width: 2rem;
  text-align: center;
}

.question-card__content {
  flex: 1;
  min-width: 0;
}

.question-card__text {
  font-size: 1rem;
  line-height: 1.6;
  color: #222;
  margin: 0 0 0.75rem 0;
}

.question-card__meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
  color: #888;
}

.question-card__author {
  color: #555;
}

.question-card__author strong {
  color: #222;
}

.question-card__answered {
  color: #155724;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.question-card__answered:hover {
  color: #0c3d18;
  text-decoration: underline;
}

.question-card__time {
  color: #888;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.8rem;
}

/* Empty state */

.ask-empty {
  text-align: center;
  padding: 3rem 1rem;
}

.ask-empty__message {
  font-size: 1rem;
  color: #888;
  margin: 0;
}

.ask-error {
  text-align: center;
  padding: 2rem 1rem;
  font-size: 0.95rem;
  color: #721c24;
}

/* Mobile responsiveness */

@media (max-width: 600px) {
  .ask-page__header h1 {
    font-size: 1.5rem;
  }

  .ask-user-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .question-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .question-card__votes {
    flex-direction: row;
    justify-content: center;
  }

  .vote-count {
    order: -1;
    margin-right: 0.5rem;
  }
}

/* ── Moderation dashboard ────────────────────────────── */

/* Wide wrapper for dashboard pages */
.wrapper--wide {
  max-width: 1200px;
}

.moderation-page__header {
  margin-bottom: 1.5rem;
}

.moderation-page__header h1 {
  margin: 0 0 0.4rem;
  color: #222;
}

.moderation-page__description {
  margin: 0;
  color: #555;
}

/* Toolbar: tabs + actions */
.moderation-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.moderation-toolbar__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.moderation-status {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  color: #555;
}

.moderation-status--error {
  color: #721c24;
}

/* Tabs */
.moderation-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid #e8e8e8;
}

.moderation-tab {
  padding: 0.55rem 1.1rem;
  border: none;
  background: none;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.95rem;
  color: #555;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s;
}

.moderation-tab:hover {
  color: #222;
}

.moderation-tab:focus-visible {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.moderation-tab--active {
  color: #222;
  font-weight: 600;
  border-bottom-color: #1a6bb5;
}

.moderation-tab__badge {
  display: inline-block;
  min-width: 1.2em;
  padding: 0 0.35em;
  border-radius: 20px;
  background: #e8e8e8;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  margin-left: 0.25em;
}

.moderation-tab--active .moderation-tab__badge {
  background: #1a6bb5;
  color: #fff;
}

/* Filter pills */
.moderation-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.moderation-filter {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  padding: 0.3rem 0.65rem;
  border: 1px solid #e8e8e8;
  border-radius: 20px;
  background: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
  color: #555;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.moderation-filter:hover {
  border-color: #1a6bb5;
  color: #1a6bb5;
}

.moderation-filter:focus-visible {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

.moderation-filter--active {
  background: #1a6bb5;
  border-color: #1a6bb5;
  color: #fff;
}

.moderation-filter__count {
  font-size: 0.75rem;
  font-weight: 600;
}

.moderation-filter__count::before {
  content: "\00b7";
  margin-right: 0.1em;
}

.moderation-filter--active .moderation-filter__count::before {
  color: rgba(255, 255, 255, 0.7);
}

.moderation-filters__sep {
  width: 1px;
  height: 1.2rem;
  background: #e8e8e8;
  margin: 0 0.2rem;
}

/* Panel (one per tab, full width) */
.moderation-panel {
  /* no border/background — content area under tabs */
}

/* Item list */
.moderation-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Individual card */
.moderation-item {
  border: 1px solid #e8e8e8;
  border-radius: 4px;
  background: #fff;
  padding: 0.65rem 0.85rem;
}

/* Summary row (always visible) */
.moderation-item__summary {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  user-select: none;
}

.moderation-item__summary:focus-visible {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

/* Status pill */
.moderation-item__pill {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 20px;
  background: #222;
  color: #fff;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.72rem;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  white-space: nowrap;
}

.moderation-item__pill--pending { background: #c08a0a; }
.moderation-item__pill--flagged { background: #c9302c; }
.moderation-item__pill--approved,
.moderation-item__pill--visible { background: #449d44; }
.moderation-item__pill--rejected { background: #888; }
.moderation-item__pill--addressed { background: #1a6bb5; }
.moderation-item__pill--hidden { background: #888; }

/* Truncated preview text */
.moderation-item__preview {
  flex: 1;
  min-width: 0;
  color: #222;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Meta (author · date) */
.moderation-item__meta {
  margin: 0;
  font-family: "Helvetica Neue", Arial, sans-serif;
  color: #888;
  font-size: 0.78rem;
  flex-shrink: 0;
  white-space: nowrap;
}

/* Expand/collapse chevron */
.moderation-item__chevron {
  color: #888;
  font-size: 0.82rem;
  flex-shrink: 0;
  transition: color 0.2s;
}

.moderation-item__summary:hover .moderation-item__chevron {
  color: #1a6bb5;
}

/* Expanded detail section */
.moderation-item__detail {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid #e8e8e8;
}

.moderation-item__content {
  margin: 0 0 0.65rem;
  color: #222;
}

/* AI analysis block */
.moderation-item__ai {
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.65rem;
  background: #f5f5f5;
  border-radius: 4px;
  border: 1px solid #e8e8e8;
}

.moderation-item__ai .moderation-item__meta {
  white-space: normal;
}

.moderation-item__link {
  color: #1a6bb5;
  text-decoration: none;
}

.moderation-item__link:hover {
  color: #0d4a82;
  text-decoration: underline;
}

/* Form controls inside detail */
.moderation-item__label {
  display: block;
  margin: 0.6rem 0 0.3rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.82rem;
  color: #555;
}

.moderation-item__select,
.moderation-item__input,
.moderation-item__textarea {
  width: 100%;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  color: #222;
  box-sizing: border-box;
}

.moderation-item__textarea {
  resize: vertical;
}

.moderation-item__select:focus,
.moderation-item__input:focus,
.moderation-item__textarea:focus {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
  border-color: #1a6bb5;
}

.moderation-item__actions {
  margin-top: 0.7rem;
}

/* Empty state */
.moderation-empty {
  margin: 0;
  padding: 2rem 0;
  color: #888;
  font-size: 0.92rem;
  text-align: center;
}

/* Load more button */
.moderation-load-more {
  display: block;
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.35rem;
  border: 1px dashed #ccc;
  border-radius: 4px;
  background: none;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.88rem;
  color: #1a6bb5;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.moderation-load-more:hover {
  border-color: #1a6bb5;
  background: #f5f8fc;
}

.moderation-load-more:focus-visible {
  outline: 2px solid #1a6bb5;
  outline-offset: 2px;
}

/* Responsive */
@media (max-width: 768px) {
  .moderation-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .moderation-item__summary {
    flex-wrap: wrap;
    gap: 0.4rem;
  }

  .moderation-item__preview {
    order: 3;
    flex-basis: 100%;
    white-space: normal;
  }
}

/* ── Willkommen: Admin-Bereich (übernommen vom Premium-Bereich-Stil) ── */
.welcome-admin-section {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  border: 1px solid #e8e8e8;
  border-top: 3px solid #1a6bb5;
  border-radius: 4px;
  background: #f5f5f5;
  text-align: center;
}
.welcome-admin-badge {
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a6bb5;
  margin: 0 0 0.5rem;
  letter-spacing: 0.01em;
}
.welcome-admin-text {
  font-size: 0.9rem;
  color: #555;
  margin: 0 0 1rem;
  font-family: "Helvetica Neue", Arial, sans-serif;
}
.welcome-admin-link {
  display: inline-block;
  padding: 0.5rem 1.25rem;
  background: #1a6bb5;
  color: #fff;
  border-radius: 4px;
  font-family: "Helvetica Neue", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.2s;
}
.welcome-admin-link:hover { background: #0d4a82; color: #fff; text-decoration: none; }
.welcome-admin-link:focus { outline: 2px solid #1a6bb5; outline-offset: 2px; border-radius: 2px; }
