:root {
  /* Logo 411: BLUE #1471b9 · GREEN #8cc640 · Nunito Light / Bold */
  --brand-primary: #1471b9;
  --brand-primary-hover: #0f5f9a;
  --brand-primary-soft: #e8f2fa;
  --brand-primary-ring: rgba(20, 113, 185, 0.38);

  --brand-secondary: #8cc640;
  --brand-secondary-hover: #78b035;
  --brand-secondary-soft: #f2f8e8;

  --ink: #121620;
  --text: #1c2330;
  --muted: #5c6575;
  --muted-2: #8b95a5;
  --border: #e4e8ef;
  --border-strong: #cdd5e3;
  --accent: var(--brand-primary);
  --accent-hover: var(--brand-primary-hover);
  --accent-soft: var(--brand-primary-soft);
  --accent-ring: var(--brand-primary-ring);
  --surface: #ffffff;
  --bg: #f0f2f6;
  --bg-elevated: #f7f8fb;
  --radius: 12px;
  --radius-sm: 8px;
  --font-sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Nunito", system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.07);
  --header-h: 3.25rem;
  /* Content width: narrow on phones; use horizontal space on desktop */
  --container-max: 100%;
  /* Optimal line length for prose; widened on xl screens so desktop doesn’t feel like a thin ribbon */
  --article-measure: 42rem;
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

body.site-shell {
  margin: 0;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(180deg, var(--surface) 0%, var(--bg) 14rem);
  background-repeat: no-repeat;
}

.site-shell .main {
  flex: 1;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 1.5rem;
  }
}

@media (min-width: 900px) {
  :root {
    --container-max: min(72rem, 100% - 3rem);
  }
}

@media (min-width: 1200px) {
  :root {
    --container-max: min(80rem, 100% - 4rem);
    --article-measure: 48rem;
  }
}

@media (min-width: 1440px) {
  :root {
    --article-measure: 52rem;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
  padding: 0.65rem 1.25rem;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
}

@media (min-width: 640px) {
  .header-inner {
    padding: 0.65rem 1.5rem;
  }
}

body.site-shell strong,
body.site-shell b {
  font-weight: 700;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.2;
}

.brand__logo {
  display: block;
  height: 2.25rem;
  width: auto;
  max-width: min(220px, 42vw);
  object-fit: contain;
}

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

.brand:hover .brand__logo {
  opacity: 0.92;
}

.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;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.2rem 0.35rem;
}

.site-nav__link {
  display: inline-block;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: background 0.14s ease, color 0.14s ease;
}

.site-nav__link:hover {
  background: var(--accent-soft);
  color: var(--accent-hover);
}

.site-nav__link:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.site-nav__link--admin {
  color: var(--muted);
  font-weight: 500;
}

.site-nav__link--admin:hover {
  color: var(--text);
  background: var(--bg-elevated);
}

.site-nav__link--muted {
  color: var(--muted-2);
  font-size: 0.9rem;
}

.site-nav__link--muted:hover {
  color: var(--text);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-nav__link--accent {
  font-weight: 600;
}

.main {
  padding: 2.25rem 1.35rem 4rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0 2.5rem;
  background: var(--surface);
  margin-top: auto;
}

.site-footer__inner {
  text-align: center;
}

.site-footer__links {
  margin: 0.5rem 0 0.35rem;
}

.site-footer__links a,
.site-footer__subscribe a {
  color: var(--muted);
  font-weight: 600;
  text-decoration: none;
}

.site-footer__links a:hover,
.site-footer__subscribe a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer__subscribe {
  margin: 0.35rem 0 0.35rem;
}

.site-footer__subscribe-label {
  display: inline-block;
  margin-right: 0.35rem;
  color: var(--muted);
}

.site-footer__tagline {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 28rem;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.5;
}

.site-footer__meta {
  margin: 0;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
}

/* Marketing & optional Site pages (ContentPage) — use container width, centered */
.marketing-page {
  width: 100%;
  max-width: min(72rem, 100%);
  margin-left: auto;
  margin-right: auto;
}

@media (min-width: 1200px) {
  .marketing-page {
    max-width: min(76rem, 100%);
  }
}

.site-page .site-page-body {
  max-width: 100%;
}

.site-page .page-hero {
  max-width: 100%;
}

.marketing-section {
  margin: 0 0 1.75rem;
}

.marketing-section h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.65rem;
}

.marketing-section p {
  margin: 0 0 0.85rem;
}

.marketing-section p:last-child {
  margin-bottom: 0;
}

.marketing-list {
  margin: 0 0 0.85rem;
  padding-left: 1.25rem;
}

.marketing-list li {
  margin-bottom: 0.45rem;
}

.marketing-list li:last-child {
  margin-bottom: 0;
}

.marketing-cta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.marketing-cta a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.marketing-cta a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.marketing-contact-line {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.marketing-contact-line a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.marketing-contact-line a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prospective-clients-page .prospective-clients-intro {
  margin: 0 0 1.75rem;
  padding: 1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 48rem;
}

.admin-form .field-hint {
  margin: 0 0 0.75rem;
  grid-column: 1 / -1;
}

/* Page shells */
.page-hero {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.page-hero__title {
  font-family: var(--font-display);
  font-size: 2.125rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.65rem;
}

.page-hero__lede {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: 42rem;
}

@media (min-width: 900px) {
  .page-hero__lede {
    max-width: 52rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .page-index,
  .page-glossary-index,
  .page-articles-archive,
  .page-briefs-index {
    animation: pageIn 0.35s ease-out;
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.empty-state {
  padding: 2rem 1rem;
  text-align: center;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.breadcrumb a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumb__sep {
  color: var(--muted-2);
  user-select: none;
}

.article-header-hero {
  margin: 0 0 1.25rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.article-header-hero__img {
  display: block;
  width: 100%;
  max-height: 22rem;
  object-fit: cover;
}

/* Brief detail — uses .article-page__title for sizing; link styling only here */
.brief-detail__source-title {
  overflow-wrap: break-word;
}

.brief-detail__source-title-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent);
  text-underline-offset: 0.18em;
}

.brief-detail__external-mark {
  display: inline-block;
  margin-left: 0.2em;
  font-size: 0.85em;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.brief-detail__source-title-link:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.brief-detail__source-title-link:hover + .brief-detail__external-mark {
  color: var(--accent-hover);
}

.brief-detail__source-meta {
  margin: 0 0 1.25rem;
}

/* Brief — OG hero slightly shorter than full articles */
.brief-detail .brief-detail__hero.article-header-hero {
  margin-top: 0;
}

/* Brief hero: same column width as title/body; shorter band than full articles so list thumbnails aren’t huge on click-through */
.brief-detail .brief-detail__hero .article-header-hero__img {
  max-height: 13rem;
  object-fit: cover;
}

@media (min-width: 700px) {
  .brief-detail .brief-detail__hero .article-header-hero__img {
    max-height: 15rem;
  }
}

/* Match OG hero band sizing; same gradient vocabulary as brief list thumbnails */
.brief-detail__hero--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 1.25rem;
  min-height: 7rem;
  max-height: 13rem;
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--border) 120%);
  overflow: hidden;
}

@media (min-width: 700px) {
  .brief-detail__hero--placeholder {
    max-height: 15rem;
  }
}

.brief-detail__hero--placeholder .brief-case-scales-svg--hero {
  width: 28%;
  max-width: 5.75rem;
  height: auto;
  margin: 0;
  opacity: 0.5;
  color: var(--muted-2);
}

/* Brief — staff take: lighter than global .summary-answer card */
.brief-detail .brief-detail__take.summary-answer {
  font-weight: 500;
  margin: 0 0 1.5rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: none;
  background-image: none;
}

.brief-case-section {
  margin: 1.35rem 0;
}

.brief-case-section h2 {
  margin-bottom: 0.55rem;
}

.brief-case-issue-public {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.9rem;
  margin: 0 0 0.75rem;
  background: var(--surface);
}

.brief-case-issue-public h3 {
  margin: 0 0 0.45rem;
}

.article-page__title,
.glossary-term-page .article-page__title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 4vw, 2.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.22;
  color: var(--ink);
  margin: 0 0 1.25rem;
}

.glossary-term-page__summary {
  margin-bottom: 1.5rem !important;
}

.article-meta {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.main a:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
  border-radius: 2px;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.875rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
}

h1:not(.page-hero__title):not(.article-page__title) {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
  margin-top: 0;
}

.article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

@media (min-width: 900px) {
  .page-index .article-list,
  .explore-page.page-index .article-list,
  .page-articles-archive .article-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 1.25rem;
    align-items: stretch;
  }
}

@media (min-width: 1320px) {
  .page-index .article-list,
  .explore-page.page-index .article-list,
  .page-articles-archive .article-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.article-card__thumb-link {
  display: block;
  margin: -0.25rem -0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  line-height: 0;
}

.article-card__thumb {
  width: 100%;
  max-height: 12rem;
  object-fit: cover;
  display: block;
}

/* Brief cards in article-style lists — same band as .article-card__thumb (cover + 12rem) so home / archive rows line up with articles */
.article-card__thumb--brief {
  object-fit: cover;
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--border) 120%);
  max-height: 12rem;
}

/* Case brief with no preview: same box model as list article thumbs (16:9 intent, clamped by 12rem like wide photos) */
.article-card__thumb.article-card__thumb--case-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-height: 12rem;
  aspect-ratio: 16 / 9;
  background: linear-gradient(160deg, var(--bg-elevated) 0%, var(--border) 120%);
}

.article-card__thumb.article-card__thumb--case-fallback .brief-case-scales-svg--card {
  width: clamp(3.5rem, 42%, 7rem);
  height: auto;
  flex-shrink: 0;
  opacity: 0.5;
  color: var(--muted-2);
}

.article-card {
  margin: 0;
  padding: 1.25rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.article-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.article-card__title {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.35;
  text-decoration: none;
  border-radius: 4px;
}

.article-card__title:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.article-card__title:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 3px;
}

.article-card__meta {
  margin: 0.5rem 0 0.65rem;
}

.article-card__summary {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.55;
  color: var(--text);
}

.summary-answer {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0 0 1.75rem;
  padding: 1.15rem 1.3rem;
  background: linear-gradient(135deg, var(--accent-soft) 0%, var(--surface) 55%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-sm);
}

.article-body {
  margin-top: 1rem;
}

/* Article detail: a bit more vertical rhythm than generic pages */
.article.article-page .breadcrumb {
  margin-bottom: 1.5rem;
}

.article-page .summary-answer {
  margin-bottom: 2rem;
  line-height: 1.55;
}

/* Long-form reading: keep line length comfortable inside a wide shell */
@media (min-width: 900px) {
  .article-page .article-page__title {
    max-width: min(var(--article-measure), 100%);
  }

  .article-page .summary-answer,
  .article-page .article-body,
  .article-page .topic-map-callout,
  .article-page .refs,
  .article-page .tags,
  .article-page .article-meta {
    max-width: var(--article-measure);
  }

  .article-page .article-header-hero {
    max-width: var(--article-measure);
  }

  .glossary-term-page .glossary-term-body,
  .glossary-term-page .glossary-term-page__summary {
    max-width: var(--article-measure);
  }

  .article-page .article-body--rich {
    line-height: 1.68;
  }

  .article-page .article-body p {
    margin: 0 0 1.2rem;
  }

  .article-page .article-body h2 {
    margin-top: 2.1rem;
  }
}

.article-body p {
  margin: 0 0 1rem;
}

.article-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.75rem 0 0.75rem;
}

.article-body h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 1.25rem 0 0.5rem;
}

/* Verbatim language from statute, regs, or case law (inline phrases — not the same as bold or IRC cites) */
.article-body--rich .statute-language {
  font-style: italic;
  font-weight: 600;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

/* Native collapsible sections (use &lt;details&gt;&lt;summary&gt;… in body HTML) */
.article-body--rich details {
  margin: 1.25rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.article-body--rich details > summary {
  cursor: pointer;
  padding: 0.65rem 1rem;
  font-weight: 600;
  list-style: none;
}

.article-body--rich details > summary::-webkit-details-marker {
  display: none;
}

.article-body--rich details[open] > summary {
  border-bottom: 1px solid var(--border);
}

.article-body--rich details > *:not(summary) {
  margin: 0;
  padding: 0 1rem 1rem;
}

.article-body--rich details > *:not(summary):first-of-type {
  padding-top: 0.75rem;
}

.article-body--rich details ul,
.article-body--rich details ol {
  margin: 0 0 0.75rem 1.25rem;
}

.article-body--rich details li {
  margin-bottom: 0.35rem;
}

/* Admin: Topic map tree editor */
.topic-map-tree-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.topic-map-tree-root {
  margin-top: 0.75rem;
}

.topic-map-tree__add-root {
  margin-bottom: 1rem;
}

.topic-map-tree__node {
  margin-bottom: 0.75rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.topic-map-tree__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.5rem;
}

.topic-map-tree__title {
  font-weight: 600;
  flex: 1 1 12rem;
}

.topic-map-tree__kind {
  min-width: 10rem;
}

.topic-map-tree__body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.topic-map-tree__parent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.topic-map-tree__parent label {
  font-size: 0.9rem;
  color: var(--muted);
}

.topic-map-tree__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.topic-map-tree__children {
  margin-top: 0.5rem;
  padding-left: 0.5rem;
  border-left: 2px solid var(--accent-soft);
}

/* Admin: Tags + taxonomy autocomplete */
.admin-tag-ac-wrap,
.admin-tax-ac-wrap {
  position: relative;
}

.admin-tag-ac-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 40;
  max-height: 11rem;
  overflow-y: auto;
  margin: 0.2rem 0 0;
  padding: 0.25rem 0;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.admin-tag-ac-list li {
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.admin-tag-ac-list li:hover,
.admin-tag-ac-list li.admin-tag-ac__item--active {
  background: var(--accent-soft);
}

/* Admin: body field help */
.body-format-help {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 0.9rem;
}

.body-format-help > summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--muted);
}

.body-format-help-inner {
  margin-top: 0.75rem;
}

.body-format-help-inner p {
  margin: 0 0 0.75rem;
}

.format-example {
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
  font-size: 0.8rem;
  line-height: 1.4;
  background: #f4f4f4;
  border-radius: 4px;
}

.refs h2 {
  font-size: 1.1rem;
  margin-top: 2rem;
}

.refs a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-guest-contributor {
  margin-top: 1.5rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.article-guest-contributor__headshot {
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border-strong);
}

.tags {
  margin-top: 1.5rem;
}

.tag {
  display: inline-block;
  margin-right: 0.4rem;
  margin-bottom: 0.35rem;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

a.glossary-link {
  color: var(--accent);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
}

a.glossary-link:hover {
  text-decoration-style: solid;
}

.glossary-index {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

@media (min-width: 900px) {
  .glossary-letter-section .glossary-index {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 1rem;
  }
}

@media (min-width: 1320px) {
  .glossary-letter-section .glossary-index {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.glossary-index__item {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.glossary-index__item:hover {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.glossary-index__link {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.glossary-index__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.glossary-index__summary {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.glossary-index__cat {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.12rem 0.45rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
}

.glossary-filters {
  margin: 0 0 1.25rem;
}

.glossary-filters__label {
  margin: 0 0 0.4rem;
}

.glossary-category-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.glossary-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.glossary-chip:hover {
  border-color: rgba(20, 113, 185, 0.45);
  background: var(--accent-soft);
}

.glossary-chip--active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.glossary-chip--active:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.glossary-chip__count {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.85;
}

.glossary-letter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.25rem;
  align-items: center;
  margin: 0 0 1.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.glossary-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  padding: 0.35rem 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid transparent;
}

.glossary-letter:hover {
  background: var(--accent-soft);
  border-color: rgba(20, 113, 185, 0.25);
}

.glossary-letter--active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.glossary-letter--active:hover {
  background: var(--accent-hover);
  color: #fff;
  border-color: var(--accent-hover);
}

.glossary-letter--clear {
  margin-left: 0.35rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--border);
  font-weight: 600;
  font-size: 0.82rem;
}

.glossary-letter-section {
  margin-bottom: 2rem;
  scroll-margin-top: 5rem;
}

.glossary-letter-section__title {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--accent-soft);
}

.glossary-term-body {
  margin-top: 1rem;
}

.glossary-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.glossary-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

.glossary-section ul {
  margin: 0;
  padding-left: 1.25rem;
}

.glossary-section li {
  margin-bottom: 0.4rem;
}

.glossary-gotchas {
  background: #fffdf7;
  border: 1px solid #e8e0c8;
  border-radius: 6px;
  padding: 1rem 1rem 0.25rem;
  margin-top: 1.5rem;
}

.glossary-gotchas h2 {
  color: #5c4a1e;
}

/* Admin */
.admin-dashboard__header.page-hero {
  border-bottom: none;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
}

.admin-dashboard__toolbar {
  margin: 0.75rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.admin-dashboard__toolbar-note {
  margin: 0.35rem 0 0;
  max-width: 42rem;
}

/* Admin — Briefs editor */
.brief-source-url-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}

.brief-source-url-row .wide {
  flex: 1 1 16rem;
  min-width: 0;
}

.brief-related-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.brief-related-link-row .field {
  margin-bottom: 0;
}

.brief-related-link-row__cell {
  flex: 1 1 10rem;
  min-width: 0;
}

.brief-related-link-row__cell--grow {
  flex: 3 1 18rem;
}

.brief-case-issue-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.8rem 0.6rem;
  margin: 0 0 0.85rem;
  background: var(--surface);
}

.brief-case-issue-card__summary {
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin: 0.15rem 0 0.4rem;
}

.brief-case-issue-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.6rem;
}

.admin-form__actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 1.25rem 0 0;
}

.admin-form__actions-row--divider {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.admin-dashboard__h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7.5rem, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.5rem;
}

.admin-stat {
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.admin-stat__value {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.1;
}

.admin-stat__label {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

.admin-stat__sub {
  margin-top: 0.35rem;
}

.admin-section-grid {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.admin-section-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.admin-section-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--ink);
}

.admin-section-card__meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.45;
  flex: 1;
}

.admin-section-card__meta code {
  font-size: 0.85em;
}

.admin-section-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.35rem;
}

.admin-section-grid--wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: 36rem;
}

.staging-snippets-fieldset {
  margin-top: 1.25rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
}

.staging-snippets-fieldset legend {
  font-weight: 600;
  padding: 0 0.35rem;
}

.staging-snippet-row {
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--border);
}

.staging-snippet-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.admin-home {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.admin-home li {
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.admin-home a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.admin-home a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.admin-flash {
  padding: 0.75rem 1rem;
  background: #e8f4e8;
  border: 1px solid #b8d4b8;
  border-radius: 4px;
}

.admin-flash--warn {
  background: #fff8e6;
  border-color: #e6c266;
  color: #4a3b12;
}

.admin-preview-banner {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1.1rem;
  background: var(--brand-primary-soft);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.admin-preview-banner strong {
  font-weight: 700;
  color: var(--brand-primary);
}

.draft-live-url-banner {
  border-color: #c9a227;
  background: #fffbeb;
}

.ai-assist-lede {
  max-width: 42rem;
  line-height: 1.5;
  margin: 0 0 1rem;
}

.ai-assist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ai-assist-actions--wrap {
  flex-wrap: wrap;
}

.admin-callout {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.admin-callout__title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.admin-callout__steps {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
}

.admin-callout__steps li {
  margin: 0.25rem 0;
}

.admin-callout__meta {
  margin: 0.75rem 0 0;
}

.ai-assist-output-wrap {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.ai-assist-output {
  margin-top: 0.75rem;
  padding: 1rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: min(70vh, 36rem);
  overflow: auto;
}

.admin-table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.admin-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.slug-path {
  font-size: 0.8rem;
}

.admin-actions {
  white-space: nowrap;
}

.admin-actions a {
  margin-right: 0.75rem;
}

.inline-form {
  display: inline;
}

.inline-form button.link {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font: inherit;
}

button.link.danger {
  color: #b00020;
  text-decoration: underline;
}

.admin-form {
  max-width: 48rem;
}

.admin-form .field {
  margin-bottom: 1rem;
}

.admin-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.admin-form input.wide,
.admin-form select.wide,
.admin-form textarea.wide {
  width: 100%;
  max-width: 100%;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.admin-form input.wide:focus,
.admin-form textarea.wide:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}

.admin-form .code-font {
  font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", monospace;
  font-size: 0.9rem;
}

.admin-form .field-inline {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-form .field-inline label {
  margin-bottom: 0;
  font-weight: 500;
}

.admin-form fieldset.field-grid {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1rem 0;
  margin: 1.25rem 0;
}

.admin-form fieldset.field-grid legend {
  padding: 0 0.35rem;
  font-weight: 600;
}

/* Brief admin — section titles match publishing callout weight */
.admin-form fieldset.field-grid > legend.brief-form-section__title {
  float: none;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 0.35rem;
  padding: 0 0.35rem;
}

.field span.field-validation-error,
.admin-form span.field-validation-error {
  display: block;
  color: #b00020;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.btn {
  display: inline-block;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}

.btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
}

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

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 1px 2px rgba(12, 74, 122, 0.25);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  filter: none;
}

.h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.75rem;
}

.admin-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem 0.25rem;
  margin: 0.75rem 0;
  background: #fff;
}

.edge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr));
  gap: 0.75rem 1rem;
  align-items: end;
}

.edge-label-span {
  grid-column: 1 / -1;
}

@media (min-width: 640px) {
  .edge-label-span {
    grid-column: auto;
  }
}

/* —— Topic maps (public) —— */
.topic-map-page .page-hero {
  margin-bottom: 1.75rem;
}

.topic-map-page__hint {
  margin: 0 0 1rem;
}

.topic-map-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.65rem;
  margin: 0 0 0.5rem;
  align-items: stretch;
}

.topic-map-jump__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  line-height: 1.3;
  max-width: 100%;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.topic-map-jump__link:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(20, 113, 185, 0.12);
}

.topic-map-jump__link--article {
  border-color: rgba(20, 113, 185, 0.35);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 100%);
  color: var(--accent);
}

.topic-map-jump__link--article:hover {
  color: var(--accent);
}

.topic-map-jump__link--portal {
  border-color: rgba(140, 198, 64, 0.45);
  background: linear-gradient(180deg, var(--brand-secondary-soft) 0%, #fff 100%);
  color: #4a7a28;
}

.topic-map-jump__hint {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.85;
}

.topic-map-jump__dead {
  display: inline-flex;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-size: 0.9rem;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.topic-map-diagram {
  margin: 0;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.topic-map-diagram pre.mermaid {
  margin: 0;
  background: transparent;
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
  white-space: pre-wrap;
}

.topic-map-diagram .mermaid {
  display: block;
  min-height: 2rem;
  width: max-content;
  margin-left: auto;
  margin-right: auto;
}

/* Let Mermaid keep intrinsic canvas size so text stays legible; parent .topic-map-diagram scrolls horizontally. */
.topic-map-diagram .mermaid svg {
  max-width: none;
  width: auto;
  height: auto;
  display: block;
}

.topic-map-diagram .mermaid svg .node a,
.topic-map-diagram .mermaid svg a {
  cursor: pointer;
}

.topic-map-diagram .mermaid svg .node rect,
.topic-map-diagram .mermaid svg .node polygon,
.topic-map-diagram .mermaid svg .node circle {
  transition: filter 0.12s ease;
}

.topic-map-diagram .mermaid svg .node:hover rect,
.topic-map-diagram .mermaid svg .node:hover polygon,
.topic-map-diagram .mermaid svg .node:hover circle {
  filter: brightness(0.97);
}

.topic-map-index .page-hero {
  margin-bottom: 2rem;
}

.topic-map-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 900px) {
  .topic-map-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

@media (min-width: 1320px) {
  .topic-map-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.topic-map-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.topic-map-card:hover {
  border-color: rgba(20, 113, 185, 0.45);
  box-shadow: 0 2px 8px rgba(20, 113, 185, 0.08);
}

.topic-map-card__title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--accent);
}

.topic-map-card:hover .topic-map-card__title {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.topic-map-card__desc {
  display: block;
  line-height: 1.45;
}

.topic-map-card__cta {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
  margin-top: 0.25rem;
}

.topic-map-callout {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  box-shadow: var(--shadow-sm);
}

.topic-map-callout ul {
  margin: 0.35rem 0 0;
  padding-left: 1.25rem;
}

/* —— Explore (category → subcategory hubs) —— */
.page-hero__sub {
  margin: 0.75rem 0 0;
  font-weight: 400;
}

.page-hero__sub a {
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.page-hero__sub a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.home-browse {
  margin: 0 0 2.25rem;
  padding: 1.25rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.home-browse__title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
}

.home-recent__title {
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.home-recent__hint {
  margin: 0 0 1.25rem;
}

.home-briefs,
.home-recent {
  margin: 0 0 2.25rem;
}

.home-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  margin-bottom: 0.75rem;
}

.home-section-head__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
}

.home-section-head__action {
  margin: 0;
}

.home-section-head--minor .home-browse__title--tail {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
}

.home-browse--tail {
  padding: 1rem 1rem;
  box-shadow: none;
  background: var(--bg-elevated);
  opacity: 0.98;
}

.home-browse--tail .explore-category-card {
  padding: 0.65rem 0.85rem;
  min-height: 3.5rem;
}

.articles-archive__pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin: 1.5rem 0 0;
}

.articles-archive-categories {
  margin: 0 0 1.75rem;
  padding: 1.15rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.articles-archive-categories__head {
  margin-bottom: 0.75rem;
}

.articles-archive-categories__head .home-section-head__title {
  font-size: 1.05rem;
}

.explore-category-card.explore-category-card--current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.explore-page .page-hero {
  margin-bottom: 1.5rem;
}

.explore-shortcuts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.75rem;
}

.explore-shortcuts a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.explore-shortcuts a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.explore-category-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

@media (min-width: 520px) {
  .explore-category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .explore-category-grid:not(.explore-category-grid--compact) {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1200px) {
  .explore-category-grid:not(.explore-category-grid--compact) {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1000px) {
  .home-browse .explore-category-grid--compact {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1320px) {
  .home-browse .explore-category-grid--compact {
    grid-template-columns: repeat(4, 1fr);
  }
}

.explore-category-grid--compact {
  gap: 0.5rem;
}

/* /articles topic strip: 3 columns when wide (compact grids are excluded from global 3-col rules) */
.articles-archive-categories .articles-archive-categories__page-topics {
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .articles-archive-categories .articles-archive-categories__page-topics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.articles-archive-categories .articles-archive-categories__page-topics .explore-category-card {
  min-height: 3rem;
  padding: 0.55rem 0.75rem;
}

.articles-archive-categories .articles-archive-categories__page-topics .explore-category-card__name {
  font-size: 0.95rem;
}

.explore-category-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--surface) 100%);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  min-height: 4.25rem;
  justify-content: center;
}

.explore-category-card:hover {
  border-color: rgba(20, 113, 185, 0.4);
  box-shadow: 0 2px 10px rgba(20, 113, 185, 0.08);
}

.explore-category-card__name {
  font-weight: 700;
  font-size: 1.02rem;
  color: var(--accent);
}

.explore-category-card:hover .explore-category-card__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.explore-category-card__meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.explore-subcategory-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

@media (min-width: 900px) {
  .explore-subcategory-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
  }
}

@media (min-width: 1320px) {
  .explore-subcategory-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.explore-subcategory-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

.explore-subcategory-card:hover {
  border-color: rgba(20, 113, 185, 0.4);
  box-shadow: var(--shadow-sm);
}

.explore-subcategory-card__name {
  font-weight: 700;
  color: var(--accent);
}

.explore-subcategory-card:hover .explore-subcategory-card__name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.explore-subcategory-card__meta {
  font-size: 0.85rem;
  color: var(--muted);
  white-space: nowrap;
}

.explore-pager {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle, #e8e8e8);
}

.explore-pager__meta {
  margin: 0 0 0.75rem;
}

.explore-pager__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* Search */
.search-page .site-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin: 0 0 1.75rem;
  max-width: 40rem;
}

.search-page .site-search-form__input {
  flex: 1 1 12rem;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  font: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.search-page .site-search-form__btn {
  flex-shrink: 0;
}

.search-page__summary {
  margin: 0 0 1rem;
}

.search-page__notice {
  padding: 1rem 1.1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
}

.search-section {
  margin-bottom: 2rem;
}

.search-section__title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.85rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}

.search-topic-maps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-topic-maps__link {
  display: block;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.search-topic-maps__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.search-topic-maps li span {
  display: block;
  margin-top: 0.2rem;
}

/* Topic library project edit: plan + attached resources panel */
.topic-library-edit-layout {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  align-items: stretch;
}

@media (min-width: 960px) {
  .topic-library-edit-layout {
    flex-direction: row;
    align-items: flex-start;
    gap: 2rem;
  }

  .topic-library-edit-main {
    flex: 1;
    min-width: 0;
  }

  .topic-library-resources {
    flex: 0 0 min(22rem, 34vw);
    max-width: 24rem;
    position: sticky;
    top: calc(var(--header-h) + 0.75rem);
  }
}

.topic-library-resources {
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.topic-library-resources__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--ink);
}

.topic-library-resources__lede {
  margin: 0 0 1rem;
  line-height: 1.45;
}

.topic-library-resources__section {
  margin-bottom: 1.15rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.topic-library-resources__section:last-of-type {
  border-bottom: none;
  margin-bottom: 0.5rem;
  padding-bottom: 0;
}

.topic-library-resources__h {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 0.45rem;
  color: var(--ink);
}

.topic-library-resources__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.topic-library-resources__list li {
  font-size: 0.95rem;
  line-height: 1.45;
}

.topic-library-resources__list li a:first-child {
  font-weight: 600;
}

.topic-library-resources__add.admin-form,
.topic-library-resources .admin-form {
  max-width: none;
}

.topic-library-resources__add {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.topic-library-attach-block {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.topic-library-attach-block:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.topic-library-attach-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  font-size: 0.95rem;
}

.topic-library-draft-preview {
  margin-bottom: 1.5rem;
}

.topic-library-draft-preview__blocked {
  margin-top: 0.75rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.topic-library-draft-preview__blocked-jump {
  display: block;
  margin-top: 0.5rem;
}

.topic-library-draft-preview__blocked-jump a {
  font-weight: 600;
}

.topic-library-draft-preview__placement-missing {
  font-weight: 600;
  color: #6b4e00;
}

.topic-library-draft-defaults__need-slugs {
  margin: 0 0 0.75rem;
}

.topic-library-draft-preview__dl {
  margin: 0.75rem 0 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  font-size: 0.95rem;
}

.topic-library-draft-preview__dl dt {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
}

.topic-library-draft-preview__dl dd {
  margin: 0;
}

.topic-library-draft-preview__stub {
  padding: 0.65rem 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  line-height: 1.45;
  max-height: 8rem;
  overflow-y: auto;
}

.topic-library-draft-defaults .field {
  margin-bottom: 0.75rem;
}

.topic-library-pipeline-table-wrap {
  overflow-x: auto;
  margin-top: 0.5rem;
}

.topic-library-pipeline-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.topic-library-pipeline-table th,
.topic-library-pipeline-table td {
  text-align: left;
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.topic-library-pipeline-table th {
  font-weight: 700;
  color: var(--ink);
  background: var(--bg-elevated);
}

.topic-library-pipeline__actions {
  white-space: nowrap;
}

.topic-library-pipeline__actions form {
  margin-right: 0.35rem;
}

.topic-library-pipeline__badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
}

.topic-library-pipeline__badge--suggested {
  background: var(--brand-primary-soft);
  color: var(--brand-primary);
}

.topic-library-pipeline__badge--draft {
  background: #fff8e6;
  color: #8a6d00;
}

.topic-library-pipeline__badge--done {
  background: var(--brand-secondary-soft);
  color: #4a6b1a;
}

.topic-library-pipeline__badge--skip {
  background: var(--bg-elevated);
  color: var(--muted);
}

/* External embed: community-widget.js (WordPress strip) */
.community-widget-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.community-widget-item {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle, #e8e8e8);
}

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

.community-widget-thumb-link {
  flex: 0 0 auto;
}

.community-widget-thumb {
  display: block;
  width: 96px;
  height: auto;
  border-radius: 6px;
  object-fit: cover;
}

.community-widget-title {
  font-weight: 600;
  flex: 1 1 200px;
}

.community-widget-meta {
  width: 100%;
  font-size: 0.85rem;
}

.community-widget-empty,
.community-widget-error {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Community chat widget */
.community-chat {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  font-family: var(--font-sans, "Nunito", system-ui, sans-serif);
}

.community-chat__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--brand-primary, #2d6a4f);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
}

.community-chat__toggle:hover {
  filter: brightness(1.05);
}

.community-chat__panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5.5rem;
  width: min(22rem, calc(100vw - 2rem));
  height: min(28rem, 70vh);
  min-width: 17.5rem;
  min-height: 20rem;
  max-width: calc(100vw - 1rem);
  max-height: calc(100vh - 1rem);
  resize: both;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-subtle, #e0e0e0);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

.community-chat__panel[hidden] {
  display: none !important;
}

.community-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #e8e8e8);
  cursor: move;
  flex-shrink: 0;
  user-select: none;
}

.community-chat__header .community-chat__close {
  cursor: pointer;
}

.community-chat__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
}

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

.community-chat__disclaimer {
  margin: 0;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--border-subtle, #f0f0f0);
  flex-shrink: 0;
}

.community-chat__messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  min-height: 6rem;
}

.community-chat__message {
  margin-bottom: 0.75rem;
  font-size: 0.92rem;
}

.community-chat__message--user p {
  margin: 0;
  padding: 0.5rem 0.65rem;
  background: var(--brand-primary-soft, #e8f5ee);
  border-radius: 8px;
}

.community-chat__message--assistant p {
  margin: 0 0 0.5rem;
}

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

.community-chat__articles li {
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-subtle, #eee);
}

.community-chat__articles li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.community-chat__articles a {
  display: block;
  margin-bottom: 0.2rem;
}

.community-chat__preview {
  margin: 0.35rem 0 0;
  line-height: 1.35;
  max-height: 4.5rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  word-break: break-word;
}

.community-chat__error {
  color: #b42318;
}

.community-chat__form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem 1rem;
  border-top: 1px solid var(--border-subtle, #e8e8e8);
  flex-shrink: 0;
}

.community-chat__message--loading {
  opacity: 0.9;
}

.community-chat__loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--muted, #666);
  font-size: 0.9rem;
}

.community-chat__spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid var(--border-subtle, #ddd);
  border-top-color: var(--brand-primary, #2d6a4f);
  border-radius: 50%;
  animation: community-chat-spin 0.75s linear infinite;
  flex-shrink: 0;
}

@keyframes community-chat-spin {
  to {
    transform: rotate(360deg);
  }
}

.community-chat__input {
  width: 100%;
  resize: none;
  min-height: 2.5rem;
  padding: 0.5rem;
  border: 1px solid var(--border-subtle, #ccc);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.92rem;
}

.community-chat__honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.community-chat__send {
  align-self: flex-end;
}

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