/* ── COMMENTS ── */
/* Hide hw-marker comments (reactions/bookmarks stored as comments) */
.uComment.hw-hidden {
  display: none !important;
}
.cBlock1,
.cBlock2 {
  background: var(--c-surface);
  padding: 5px !important;
  margin: 0 !important;
  border-bottom: 1px solid var(--c-border);
}
#content .cBlock1,
#content .cBlock2 {
  padding: 0 0 10px !important;
  background: 0;
  margin: 5px 0 0 !important;
  color: var(--c-text-secondary);
}
.commTable {
  margin: 40px 0 0;
  padding: 24px;
  border-spacing: 0;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
}
.cMessage {
  font-size: 0.9rem;
  line-height: 1.6;
  word-wrap: break-word;
  word-break: break-all;
}
.cTop {
  padding: 0 0 12px;
  font-size: 0.8rem;
  color: var(--c-accent);
}
.cTop * {
  font-weight: 400;
}
.cAnswer {
  padding: 0 0 0 16px;
  margin: 10px 0 0 40px;
  border-left: 3px solid var(--c-accent);
  font-size: 0.9rem;
  color: var(--c-text);
}
.commTd1 {
  padding: 5px 2px;
  width: 140px;
}
input.commFl,
textarea.commFl {
  width: 100%;
}
.eAttach {
  margin: 10px 0;
  color: var(--c-text-muted);
  padding: 0 0 0 15px;
}
.eRating {
  font-size: 0.75rem;
}
.commError,
.manTdError {
  color: var(--c-danger);
}
.commReg {
  padding: 10px 0;
  text-align: center;
}
a.groupModer:hover,
a.groupModer:link,
a.groupModer:visited {
  color: #3b82f6;
}
a.groupAdmin:hover,
a.groupAdmin:link,
a.groupAdmin:visited {
  color: var(--c-danger);
}
a.groupVerify:hover,
a.groupVerify:link,
a.groupVerify:visited {
  color: var(--c-success);
}
.replaceTable {
  font-size: 0.8rem;
  padding: 20px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  border-radius: var(--radius-md);
}
.legendTd {
  font-size: 0.7rem;
}
.outputPM {
  border: 1px dashed var(--c-border);
  margin: 4px 0 4px 30px;
  border-radius: var(--radius-sm);
}
.inputPM {
  border: 1px dashed var(--c-success);
  margin: 4px 0;
  border-radius: var(--radius-sm);
}
.module-board .catsTd,
.module-dir .catsTd,
.module-faq .fastLink {
  padding: 3px 0;
}
#content form[action$="search/"] table td {
  white-space: normal !important;
}
.module-index div[align="center"],
.popupbody div[align="center"] {
  overflow: auto;
}
.popupbody .uPM {
  margin-right: 20px;
}
button.cats-select-btn .btn-arrow {
  border-top-color: #fff;
}
#casing.popuptable,
.uTable {
  margin: 10px 0;
  padding: 20px;
  border-spacing: 0;
  background: var(--c-surface);
  border-radius: var(--radius-md);
}
.uTable td {
  padding: 10px 20px;
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.uTable td.uTopTd {
  font-size: 0.9rem;
  padding-top: 0;
  font-weight: 400 !important;
}
.eAttach .entryAttachSize {
  padding-left: 4px;
}
#uNetRegF,
#uNetRegF table,
.manTable {
  text-align: left;
}
.manTable .manTd1 {
  line-height: 14px;
}
#casing.popuptable {
  margin: 0 auto;
  color: var(--c-text-secondary);
}
.popuptitle {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  padding: 0 0 20px;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
}
.popupbody {
  font-size: 0.8rem;
  color: var(--c-text-secondary);
  padding: 20px 0 0;
}
.popupbody * {
  font-size: 0.8rem !important;
}
.popuptable table {
  text-align: left;
  color: var(--c-text-secondary);
}
.archiveEntryTitle ul {
  margin: 2px 0;
  list-style: circle;
}
.archiveEntryTitle .archiveEntryTime {
  display: inline-block;
  padding: 3px 8px;
  font-size: 0.7rem;
  color: #fff;
  background: var(--c-accent);
  border-radius: var(--radius-sm);
}
.archiveEntryTitle .archiveEntryTitleLink {
  font-size: 0.9rem;
  text-decoration: none;
}
.archiveEntryTitle .archiveEntryTitleLink:hover {
  color: var(--c-accent);
}
.archiveEntryTitle .archiveEntryComms {
  font-size: 0.7rem;
  color: var(--c-text-muted);
}
.user_avatar img {
  width: 100px;
  border: 2px solid var(--c-border) !important;
  padding: 2px !important;
  border-radius: 50%;
}
.cMessage .user_avatar img {
  width: 50px;
  margin: 0 10px 5px 0;
}

/* ── Reactions bar (icon-only style) ── */
.reactions-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 16px 0;
  border-top: 1px solid var(--c-border);
  margin: 24px 0 0;
  flex-wrap: wrap;
}
.reaction-btn,
.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--c-text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-sans);
}
.reaction-btn:hover,
.bookmark-btn:hover {
  color: var(--c-text);
  background: rgba(255, 255, 255, 0.06);
}
[data-theme="light"] .reaction-btn:hover,
[data-theme="light"] .bookmark-btn:hover {
  background: rgba(0, 0, 0, 0.04);
}
.reaction-btn.active.reaction-up {
  color: var(--c-success);
}
.reaction-btn.active.reaction-down {
  color: var(--c-danger);
}
.bookmark-btn.active {
  color: var(--c-accent);
}
.reaction-btn svg,
.bookmark-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.reaction-btn.active svg,
.bookmark-btn.active svg {
  fill: currentColor;
}
.reaction-count {
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Reaction comment popup (modal) ── */

/* ── USER ENGAGEMENT ── */

.reaction-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
}
.reaction-popup-overlay.open {
  opacity: 1;
  visibility: visible;
}
.reaction-popup {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: 90%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.reaction-popup-overlay.open .reaction-popup {
  transform: translateY(0);
}
.reaction-popup h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.reaction-popup textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  resize: none;
  min-height: 80px;
  margin: 0 0 12px;
}
.reaction-popup-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.reaction-popup .btn-send {
  padding: 8px 20px;
  background: var(--c-accent);
  color: #fff;
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background var(--transition);
}
.reaction-popup .btn-send:hover {
  background: var(--c-accent-hover);
}
.reaction-popup .btn-cancel {
  padding: 8px 20px;
  background: transparent;
  color: var(--c-text-muted);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all var(--transition);
}
.reaction-popup .btn-cancel:hover {
  border-color: var(--c-text-muted);
  color: var(--c-text);
}

/* ── Reactions ticker (marquee under article) ── */
.reactions-ticker {
  overflow: hidden;
  padding: 8px 0;
  margin: 0 0 24px;
}
.reactions-ticker .ticker-track {
  display: flex;
  gap: 24px;
  animation: tickerLeft 30s linear infinite;
  white-space: nowrap;
}
.reactions-ticker:hover .ticker-track {
  animation-play-state: paused;
}
@keyframes tickerLeft {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}
.reaction-ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--c-text-muted);
  flex-shrink: 0;
}
.reaction-ticker-item .rt-icon {
  font-size: 0.85rem;
}
.reaction-ticker-item .rt-text {
  color: var(--c-text-secondary);
  font-style: italic;
}

/* ── Share bar (floating on desktop, fixed on mobile) ── */
.share-bar {
  position: sticky;
  top: calc(var(--header-h) + 80px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  float: left;
  margin-left: -60px;
  margin-right: 16px;
}
.share-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-text-secondary);
  transition: all var(--transition);
}
.share-bar a:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.share-bar svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ── Read time badge ── */
.read-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--c-text-muted);
}
.read-time svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ── Table of Contents ── */
/* Default: slide-in panel + toggle button (bottom-right, out of the way) */
.toc-wrapper {
  position: fixed;
  top: calc(var(--header-h) + 16px);
  right: 16px;
  left: auto;
  width: 260px;
  max-height: calc(100vh - var(--header-h) - 32px);
  overflow-y: auto;
  z-index: 80;
  background: var(--c-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-lg);
  transform: translateX(120%);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
  pointer-events: none;
}
body.u-admin .toc-wrapper {
  top: calc(var(--header-h) + 48px);
}
.toc-wrapper.toc-open {
  transform: translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.toc-toggle {
  position: fixed;
  bottom: 80px;
  right: 20px;
  left: auto;
  top: auto;
  z-index: 81;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c-text-secondary);
  transition: all var(--transition);
}
.toc-toggle:hover {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.toc-toggle svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toc-open ~ .toc-toggle {
  background: var(--c-accent);
  color: #fff;
  border-color: var(--c-accent);
}
.toc-wrapper h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
  padding: 16px 20px 8px;
  position: sticky;
  top: 0;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.toc-wrapper ol {
  margin: 0;
  padding: 8px 20px 16px;
  counter-reset: toc;
  list-style: none;
}
.toc-wrapper li {
  padding: 5px 0;
  counter-increment: toc;
}
.toc-wrapper li::before {
  content: counter(toc) ". ";
  font-weight: 600;
  color: var(--c-accent);
  font-size: 0.8rem;
}
.toc-wrapper li a {
  font-size: 0.8rem;
  color: var(--c-text-secondary);
  transition: color var(--transition);
}
.toc-wrapper li a:hover {
  color: var(--c-accent);
}
.toc-wrapper li.toc-h3 {
  padding-left: 16px;
}
/* Wide screens: TOC as fixed sidebar on the left */
@media (min-width: 1440px) {
  .toc-wrapper {
    position: fixed;
    top: calc(var(--header-h) + 24px);
    right: auto;
    left: max(12px, calc((100vw - 780px) / 2 - 280px));
    transform: none;
    opacity: 1;
    pointer-events: auto;
    box-shadow: none;
    border: 1px solid var(--c-border);
  }
  body.u-admin .toc-wrapper {
    top: calc(var(--header-h) + 56px);
  }
  .toc-toggle {
    display: none;
  }
}
@media (max-width: 480px) {
  .toc-wrapper {
    width: calc(100vw - 32px);
    right: 16px;
  }
  .toc-toggle {
    bottom: 72px;
    right: 16px;
  }
}

/* ── FOOTER v2 — Multi-column with categories ── */

/* ── FOOTER ── */

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  padding: 40px 0 32px;
}
.footer-col h4 {
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
}
.footer-col a {
  display: block;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  padding: 3px 0;
  transition: color var(--transition);
  text-decoration: none;
}
.footer-col a:hover {
  color: rgba(255, 255, 255, 0.8);
}
.footer-brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.footer-tagline {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.6;
  margin: 0;
}
.footer-copy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.3);
  margin: 8px 0 0;
}
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 16px 0;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.25);
}

/* ── COMMENTS & REACTIONS FIXES ── */
/* ── Reactions bar: reactions left, bookmark right ── */
.bookmark-btn {
  margin-left: auto;
}
/* Reaction animations */
.reaction-btn.active,
.bookmark-btn.active {
  animation: hw-pulse 0.3s ease;
}
@keyframes hw-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

/* ── Hide hw-marker comments before JS parses them ── */
.uComment[style*="display:none"],
.uComment.hw-hidden {
  display: none !important;
}
