/* ===================================================
   CROSSWORD FORUM — Modern Design System
   =================================================== */


/* --- CSS Custom Properties — LIGHT (default) --- */
:root {
  --bg-primary: #f4f6fb;
  --bg-secondary: #eaecf4;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f3fa;
  --bg-glass: rgba(0,0,0,0.03);
  --bg-glass-hover: rgba(0,0,0,0.06);

  --accent-blue: #4f8ef7;
  --accent-blue-soft: rgba(79,142,247,0.12);
  --accent-green: #22c55e;
  --accent-green-soft: rgba(34,197,94,0.1);
  --accent-yellow: #f59e0b;
  --accent-yellow-soft: rgba(245,158,11,0.1);
  --accent-red: #ef4444;
  --accent-red-soft: rgba(239,68,68,0.08);
  --accent-purple: #8b5cf6;
  --accent-purple-soft: rgba(139,92,246,0.1);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-accent: #4f8ef7;

  --border-subtle: rgba(0,0,0,0.07);
  --border-normal: rgba(0,0,0,0.12);
  --border-accent: rgba(79,142,247,0.35);

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --shadow-glow-blue: 0 0 20px rgba(79,142,247,0.15);
  --shadow-glow-green: 0 0 20px rgba(34,197,94,0.12);
  --shadow-glow-yellow: 0 0 20px rgba(245,158,11,0.12);

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-full: 0;

  --transition: 0.2s ease;
  --transition-slow: 0.35s ease;

  --nav-height: 64px;
  --sidebar-width: 325px;
}


/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background var(--transition-slow), color var(--transition-slow);
}



a { color: var(--accent-blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: #7eaaff; }

img { max-width: 100%; }

ul, ol { list-style: none; }

/* ===================================================
   NAVIGATION
   =================================================== */

.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: background var(--transition-slow);
}

.site-nav {
  background: rgba(244, 246, 251, 0.92);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  white-space: nowrap;
}

.nav-logo .logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.nav-logo .logo-grid-icon {
  display: grid;
  grid-template-columns: repeat(2, 9px);
  grid-template-rows: repeat(2, 9px);
  gap: 3px;
  place-content: center;
}

.nav-logo .logo-grid-icon span {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.nav-logo .logo-grid-icon span.is-filled {
  background: #fff;
}

.nav-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.site-nav .nav-search {
  display: none;
}

.nav-search input {
  width: 100%;
  background: var(--bg-glass);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-full);
  padding: 9px 16px 9px 40px;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

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

.nav-search input:focus {
  border-color: var(--accent-blue);
  background: var(--bg-glass-hover);
  box-shadow: var(--shadow-glow-blue);
}

.nav-search .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 30px;
  transition: color var(--transition), background var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-glass);
}

.nav-btn {
  background: var(--accent-blue);
  color: #fff !important;
  border-radius: var(--radius-full) !important;
  font-weight: 600 !important;
  transition: opacity var(--transition) !important;
}

.nav-btn:hover { opacity: 0.9; background: #092149; }

.nav-auth-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-auth-pill {
    align-items: center;
    padding: 6px 12px;
    border: 1px solid var(--border-normal);
    background: var(--accent-green-soft);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
}

.nav-auth-pill strong {
  margin-left: 4px;
  color: var(--accent-green);
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  margin-left: auto;
}


/* ===================================================
   LAYOUT
   =================================================== */

.page-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: calc(var(--nav-height) + 32px) 24px 64px;
  display: grid;
  /* sidebar stays right until very small; min content width = 320px */
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: 28px;
  align-items: start;
}

.main-col { min-width: 0; }

/* sticky sidebar so it scrolls nicely */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 16px);
  max-height: calc(100vh - var(--nav-height) - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

/* ===================================================
   BREADCRUMB
   =================================================== */

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent-blue); }
.breadcrumb .sep { opacity: 0.4; }

/* ===================================================
   QUESTION CARD (MAIN HERO)
   =================================================== */

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Type 1: no answer - red */
.question-card.status-none::before { background: var(--accent-red); }
/* Type 2: community - yellow */
.question-card.status-community::before { background: linear-gradient(90deg, var(--accent-yellow), #f97316); }
/* Type 3: verified - green */
.question-card.status-verified::before { background: linear-gradient(90deg, var(--accent-green), #16a34a); }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.status-badge.badge-none {
  background: var(--accent-red-soft);
  color: #b70000;
  border: 1px solid rgba(239,68,68,0.2);
}

.status-badge.badge-community {
  background: var(--accent-yellow-soft);
  color: #a77900;
  border: 1px solid rgba(245,158,11,0.25);
}

.status-badge.badge-verified {
  background: var(--accent-green-soft);
  color: #327a39;
  border: 1px solid rgba(34,197,94,0.25);
}

.question-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--text-primary) 60%, var(--text-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.question-meta span { display: flex; align-items: center; gap: 5px; }

.question-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* ===================================================
   CTA BLOCK (type 1 — no answer)
   =================================================== */

.cta-community {
  background: linear-gradient(135deg, rgba(79,142,247,0.1), rgba(139,92,246,0.08));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-community::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  background: radial-gradient(circle, rgba(79,142,247,0.12) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.cta-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
}

.cta-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.cta-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 20px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ===================================================
   ANSWER DISPLAY (type 2 & 3)
   =================================================== */

.section-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon { font-size: 20px; }

.answers-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; }

.answer-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
  cursor: default;
}

.answer-card:hover {
  border-color: var(--border-normal);
  background: var(--bg-card-hover);
  transform: translateY(-1px);
}

/* Verified answer card */
.answer-card.verified {
  border-color: rgba(34,197,94,0.3);
  background: rgba(34,197,94,0.05);
  box-shadow: none;
}

.answer-card.top-community {
  border-color: rgba(245,158,11,0.3);
  background: rgba(245,158,11,0.05);
}

.answer-letters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  flex: 1;
}

.letter-box {
  width: 36px;
  height: 40px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  text-transform: uppercase;
  transition: background var(--transition), border-color var(--transition);
}

.letter-box-num {
  position: absolute;
  top: 2px;
  left: 4px;
  font-size: 0.55rem;
  line-height: 1;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.8;
}

.letter-box-char {
  display: inline-block;
  line-height: 1;
}

.answer-card.verified .letter-box {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
  color: #137a39;
}

.answer-card.top-community .letter-box {
  background: rgba(245,158,11,0.1);
  border-color: rgba(245,158,11,0.3);
      color: #a77900;
}

.answer-info {
  flex: 1;
  min-width: 0;
}

.answer-word {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.answer-word.verified-word { color: var(--accent-green); }
.answer-word.community-word { color: #f56e0b; }

.answer-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* Verified badge */
.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #009536;
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
}

/* ===================================================
   VOTING SYSTEM
   =================================================== */

.vote-group {
  display: grid;
  align-items: center;
  gap: 6px;
}

.vote-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-normal);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.vote-btn:hover { background: var(--bg-glass-hover); }

.vote-btn.vote-yes:hover, .vote-btn.vote-yes.active {
  border-color: #22c55e;
  color: #4ade80;
  background: var(--accent-green-soft);
}

.vote-btn.vote-no:hover, .vote-btn.vote-no.active {
  border-color: #ef4444;
  color: #fc8181;
  background: var(--accent-red-soft);
}

.vote-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 24px;
  text-align: center;
  font-weight: 600;
}

/* Progress to verification */
.vote-progress {
  margin-top: 12px;
  padding: 12px 16px;
  background: var(--accent-yellow-soft);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.vote-progress-bar {
  height: 4px;
  background: rgba(245,158,11,0.15);
  border-radius: 99px;
  margin-top: 8px;
  overflow: hidden;
}

.vote-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-yellow), #f97316);
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ===================================================
   SUBMIT FORM
   =================================================== */

.submit-section {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 28px;
}

.submit-section h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-full { grid-column: 1 / -1; }

.form-group { display: flex; flex-direction: column; gap: 6px; }

.form-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-input, .form-select, .form-textarea {
  background: var(--bg-secondary);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79,142,247,0.12);
}

.form-input::placeholder, .form-textarea::placeholder { color: var(--text-muted); }

.form-select { appearance: none; cursor: pointer; }

.form-textarea { resize: vertical; min-height: 80px; }

.form-select option { background: var(--bg-card); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  padding: 11px 24px;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue), #6366f1);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,142,247,0.3);
}

.btn-primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(79,142,247,0.4);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-glass);
  border: 1px solid var(--border-normal);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

.btn-success { background: linear-gradient(135deg, var(--accent-green), #16a34a); color: #fff; }
.btn-success:hover { opacity: 0.9; transform: translateY(-1px); color: #fff; }

/* ===================================================
   COMMENTS TREE
   =================================================== */

.comments-section {
  margin-bottom: 28px;
}

.comment {
  position: relative;
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  transition: border-color var(--transition);
}

.comment:hover { border-color: var(--border-normal); }

/* Nested comments */
.comment-children {
  margin-top: 12px;
  margin-left: 28px;
  padding-left: 20px;
  border-left: 2px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comment-children .comment { background: var(--bg-secondary); }

.comment-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.comment-author-info { flex: 1; }

.comment-author-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-author-name .user-badge {
  font-size: 0.68rem;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-moderator { background: rgba(139,92,246,0.2); color: #c4b5fd; border: 1px solid rgba(139,92,246,0.3); }
.badge-expert { background: rgba(245,158,11,0.15); color: #fbbf24; border: 1px solid rgba(245,158,11,0.25); }
.badge-active { background: rgba(79,142,247,0.15); color: #93c5fd; border: 1px solid rgba(79,142,247,0.25); }
.badge-newbie { background: rgba(100,116,139,0.15); color: #94a3b8; border: 1px solid rgba(100,116,139,0.2); }

.comment-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.comment-body { font-size: 0.88rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 12px; }

.comment-solution {
  background: var(--accent-yellow-soft);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: #fbbf24;
  font-size: 0.9rem;
  display: inline-block;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.comment-solution.solution-verified {
  background: var(--accent-green-soft);
  border-color: rgba(34,197,94,0.25);
  color: #4ade80;
}

/* ===================================================
   COMMENT SOLUTION — LETTER BOXES
   =================================================== */

.comment-solution-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-bottom: 10px;
  align-items: center;
}

.comment-solution-boxes .cs-letter {
  width: 28px;
  height: 31px;
  background: var(--accent-yellow-soft);
  border: 1px solid rgba(245,158,11,0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  font-weight: 700;
  color: #af7e00;
  text-transform: uppercase;
  animation: letterPop 0.25s ease both;
}

.comment-solution-boxes.verified-boxes .cs-letter {
  background: var(--accent-green-soft);
  border-color: rgba(34,197,94,0.3);
  color: #4ade80;
}

.comment-solution-boxes .cs-letter-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-left: 6px;
  font-family: inherit;
  font-weight: 500;
  align-self: center;
}

@keyframes letterPop {
  from { opacity: 0; transform: scale(0.7) translateY(4px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ===================================================
   LETTER COUNTER (form input badge)
   =================================================== */

.letter-counter {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-secondary);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  transition: color var(--transition), background var(--transition), border-color var(--transition);
  white-space: nowrap;
  font-family: 'JetBrains Mono', monospace;
}

.letter-counter.has-letters {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-color: rgba(79,142,247,0.3);
}

/* ===================================================
   SOLUTION PREVIEW (live letter boxes under input)
   =================================================== */

.solution-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-normal);
  border-radius: var(--radius-md);
  min-height: 52px;
  align-items: center;
  transition: border-color var(--transition);
}

.solution-preview.has-input {
  border-color: rgba(79,142,247,0.3);
  border-style: solid;
}

.solution-preview .prev-letter {
  width: 32px;
  height: 36px;
  background: var(--accent-blue-soft);
  border: 1px solid rgba(79,142,247,0.3);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-blue);
  text-transform: uppercase;
  animation: letterPop 0.15s ease both;
}

.solution-preview .prev-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: 0 auto;
  font-style: italic;
}

.letter-counter { background: #f1f5f9; }
.letter-counter.has-letters { background: rgba(79,142,247,0.1); }
.solution-preview { background: #f8fafc; }
.comment-solution-boxes .cs-letter { background: rgba(245,158,11,0.08); }
.comment-solution-boxes.verified-boxes .cs-letter { background: rgba(34,197,94,0.08); }

.comment-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-like, .btn-dislike, .btn-reply {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  font-weight: 500;
}

.btn-like { color: var(--text-muted); }
.btn-like:hover, .btn-like.active { color: var(--accent-green); background: var(--accent-green-soft); }

.btn-dislike { color: var(--text-muted); }
.btn-dislike:hover, .btn-dislike.active { color: var(--accent-red); background: var(--accent-red-soft); }

.btn-reply { color: var(--accent-blue); }
.btn-reply:hover { background: var(--accent-blue-soft); }

.comment-separator {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* ===================================================
   SEO TEXT BLOCK
   =================================================== */

.seo-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 28px;
}

.seo-block h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.seo-block p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 8px;
}

.seo-block p:last-child { margin-bottom: 0; }

/* ===================================================
   NAVIGATION BETWEEN CLUES
   =================================================== */

.clue-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 28px;
}

.clue-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-size: 0.82rem;
}

.clue-nav-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: var(--accent-blue-soft);
}

.clue-nav-btn .nav-dir {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.clue-nav-btn.nav-next { text-align: right; }

/* ===================================================
   SIDEBAR
   =================================================== */

.sidebar { display: flex; flex-direction: column; gap: 20px;     margin-top: 40px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.widget-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
}

/* Search widget */
.widget-search {
  display: flex;
  gap: 8px;
}

.widget-search input {
flex: 1;
    background: #ffffff;
    border: 1px solid var(--border-normal);
    border-radius: 12px;
    padding: 13px 15px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
	width: 100%;
}

.widget-search input:focus { border-color: var(--accent-blue); }
.widget-search input::placeholder { color: var(--text-muted); }

.widget-search button {
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid;
    font-family: inherit;
    transition: opacity var(--transition);
    background: #f1f5f9;
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-secondary);
}

.widget-search button:hover { opacity: 0.85; }

.widget-search .clue-search-submit-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: var(--accent-blue);
  color: #fff;
  cursor: pointer;
  box-sizing: border-box;
  transition: opacity var(--transition), transform var(--transition);
}

.widget-search .clue-search-submit-btn:hover {
  opacity: .9;
  transform: translateY(-1px);
}

.widget-search .clue-search-submit-btn svg {
  display: block;
  flex: none;
}

.search-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.search-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.search-chip:hover {
  border-color: var(--border-accent);
  color: var(--accent-blue);
  background: var(--bg-card);
}

.mobile-search-fab {
position: fixed;
    right: 14px;
    bottom: 18px;
    z-index: 70;
    display: none;
    border: none;
    border-radius: 999px;
    background: #eee;
    color: #fff;
    cursor: pointer;
    transition: opacity .22s ease, transform .22s ease, box-shadow .22s ease;
    animation: mobileSearchFabIn .28s ease;
    box-shadow: 0 18px 38px rgba(37, 99, 235, .34);
}

.mobile-search-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(37,99,235,.34);
}

.mobile-search-fab-image {
width: 44px;
    height: 44px;
    display: block;
}

.mobile-search-fab,
.mobile-search-fab-image {
  border-radius: 999px !important;
}

.mobile-search-fab-label {
  color: #fff;
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1;
}

.mobile-search-fab.is-hidden {
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
}

.mobile-search-panel {
    position: fixed;
    right: 12px;
    bottom: 20px;
    z-index: 70;
    opacity: 0;
	background: #fff;
    transform: translateY(18px) scale(.98);
    pointer-events: none;
    border: 1.5px solid var(--hv2-grey-200, #E7E5E4);
    border-radius: 20px;
    padding: 16px;
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.14);
    transition: opacity .22s ease, transform .22s ease;
	
	
}

.mobile-search-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.mobile-search-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mobile-search-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 800;
}

.mobile-search-panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 50%;
    color: #4d4a4a;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1px;
}

.mobile-search-panel-close:hover {
  opacity: .92;
}

@media (max-width: 680px) {
  .mobile-search-fab {
    display: inline-flex;
  }
}

@keyframes mobileSearchFabIn {
  from { opacity: 0; transform: translateY(12px) scale(.92); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-widget-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.18);
  transition: transform 0.15s ease, opacity 0.15s ease, box-shadow 0.15s ease;
}

.profile-widget-btn:hover {
  opacity: 0.96;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

/* User rating widget */
.user-rank-list { display: flex; flex-direction: column; gap: 10px; }

.user-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  cursor: pointer;
}

.user-rank-item:hover { background: var(--bg-glass); }

.rank-pos {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.rank-pos.gold { color: #f59e0b; }
.rank-pos.silver { color: #94a3b8; }
.rank-pos.bronze { color: #cd7c3a; }

.rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.rank-info { flex: 1; min-width: 0; }

.rank-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-score {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.rank-badge-icon { font-size: 16px; }

/* Popular / recent clue list */
.clue-list { display: flex; flex-direction: column; gap: 2px; }

.clue-list-item {
    display: block;
    padding: 7px 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    transition: all var(--transition);
    white-space: normal;
    overflow: visible;
    border-bottom: 1px solid #eee;
    text-overflow: clip;
    line-height: 1.35;
}

.clue-list-item:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.clue-list-item .clue-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--text-muted);
  vertical-align: middle;
}

.clue-list-item .clue-dot.green { background: var(--accent-green); }
.clue-list-item .clue-dot.yellow { background: var(--accent-yellow); }
.clue-list-item .clue-dot.red { background: var(--accent-red); }

/* ===================================================
   FOOTER
   =================================================== */

.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 48px 0 24px;
  margin-top: 64px;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 8px; }

.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition);
}

.footer-col ul li a:hover { color: var(--text-secondary); }

.footer-search {
  display: flex;
  gap: 8px;
}

.footer-search input {
  flex: 1;
  background: var(--bg-glass);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-primary);
  font-size: 0.85rem;
  font-family: inherit;
  outline: none;
}

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

.footer-search input:focus { border-color: var(--accent-blue); }

.footer-search button {
  background: var(--accent-blue);
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  color: #fff;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: inherit;
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 8px;
}

/* ===================================================
   TOAST NOTIFICATION
   =================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
}

.toast {
  background: var(--bg-card);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 0.85rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 320px;
}

.toast.toast-success { border-left: 3px solid var(--accent-green); }
.toast.toast-info { border-left: 3px solid var(--accent-blue); }
.toast.toast-warning { border-left: 3px solid var(--accent-yellow); }

@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { transform: translateX(120%); opacity: 0; }
}

/* ===================================================
   REPLY FORM (inline)
   =================================================== */

.reply-form {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  display: none;
}

.reply-form.open { display: block; animation: expandIn 0.2s ease; }

@keyframes expandIn {
  from { opacity: 0; transform: scaleY(0.9); transform-origin: top; }
  to { opacity: 1; transform: scaleY(1); }
}

.reply-form textarea {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-sm);
  padding: 10px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  resize: vertical;
  min-height: 70px;
  outline: none;
  margin-bottom: 10px;
}

.reply-form textarea:focus { border-color: var(--accent-blue); }
.reply-form textarea::placeholder { color: var(--text-muted); }

.reply-form .reply-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ===================================================
   MODERATOR PANEL (type 3)
   =================================================== */

.moderator-panel {
  background: rgba(139,92,246,0.08);
  border: 1px solid rgba(139,92,246,0.2);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 28px;
}

.moderator-panel h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #7b63d7;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.moderator-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.moderator-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #4f8ef7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}

/* ===================================================
   RESPONSIVE
   =================================================== */

/* ---- 1100px: shrink sidebar a bit ---- */
@media (max-width: 1100px) {
  :root { --sidebar-width: 310px; }
}

/* ---- 860px: narrower sidebar, hide some nav links ---- */
@media (max-width: 860px) {
  :root { --sidebar-width: 280px; }
  .nav-toggle { display: block; }
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    position: absolute;
    top: calc(100% + 8px);
    left: 12px;
    right: 12px;
    width: auto;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
  }
  .nav-links.open a {
    display: flex !important;
    align-items: center;
    justify-content: flex-start;
    min-height: 42px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-weight: 600;
  }
  .nav-links.open > a[aria-current="page"] {
    background: var(--accent-blue-soft);
    border-color: var(--border-accent);
    color: var(--accent-blue);
  }
  .nav-auth-status {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    padding: 12px 0 0;
  }
  .nav-links.open .nav-auth-status {
    display: flex;
    border-top: 1px solid var(--border-subtle);
    margin-top: 2px;
  }
  .nav-links.open .nav-auth-pill {
		width: 100%;
        max-width: 100%;
        min-height: 42px;
        padding: 10px 12px;
        text-align: center;
  }
  .nav-links.open .nav-btn,
  .nav-links.open .nav-logout {
    justify-content: center;
  }
  .nav-links.open .nav-logout {
    display: flex;
    align-items: center;
    min-height: 42px;
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-weight: 600;
  }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ---- 680px: stack sidebar below main ---- */
@media (max-width: 680px) {
  :root { --nav-height: 56px; }

  .page-wrap {
    grid-template-columns: 1fr;
    padding: calc(var(--nav-height) + 16px) 14px 48px;
    gap: 20px;
  }

  /* sidebar moves below main content */
  .sidebar {
    position: static;
    max-height: none;
    order: 1; 
	margin: 0;
  }

  .widget[data-clue-search-widget] {
    display: none;
  }

  /* hide theme toggle label on small screens */
  .theme-toggle-label { display: none; }

  .nav-search { max-width: none; flex: 1; }

  .question-title { font-size: 1.5rem; }
  .question-card { padding: 20px; }
  .submit-section { padding: 20px; }

  .form-grid { grid-template-columns: 1fr; }

  .clue-nav { grid-template-columns: 1fr; }
  .clue-nav-btn.nav-next { text-align: left; }

  .answer-card { flex-wrap: wrap; display: block;}
  .answer-info { margin-bottom: 10px; margin-top: 5px; margin-left: 5px;}
  .answer-actions { width: 100%; flex-direction: row; justify-content: flex-end; }

  .vote-group {  display: flex;}

  .cta-community { padding: 20px; }

  .footer-grid { grid-template-columns: 1fr; gap: 20px; }

  .toast-container { right: 10px; bottom: 10px; }
  .toast { max-width: 260px; font-size: 0.82rem; }
}

@media (max-width: 480px) {
  .page-wrap { padding-left: 12px; padding-right: 12px; }
  .question-title { font-size: 1.25rem; }
  .answer-letters { gap: 3px; }
  .letter-box { width: 30px; height: 34px; font-size: 0.82rem; }
  .letter-box-num { top: 2px; left: 3px; font-size: 0.5rem; }
  .vote-group { flex-wrap: wrap; }
  .nav-search { display: none; }

}

/* ===================================================
   LIGHT THEME — extra overrides (always active)
   =================================================== */

.nav-search input {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
}

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

.form-input,
.form-select,
.form-textarea {
  background: #fff;
  border-color: rgba(0,0,0,0.14);
  color: var(--text-primary);
}

.form-select option { background: #fff; color: #0f172a; }

.vote-btn {
  background: #f1f5f9;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-secondary);
}

.vote-btn:hover { background: #e2e8f0; }

.letter-box {
  background: #f8fafc;
  border-color: rgba(0,0,0,0.14);
  color: var(--text-primary);
}

.comment {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
}

.comment-children .comment {
  background: #f8fafc;
}

.reply-form {
  background: #f1f5f9;
  border-color: rgba(0,0,0,0.08);
}

.reply-form textarea {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
}

.widget {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.submit-section {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.question-card {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

.cta-community {
  background: linear-gradient(135deg, rgba(79,142,247,0.07), rgba(139,92,246,0.05));
}

.answer-card {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
}

.answer-card:hover {
  background: #f8fafc;
}

.answer-card.verified {
  background: rgba(34,197,94,0.06);
}

.answer-card.top-community {
  background: rgba(245,158,11,0.06);
}

.site-footer {
  background: #e8edf5;
  border-top-color: rgba(0,0,0,0.08);
}

.toast {
  background: #fff;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.clue-list-item {
  color: var(--text-secondary);
}

.clue-list-item:hover {
  background: rgba(0,0,0,0.04);
  color: var(--text-primary);
}

.user-rank-item:hover {
  background: rgba(0,0,0,0.04);
}

.btn-secondary {
  background: #f1f5f9;
  border-color: rgba(0,0,0,0.12);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.moderator-panel {
  background: rgba(139,92,246,0.05);
  border-color: rgba(139,92,246,0.15);
}

.vote-progress {
  background: rgba(245,158,11,0.08);
}

.seo-block {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
}

.clue-nav-btn {
  background: #fff;
  border-color: rgba(0,0,0,0.08);
}

.clue-nav-btn:hover {
  background: rgba(79,142,247,0.07);
  border-color: var(--accent-blue);
}

.footer-search input {
  background: rgba(0,0,0,0.05);
  border-color: rgba(0,0,0,0.12);
  color: var(--text-primary);
}

.question-title {
  background: linear-gradient(135deg, #0f172a 60%, #475569);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-logo { color: var(--text-primary); }

.nav-links a:hover { color: #ffffff; background: #4e607d; }
.section-desc {
    padding-left: 10px;
}
/* ===== Comment Solution Boxes ===== */
.comment-solution-boxes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  margin: 10px 0 6px;
}

.cs-letter {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--accent-blue);
  border-radius: 6px;
  background: rgba(79,142,247,0.08);
  color: var(--accent-blue);
  font-weight: 700;
  font-size: 0.85rem;
  font-family: 'JetBrains Mono', monospace;
  animation: csLetterPop 0.3s ease both;
}

@keyframes csLetterPop {
  from { opacity: 0; transform: scale(0.7); }
  to   { opacity: 1; transform: scale(1); }
}

.cs-letter-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 6px;
}

/* ===== Like / Dislike Buttons ===== */
.btn-like, .btn-dislike {
  background: none;
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-full);
  padding: 4px 12px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.btn-like:hover {
  background: rgba(34, 197, 94, 0.12);
  border-color: #22c55e;
  color: #22c55e;
}

.btn-dislike:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: #ef4444;
  color: #ef4444;
}

.btn-reply {
  background: none;
  border: none;
  padding: 4px 8px;
  font-size: 0.82rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
  font-family: inherit;
}

.btn-reply:hover { color: var(--accent-blue); }

/* ===== Reply Form ===== */
.reply-form {
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-normal);
  border-radius: var(--radius-md);
}

.reply-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  justify-content: flex-end;
}

/* ===== Nested Comment Children ===== */
.comment-children {
  margin-top: 12px;
  padding-left: 20px;
  border-left: 2px solid var(--border-normal);
}

.comment-children .comment {
  margin-top: 12px;
}

/* ===== Comment separator ===== */
.comment-separator > .comment + .comment {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

/* ===== Square Template Override ===== */
:root {
  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-full: 0;
}

*,
*::before,
*::after {
  border-radius: 0 !important;
}

button,
.btn,
.nav-btn,
.nav-toggle,
.nav-logout,
.social-btn,
.clue-search-submit-btn,
.btn-search-mask,
.mask-toggle-btn,
.mask-close-btn,
.profile-widget-btn,
.answer-admin-btn,
.vote-btn,
.btn-like,
.btn-dislike,
.btn-reply,
input,
textarea,
select,
.form-input,
.form-select,
.form-textarea {
  border-radius: 0 !important;
}

button,
.btn,
.nav-btn,
.nav-toggle,
.nav-logout,
.social-btn,
.clue-search-submit-btn,
.btn-search-mask,
.mask-toggle-btn,
.mask-close-btn,
.profile-widget-btn,
.answer-admin-btn,
.vote-btn,
.btn-like,
.btn-dislike,
.btn-reply {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--border-normal) !important;
}

input,
textarea,
select,
.form-input,
.form-select,
.form-textarea {
  border-width: 1px !important;
  border-style: solid !important;
  border-color: var(--border-normal) !important;
}
