/* ==================================================================
   Comments page — v2 (Liberty/Captivity + threading + moderation)
   ================================================================== */

.comments-main {
  padding-bottom: 4rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  grid-template-areas:
    "tabs     standards"
    "filters  standards"
    "compose  standards"
    "gate     standards"
    "feed     standards"
    "pager    standards";
  gap: 0 2.5rem;
  max-width: 72rem;
  margin: 0 auto;
}
@media (max-width: 960px) {
  .comments-main {
    grid-template-columns: 1fr;
    grid-template-areas: "tabs" "filters" "compose" "gate" "feed" "pager" "standards";
  }
}

/* ---- view tabs ---- */
.view-tabs {
  grid-area: tabs;
  display: flex;
  align-items: baseline;
  gap: 0;
  border-bottom: 1px solid rgba(0,0,0,0.18);
  margin: 2rem 0 1.25rem;
}
.view-tab {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 0.75rem 1.5rem;
  font-family: 'Fraunces', serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: rgba(0,0,0,0.5);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
  letter-spacing: 0.01em;
}
.view-tab:hover { color: rgba(0,0,0,0.85); }
.view-tab.active { color: #1a1a1a; border-bottom-color: #7a2a1f; }
.view-standards-link {
  margin-left: auto;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(0,0,0,0.5);
  text-decoration: none;
  letter-spacing: 0.04em;
  padding-bottom: 0.8rem;
}
.view-standards-link:hover { color: #7a2a1f; }

/* ---- filter bar ---- */
.filter-bar {
  grid-area: filters;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.filter-left { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }
.filter-right { display: flex; gap: 0.5rem; }
.toolbar-label {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(0,0,0,0.55);
}
.toolbar-select, .toolbar-input {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.85rem;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.2);
  background: transparent;
  color: #1a1a1a;
}
.sort-tabs { display: flex; gap: 4px; }
.sort-tab {
  appearance: none;
  background: transparent;
  border: 1px solid rgba(0,0,0,0.18);
  padding: 4px 10px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(0,0,0,0.55);
  cursor: pointer;
}
.sort-tab:hover { border-color: #7a2a1f; color: #7a2a1f; }
.sort-tab.active { background: #7a2a1f; color: #f5eedc; border-color: #7a2a1f; }

/* ---- compose ---- */
.compose-host { grid-area: compose; margin-bottom: 1.25rem; }
.compose-form {
  background: rgba(255, 252, 242, 0.45);
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 3px;
  padding: 1rem 1.1rem 0.9rem;
}
.compose-label {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.8rem;
  color: rgba(0,0,0,0.55);
  margin-bottom: 0.5rem;
}
.compose-label code {
  background: rgba(199, 162, 79, 0.15);
  padding: 1px 5px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.8rem;
  color: #1a1a1a;
}
.compose-tip { color: rgba(0,0,0,0.38); font-style: italic; margin-left: 0.4rem; }
.compose-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: 'EB Garamond', serif;
  font-size: 1.05rem;
  line-height: 1.5;
  border: 1px solid rgba(0,0,0,0.14);
  padding: 10px 12px;
  background: #fafaf3;
  resize: vertical;
}
.compose-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}
.compose-standards {
  font-family: 'EB Garamond', serif;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.55);
}
.compose-standards a { color: #7a2a1f; text-decoration: none; border-bottom: 1px dotted #7a2a1f; }
.compose-submit {
  appearance: none;
  background: #7a2a1f;
  color: #f5eedc;
  border: 0;
  padding: 8px 20px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 500;
  cursor: pointer;
}
.compose-submit:hover { background: #5a1f17; }
.compose-signon, .compose-banned {
  padding: 1.5rem;
  text-align: center;
  font-family: 'EB Garamond', serif;
  color: rgba(0,0,0,0.55);
  border: 1px dashed rgba(0,0,0,0.14);
}
.btn-signon {
  background: #7a2a1f;
  color: #f5eedc;
  border: 0;
  padding: 10px 24px;
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  cursor: pointer;
}
.btn-signon:hover { background: #5a1f17; }

/* ---- captivity gate ---- */
.captivity-gate, .captivity-signon {
  grid-area: gate;
  background: rgba(255, 247, 230, 0.8);
  border: 1px solid #a57b1d;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  font-family: 'EB Garamond', serif;
  line-height: 1.55;
  color: rgba(0,0,0,0.82);
}
.captivity-gate h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1.4rem;
  margin: 0 0 0.8rem;
  color: #1a1a1a;
}
.captivity-gate p { margin: 0 0 0.8rem; }
.captivity-gate strong { color: #1a1a1a; }
.gate-check {
  display: block;
  margin: 0.6rem 0;
  padding-left: 2rem;
  text-indent: -2rem;
  font-size: 0.98rem;
}
.gate-check input[type="checkbox"] { margin-right: 0.5rem; transform: scale(1.1); vertical-align: middle; }
.gate-actions {
  display: flex;
  gap: 0.8rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
}
.gate-continue {
  background: #7a2a1f;
  color: #f5eedc;
  border: 0;
  padding: 10px 24px;
  font-family: 'Fraunces', serif;
  font-size: 1rem;
  cursor: pointer;
}
.gate-continue:disabled { background: rgba(0,0,0,0.22); cursor: not-allowed; }
.gate-back {
  background: transparent;
  color: rgba(0,0,0,0.55);
  border: 1px solid rgba(0,0,0,0.2);
  padding: 10px 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  cursor: pointer;
}
.gate-foot { font-size: 0.88rem; color: rgba(0,0,0,0.5); margin-top: 1rem; }
.gate-foot a { color: #7a2a1f; text-decoration: none; border-bottom: 1px dotted #7a2a1f; }
.captivity-signon { text-align: center; }

/* ---- feed & comment card ---- */
.feed-host { grid-area: feed; }
.feed-loading, .feed-empty {
  padding: 3rem 0;
  text-align: center;
  font-family: 'EB Garamond', serif;
  color: rgba(0,0,0,0.5);
  font-style: italic;
}

/* 2026-04-19 — boxing rule: every comment sits inside a single-line grid cell.
   No gap, no rounded corners. Border on top, right, left, and bottom (each
   side 1px). Between comments, adjacent borders collapse into a single line. */
.comment-card {
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--rule);
  margin-top: -1px;       /* collapse adjacent vertical borders */
  background: transparent;
}
.comment-card:first-of-type { margin-top: 0; }

.comment-card.reply {
  padding-left: 1.1rem;
  margin-left: 1.4rem;
  border-left: 2px solid var(--gold);
}

/* Embedded references — links to web pages / sources pulled into a
   comment body — get their own rounded-corner box. */
.comment-body blockquote,
.comment-body pre,
.comment-body figure,
.comment-body .url-embed {
  border: 1px solid var(--rule-fine);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0.6rem 0;
  background: var(--gold-glow, rgba(199, 162, 79, 0.06));
}
.comment-meta {
  display: flex;
  gap: 0.7rem;
  align-items: baseline;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.82rem;
  color: rgba(0,0,0,0.55);
  margin-bottom: 0.4rem;
  flex-wrap: wrap;
}
.comment-user { color: #1a1a1a; font-weight: 600; }
.comment-user-mod { color: #a57b1d; }
.comment-role {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a57b1d;
  border: 1px solid #a57b1d;
  padding: 1px 4px;
}
.comment-time { color: rgba(0,0,0,0.42); font-variant-numeric: tabular-nums; }
.comment-word {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  background: rgba(199, 162, 79, 0.15);
  padding: 1px 5px;
  color: #1a1a1a;
}
.comment-masked-badge, .comment-captivity-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #7a2a1f;
  border: 1px solid #7a2a1f;
  padding: 1px 4px;
}
.comment-captivity-badge { color: #a57b1d; border-color: #a57b1d; }

.comment-body {
  font-family: 'EB Garamond', serif;
  font-size: 1.08rem;
  line-height: 1.55;
  color: rgba(0,0,0,0.82);
}
.comment-body p { margin: 0 0 0.6rem; }
.comment-body p:last-child { margin-bottom: 0; }
.comment-body a { color: #7a2a1f; border-bottom: 1px dotted #7a2a1f; text-decoration: none; }
.comment-body blockquote {
  margin: 0.6rem 0;
  padding-left: 1rem;
  border-left: 3px solid rgba(199, 162, 79, 0.4);
  color: rgba(0,0,0,0.62);
  font-style: italic;
}
.comment-body code {
  background: rgba(0,0,0,0.04);
  padding: 1px 4px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.92em;
}

.masked-full {
  background: rgba(0,0,0,0.04);
  padding: 12px 14px;
  font-style: italic;
  color: rgba(0,0,0,0.5);
  border-left: 3px solid rgba(0,0,0,0.2);
  margin: 0;
}
.masked-editing { border-left-color: #a57b1d; color: #a57b1d; }
.masked-span {
  background: #1a1a1a;
  color: #1a1a1a;             /* chars hidden by matching color to background */
  padding: 0 1px;
  letter-spacing: -0.1em;      /* tighten the block-char run for a denser bar */
  user-select: none;
  cursor: help;
  border-radius: 2px;
}
.masked-span:hover { background: #333; }

.comment-actions {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.55rem;
  flex-wrap: wrap;
}
.comment-actions button {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  padding: 3px 9px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.78rem;
  color: rgba(0,0,0,0.55);
  cursor: pointer;
  border-radius: 2px;
}
.comment-actions button:hover { background: rgba(0,0,0,0.04); color: #1a1a1a; border-color: rgba(0,0,0,0.14); }
.act-up:hover { color: #1d7a2a; border-color: #1d7a2a; }
.act-down:hover { color: #7a2a1f; border-color: #7a2a1f; }
.act-mod { color: #a57b1d; border-color: rgba(165, 123, 29, 0.3); }

.reply-form {
  margin-top: 0.6rem;
  padding: 0.6rem 0.7rem;
  background: rgba(255, 252, 242, 0.5);
  border: 1px solid rgba(0,0,0,0.1);
}
.reply-form textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.12);
  background: #fafaf3;
  resize: vertical;
}
.reply-form button {
  margin-top: 0.4rem;
  margin-right: 0.4rem;
  padding: 5px 14px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
}

.feed-pager { grid-area: pager; text-align: center; margin: 2rem 0; }
.feed-load-more {
  appearance: none;
  background: transparent;
  border: 1px solid #7a2a1f;
  color: #7a2a1f;
  padding: 10px 28px;
  font-family: 'Fraunces', serif;
  font-size: 0.95rem;
  cursor: pointer;
}
.feed-load-more:hover { background: #7a2a1f; color: #f5eedc; }

/* ---- standards sidebar rail ---- */
.standards-rail {
  grid-area: standards;
  position: sticky;
  top: 1rem;
  align-self: start;
  padding: 1rem 1.1rem;
  background: rgba(255, 247, 230, 0.55);
  border: 1px solid rgba(165, 123, 29, 0.25);
  font-family: 'EB Garamond', serif;
  font-size: 0.95rem;
  line-height: 1.5;
  color: rgba(0,0,0,0.72);
  margin-top: 2rem;
}
.standards-rail h4 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  font-size: 1rem;
  color: #1a1a1a;
  margin: 0 0 0.5rem;
}
.standards-rail p { margin: 0 0 0.5rem; }
.standards-rail ul { margin: 0 0 0.7rem; padding-left: 1.2rem; }
.standards-rail li { margin-bottom: 0.18rem; }
.standards-rail a { color: #7a2a1f; text-decoration: none; border-bottom: 1px dotted #7a2a1f; }
.standards-full { display: block; margin-top: 0.5rem; font-weight: 500; }

/* ---- modals ---- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(20,16,10,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-box {
  background: #f5eedc;
  border: 1px solid rgba(0,0,0,0.18);
  padding: 1.5rem 1.5rem 1.25rem;
  max-width: 28rem;
  width: 100%;
  position: relative;
  font-family: 'EB Garamond', serif;
}
.modal-wide { max-width: 44rem; }
.modal-box h3 {
  font-family: 'Fraunces', serif;
  font-weight: 500;
  margin: 0 0 1rem;
  color: #1a1a1a;
}
.modal-tabs { display: flex; gap: 0; border-bottom: 1px solid rgba(0,0,0,0.14); margin-bottom: 1rem; }
.modal-tab {
  background: transparent; border: 0;
  border-bottom: 2px solid transparent;
  padding: 8px 14px; cursor: pointer;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 0.9rem;
  color: rgba(0,0,0,0.5);
}
.modal-tab.active { color: #1a1a1a; border-bottom-color: #7a2a1f; }
.modal-form { display: flex; flex-direction: column; gap: 0.6rem; }
.modal-form input, .modal-form textarea {
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,0.18);
  font-family: 'EB Garamond', serif;
  font-size: 1rem;
  background: #fafaf3;
}
.modal-form button {
  background: #7a2a1f; color: #f5eedc;
  border: 0; padding: 10px 20px;
  font-family: 'Fraunces', serif;
  cursor: pointer;
  margin-top: 0.3rem;
}
.modal-form button:hover { background: #5a1f17; }
.modal-error { color: #7a2a1f; font-size: 0.88rem; margin: 0.3rem 0 0; }
.modal-close {
  position: absolute; top: 8px; right: 12px;
  background: transparent; border: 0;
  font-size: 1.4rem; cursor: pointer;
  color: rgba(0,0,0,0.5);
}
.modal-close:hover { color: #7a2a1f; }

#embedCode { width: 100%; box-sizing: border-box; font-family: 'IBM Plex Mono', monospace; font-size: 0.78rem; padding: 8px; border: 1px solid rgba(0,0,0,0.18); background: #fafaf3; }
#embedCopy { margin-top: 0.5rem; }

/* ---- embed mode: minimal chrome ---- */
body.embed-mode .masthead,
body.embed-mode .view-tabs,
body.embed-mode .filter-bar,
body.embed-mode .compose-host,
body.embed-mode .standards-rail,
body.embed-mode .feed-pager {
  display: none !important;
}
body.embed-mode .comments-main {
  grid-template-columns: 1fr;
  grid-template-areas: "feed";
  max-width: none;
  padding: 0;
}
body.embed-mode .comment-card {
  padding: 12px 14px;
  border: 1px solid rgba(0,0,0,0.14);
}
body.embed-mode .comment-actions { display: none; }

/* ---- focused single-comment highlight (deep-link) ---- */
.comment-focused {
  background: rgba(199, 162, 79, 0.08);
  border-left: 3px solid #a57b1d;
  padding-left: 0.8rem !important;
  animation: focusFade 3s ease-out;
}
@keyframes focusFade {
  0%, 50% { background: rgba(199, 162, 79, 0.18); }
  100% { background: rgba(199, 162, 79, 0.08); }
}

/* ---- mobile-specific ---- */
@media (max-width: 620px) {
  .compose-row { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .comment-card.reply { padding-left: 0.8rem; margin-left: 0.6rem; }
  .view-standards-link { margin-left: 0; font-size: 0.72rem; padding-bottom: 0.5rem; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}

/* =====================================================================
   DARK THEME override block (2026-04-20) — see docs/dark-theme-playbook.md.
   comments.css was originally written light-only with hardcoded #1a1a1a
   text, #fafaf3 input bgs, and rgba(255,247,230) panel backgrounds.
   Translate every violation to the canonical token set so dark mode is
   readable.
   ===================================================================== */
[data-theme="dark"] .toolbar-select,
[data-theme="dark"] .toolbar-input {
  color: var(--ink);
  background: var(--paper-warm);
  border-color: var(--rule);
}
[data-theme="dark"] .toolbar-select option {
  background: var(--paper-warm);
  color: var(--ink);
}

/* Sort / view tabs — active color was hardcoded dark ink */
[data-theme="dark"] .view-tab.active,
[data-theme="dark"] .sort-tab.active {
  color: var(--ink);
}

/* Compose box */
[data-theme="dark"] .compose-form {
  background: var(--paper-warm);
  border-color: var(--rule);
}
[data-theme="dark"] .compose-form textarea,
[data-theme="dark"] .reply-form textarea,
[data-theme="dark"] .modal-form input,
[data-theme="dark"] .modal-form textarea,
[data-theme="dark"] #embedCode {
  background: var(--paper-warm);
  color: var(--ink);
  border-color: var(--rule);
}
[data-theme="dark"] .compose-tip {
  color: var(--muted);
}

/* Comment user + metadata headings */
[data-theme="dark"] .comment-user,
[data-theme="dark"] .captivity-gate h3,
[data-theme="dark"] .standards-rail h4,
[data-theme="dark"] .modal-box h3,
[data-theme="dark"] .modal-tab.active {
  color: var(--ink);
}

/* Captivity gate card */
[data-theme="dark"] .captivity-gate,
[data-theme="dark"] .captivity-signon,
[data-theme="dark"] .standards-rail {
  background: var(--paper-warm);
  border-color: var(--rule);
}

/* Reply form */
[data-theme="dark"] .reply-form {
  background: var(--paper-warm);
  border-color: var(--rule);
}

/* Modal box (the old .modal-* — used by embed / captivity flows;
   the new sign-on modal uses .signon-* and already themes correctly) */
[data-theme="dark"] .modal-box {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--rule);
}
[data-theme="dark"] .modal-tab {
  color: var(--muted);
}
[data-theme="dark"] .modal-form button {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
[data-theme="dark"] .modal-form button:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: transparent;
}
[data-theme="dark"] .modal-close { color: var(--muted); }
[data-theme="dark"] .modal-close:hover { color: var(--gold); }
[data-theme="dark"] .modal-error { color: var(--decline); }

/* Hairlines on tab bars and filter bars */
[data-theme="dark"] .modal-tabs { border-bottom-color: var(--rule); }
[data-theme="dark"] .view-tab.active { border-bottom-color: var(--gold); }
[data-theme="dark"] .sort-tab.active { border-color: var(--gold); color: var(--gold); }
[data-theme="dark"] .sort-tab { border-color: var(--rule); color: var(--muted); }

/* The .comment-card uses transparent background by default — that's
   correct. But its bottom-border collapse line uses var(--rule) which
   already resolves theme-correctly. No override needed there. */

/* Standards rail — the base rule hardcodes rgba(0,0,0,0.72). Dark override
   needs to explicitly set ink-soft, and also handle links + margin-top link. */
[data-theme="dark"] .standards-rail {
  color: var(--ink-soft);
}
[data-theme="dark"] .standards-rail a {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
[data-theme="dark"] .standards-rail a:hover { color: var(--gold-bright); }

/* Inline filter-bar text, compose-row labels, pager text all use the page's
   inherited color — let them. But the .tz-author-handle class in comments
   is hardcoded. Fix it explicitly too. */
[data-theme="dark"] .compose-form .compose-tip,
[data-theme="dark"] .tz-author-handle {
  color: var(--muted);
}

/* Captivity-gate body text (rgba(0,0,0,0.82)) and strong need explicit
   dark-theme text color. */
[data-theme="dark"] .captivity-gate,
[data-theme="dark"] .captivity-signon {
  color: var(--ink-soft);
}
[data-theme="dark"] .captivity-gate strong,
[data-theme="dark"] .captivity-gate h3,
[data-theme="dark"] .captivity-signon strong {
  color: var(--ink);
}

/* Bulk dark-theme text overrides — every selector in comments.css above
   that hardcodes rgba(0,0,0,x) or #1a1a1a translates to the token that
   most closely matches its intent. One block so it's easy to audit. */
[data-theme="dark"] .view-tab,
[data-theme="dark"] .view-standards-link,
[data-theme="dark"] .toolbar-label,
[data-theme="dark"] .sort-tab,
[data-theme="dark"] .compose-label,
[data-theme="dark"] .compose-standards,
[data-theme="dark"] .compose-signon,
[data-theme="dark"] .compose-banned,
[data-theme="dark"] .gate-back,
[data-theme="dark"] .gate-foot,
[data-theme="dark"] .feed-loading,
[data-theme="dark"] .feed-empty,
[data-theme="dark"] .comment-meta,
[data-theme="dark"] .comment-time,
[data-theme="dark"] .comment-role,
[data-theme="dark"] .comment-actions button,
[data-theme="dark"] .masked-full {
  color: var(--muted);
}

[data-theme="dark"] .view-tab:hover,
[data-theme="dark"] .view-tab.active,
[data-theme="dark"] .compose-label code,
[data-theme="dark"] .captivity-gate h3,
[data-theme="dark"] .captivity-gate strong,
[data-theme="dark"] .captivity-signon strong,
[data-theme="dark"] .comment-user,
[data-theme="dark"] .comment-word,
[data-theme="dark"] .comment-actions button:hover,
[data-theme="dark"] .standards-rail h4,
[data-theme="dark"] .modal-box h3,
[data-theme="dark"] .modal-tab.active {
  color: var(--ink);
}

[data-theme="dark"] .comment-body {
  color: var(--ink-soft);
}
[data-theme="dark"] .comment-body blockquote {
  color: var(--muted);
}

/* Masked-span glyph trick — the whole point is invisibility, so fg and bg
   must match. Use ink color on both in dark mode. */
[data-theme="dark"] .masked-span {
  background: var(--ink);
  color: var(--ink);
}

/* Comment-actions hover — don't tint with rgba(0,0,0) on dark */
[data-theme="dark"] .comment-actions button:hover {
  background: rgba(255,255,255,0.06);
  border-color: var(--rule);
}

/* Borders on .comment-card use var(--rule) already — no override needed.
   .view-tabs / .sort-tabs border-bottom colors that use rgba(0,0,0,0.14)
   need a dark override too. */
[data-theme="dark"] .view-tabs,
[data-theme="dark"] .modal-tabs {
  border-bottom-color: var(--rule);
}
[data-theme="dark"] .view-tab.active {
  border-bottom-color: var(--gold);
}
[data-theme="dark"] .sort-tab {
  border-color: var(--rule);
}
[data-theme="dark"] .sort-tab.active {
  border-color: var(--gold);
  color: var(--gold);
}

/* Dark-mode accent — #7a2a1f (terracotta) reads as a dull red in dark
   mode and clashes with the gold CTA. Remap all accent uses to gold. */
[data-theme="dark"] .view-tab.active { border-bottom-color: var(--gold); }
[data-theme="dark"] .view-standards-link:hover { color: var(--gold); }
[data-theme="dark"] .sort-tab:hover { border-color: var(--gold); color: var(--gold); }
[data-theme="dark"] .sort-tab.active {
  background: var(--gold); color: #ffffff; border-color: var(--gold);
}
[data-theme="dark"] .compose-standards a {
  color: var(--gold); border-bottom-color: var(--gold);
}
[data-theme="dark"] .compose-submit,
[data-theme="dark"] .btn-signon {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--rule);
}
[data-theme="dark"] .compose-submit:hover,
[data-theme="dark"] .btn-signon:hover {
  background: transparent;
  border-color: var(--gold);
  color: var(--gold);
}
/* Captivity-gate submit (the big orange button) — gold fill */
[data-theme="dark"] .gate-check + button,
[data-theme="dark"] .captivity-submit {
  background: var(--gold);
  color: #ffffff;
  border-color: var(--gold);
}
[data-theme="dark"] .gate-foot a {
  color: var(--gold); border-bottom-color: var(--gold);
}
/* Comment body links + author badge pills */
[data-theme="dark"] .comment-word {
  color: var(--gold);
  border-color: var(--gold);
  background: rgba(199, 162, 79, 0.08);
}
[data-theme="dark"] .comment-body a {
  color: var(--gold); border-bottom-color: var(--gold);
}
[data-theme="dark"] .act-down:hover {
  color: var(--gold); border-color: var(--gold);
}

/* One-line community-standards link above the compose box. Replaces the
   larger .standards-rail sidebar that was removed 2026-04-20. */
.compose-standards-link {
  font-family: var(--font-body);
  font-style: italic;
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 10px;
  text-align: left;
}
.compose-standards-link a {
  color: var(--gold);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold);
}
.compose-standards-link a:hover { color: var(--gold-bright); }
