/* ═══════════════════════════════════════════
   MINT — Shared Stylesheet
   Import this in every topic page:
   <link rel="stylesheet" href="mint-shared.css" />
   ═══════════════════════════════════════════ */

:root {
  --bg: #0f1724;
  --bg2: #142033;
  --bg3: #1a283e;
  --bg4: #213049;
  --border: #22314a;
  --border2: #2c3d5a;
  --border3: #3c5072;
  --text: #ede8dc;
  --text2: #b4bac6;
  --text3: #7f899c;
  --primary: #8fd9c4;
  --primary2: #6cc0aa;
  --green: #8fd9c4;
  --red: #ef8a7a;
  --gold: #e8b45a;
  --blue: #8fb8ef;
  --purple: #c0a4ea;
  --teal: #7fd0d0;
  --orange: #f0a070;
  --card-bg: #142033;
  --card-hover: #172539;
  --grid: rgba(143,217,196,.045);
  --grid-major: rgba(143,217,196,.065);
  --shadow: none;
  --shadow-lg: 0 6px 24px rgba(0,0,0,.45);
  --radius: 6px;
  --radius-sm: 4px;

  --font-disp:   'Playfair Display', Georgia, serif;
  --font-header:'Roboto Slab', Georgia, serif;
  --font-body:   'DM Sans', sans-serif;
  --font-serif:  'Crimson Pro', Georgia, serif;
  --font-mono:   'DM Sans', sans-serif;

  --text-xs:    12px;
  --text-sm:    12.4px;
  --text-base:  15px;
  --text-about: 12.5px;
  --text-md:    17px;
  --text-lg:    17.5px;
  --text-xl:    20px;
  --text-2xl:   26px;
  --text-3xl:   32px;
}

html.light {
  --bg: #f5f1e6;
  --bg2: #fffdf8;
  --bg3: #efe9da;
  --bg4: #e6dfcd;
  --border: #ddd5c2;
  --border2: #cfc6b0;
  --border3: #b5ab93;
  --text: #1f2328;
  --text2: #4a4f57;
  --text3: #80796b;
  --primary: #2a7a68;
  --primary2: #1f5e50;
  --green: #2a7a68;
  --red: #b8402f;
  --gold: #b07a1e;
  --blue: #2c5da8;
  --purple: #6a46a8;
  --teal: #1f7a78;
  --orange: #b85c22;
  --card-bg: #fffdf8;
  --card-hover: #fbf8f0;
  --grid: rgba(42,122,104,.05);
  --grid-major: rgba(42,122,104,.09);
  --shadow: none;
  --shadow-lg: 0 6px 20px rgba(60,50,30,.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: var(--bg); }

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
  color: var(--text);
  min-height: 100vh;
  font-size: var(--text-base);
  line-height: 1.7;
  font-weight: 400;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  transition: background .25s, color .25s;
}

/* Page changes crossfade in browsers that support it; others just switch instantly */
@view-transition { navigation: auto; }
.hidden { display: none !important; }

/* ── CORNERS ── */
.sidebar, .question-card, .detail-card, .i-card, .form-card, .modal,
.post-dropdown-menu, .toast, .topic-card, .q-card, .q-picker-list,
.ssc-accordion-item { border-radius: var(--radius); }
.btn, .btn-post-main, .theme-btn, .search-input, .q-search-input,
.form-input, .form-textarea, .form-select, .comment-input, .comment-item,
.i-example, .err-box, .login-notice, .auth-msg, .auth-tabs, .auth-tab,
.tabs-list, .tab-btn, .sort-btn, .subtopic-btn, .ssc-btn, .preview-toggle,
.preview-tab, .preview-rendered, .sub-preview, .link-item, .btn-google,
.btn-google-modal, .vote-btn, .comment-btn, .btn-report, .btn-edit,
.search-clear, .img-preview-box img, .user-pill, .btn-post-chevron,
.remove-link-btn { border-radius: var(--radius-sm); }
.tag-primary, .tag-secondary, .qtag, .t-tag, .sub-preview-tag,
.topic-pill-option, .q-chip, .active-filter-pill, .hl, .spoiler { border-radius: 3px; }
.user-pill-dot, .ssc-type-dot { border-radius: 50%; }

/* ── KEYBOARD FOCUS (only shows for keyboard users, not mouse clicks) ── */
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.form-input:focus-visible, .form-textarea:focus-visible, .search-input:focus-visible,
.comment-input:focus-visible, .q-search-input:focus-visible { outline: none; }

/* ── HEADER ── */
header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 1060px; margin: 0 auto; padding: 0 32px;
  height: 68px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px;
}

/* ── LOGO — matches index.html exactly ── */
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; flex-shrink: 0; }
.logo-mark-svg { width: 40px; height: 40px; flex-shrink: 0; }
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-name {
  font-family: var(--font-header);
  font-size: var(--text-xl);
  font-weight: 900;
  color: var(--text);
  letter-spacing: .01em;
}
.logo-tagline{font-size:12.5px;color:var(--text3);font-weight:400}


.header-right { display: flex; align-items: center; gap: 14px; }
.theme-btn {
  width: 36px; height: 36px;
  border: 1px solid var(--border2); background: var(--bg3);
  color: var(--text2); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.theme-btn:hover { border-color: var(--border3); color: var(--text); background: var(--bg4); }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px;
  background: var(--bg3); border: 1px solid var(--border2);
  font-size: var(--text-sm);
  color: var(--text2); font-weight: 500;
}
.user-pill-dot { width: 7px; height: 7px; background: var(--green); flex-shrink: 0; }

/* ── POST DROPDOWN ── */
.post-dropdown-wrap { position: relative; flex-shrink: 0; }
.btn-post-main {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border: none;
  font-family: var(--font-body); font-size: var(--text-sm);
  font-weight: 700; cursor: pointer;
  background: var(--primary); color: #101a17;
  transition: filter .15s; white-space: nowrap; letter-spacing: .01em;
}
html.light .btn-post-main { color: #fff; }
.btn-post-main:hover { filter: brightness(1.08); }
.btn-post-chevron {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px;
  background: rgba(0,0,0,.15); margin-left: 2px; transition: background .15s;
}
.btn-post-main:hover .btn-post-chevron { background: rgba(0,0,0,.25); }
.post-dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 240px; background: var(--bg2);
  border: 1px solid var(--border2);
  box-shadow: var(--shadow-lg); overflow: hidden; z-index: 200;
  opacity: 0; transform: translateY(-6px) scale(.97);
  pointer-events: none; transition: opacity .18s ease, transform .18s ease;
}
.post-dropdown-menu.open { opacity: 1; transform: none; pointer-events: auto; }
.post-menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 18px; border: none; background: transparent;
  color: var(--text); font-family: var(--font-body);
  font-size: var(--text-sm); cursor: pointer;
  transition: background .12s; text-align: left;
}
.post-menu-item:hover { background: var(--bg3); }
.post-menu-item + .post-menu-item { border-top: 1px solid var(--border); }
.post-menu-label { font-weight: 700; font-size: var(--text-sm); line-height: 1.2; }
.post-menu-sub   { font-size: var(--text-xs); color: var(--text3); margin-top: 2px; font-weight: 400; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 20px; border: none;
  font-family: var(--font-body); font-size: var(--text-sm);
  font-weight: 500; cursor: pointer; transition: all .15s;
  white-space: nowrap; text-decoration: none;
  letter-spacing: .01em;
}
.btn-primary {
  background: var(--primary); color: #101a17;
  font-weight: 700;
}
.btn-primary:hover { filter: brightness(1.08); }
html.light .btn-primary { color: #fff; }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--border3); }
.btn-sm { padding: 7px 14px; font-size: var(--text-sm); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none !important; filter: none !important; }
.btn-link {
  background: none; border: none; color: var(--primary);
  font-size: var(--text-sm); padding: 2px 0;
  cursor: pointer; font-family: var(--font-body); font-weight: 500;
}
.btn-link:hover { text-decoration: underline; }

/* ── LAYOUT ── */
main { max-width: 1060px; margin: 0 auto; padding: 32px 32px 70px; position: relative; z-index: 1; }

/* ── BREADCRUMB ── */
.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--text-sm); color: var(--text3);
  margin-bottom: 22px; font-weight: 500;
}
.breadcrumb a { color: var(--text2); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

/* ── TOPIC HEADER ── */
.topic-header {
  padding: 22px 0 20px; border-bottom: 1px solid var(--border);
  margin-bottom: 28px; display: flex; align-items: center;
  justify-content: space-between; flex-wrap: wrap; gap: 14px;
}
.topic-left  { display: flex; align-items: center; gap: 16px; }
.topic-glyph { font-size: 2.4rem; line-height: 1; color: var(--blue); }
.topic-name  { font-family: var(--font-disp); font-size: var(--text-3xl); font-weight: 900; letter-spacing: -.01em; }
.topic-sub   { font-size: .62em; font-weight: 700; color: var(--text2); letter-spacing: 0; }
.topic-crumb { display: inline-block; }   /* a name like "2 Variable" wraps as one piece */
.topic-sub-sep { margin: 0 .5em; color: var(--text3); font-weight: 400; }
.topic-desc  { font-size: var(--text-base); color: var(--text2); margin-top: 3px; font-family: var(--font-serif); line-height: 1.5; }

/* ── LAYOUT GRID ── */
.topic-layout { display: grid; grid-template-columns: 195px 1fr; gap: 22px; align-items: start; }

/* ── SIDEBAR ── */
.sidebar {
  padding: 4px 0;
  position: sticky; top: 80px; overflow: hidden;
}
.sidebar-title {
  font-size: var(--text-xs); font-weight: 700;
    color: var(--text3); margin-bottom: 12px;
}
.subtopic-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; text-align: left; padding: 9px 11px;
  border: none; background: transparent;
  color: var(--text2); font-family: var(--font-body);
  font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; transition: all .15s; margin-bottom: 2px;
}
.subtopic-btn:hover { background: var(--bg3); color: var(--text); }
.subtopic-btn.active { background: var(--primary); color: #101a17; font-weight: 700; }
html.light .subtopic-btn.active { color: #fff; }
.subtopic-chevron { transition: transform .2s; opacity: .5; flex-shrink: 0; }
.subtopic-btn.open .subtopic-chevron { transform: rotate(90deg); }
.subtopic-btn.active .subtopic-chevron { opacity: .7; }
.ssc-panel { overflow: hidden; max-height: 0; transition: max-height .28s cubic-bezier(.4,0,.2,1); margin-bottom: 2px; }
.ssc-panel.open { max-height: 600px; }
.ssc-group-label {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 11px 4px;
  font-size: var(--text-xs); font-weight: 700;
    color: var(--text3); margin-top: 4px;
}
.ssc-type-dot { width: 6px; height: 6px; flex-shrink: 0; }
.ssc-type-dot.structure { background: var(--blue); }
.ssc-type-dot.technique { background: var(--gold); }
.ssc-btn {
  display: block; width: 100%; text-align: left;
  padding: 6px 11px 6px 24px; border: none;
  background: transparent; color: var(--text3);
  font-family: var(--font-body); font-size: var(--text-sm);
  cursor: pointer; transition: all .15s; margin-bottom: 1px; line-height: 1.4;
}
.ssc-btn:hover { background: var(--bg3); color: var(--text); }
.ssc-btn.active { background: rgba(143,217,196,.12); color: var(--primary); font-weight: 600; }
html.light .ssc-btn.active { background: rgba(42,122,104,.08); color: var(--primary); }
.ssc-btn.active-technique { background: rgba(217,180,95,.1); color: var(--gold); }
html.light .ssc-btn.active-technique { background: rgba(176,120,32,.08); color: var(--gold); }

/* ── TOOLBAR ── */
.toolbar { display: flex; gap: 11px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }

/* ── SEARCH ── */
.search-wrap { position: relative; flex: 1; min-width: 200px; }
.search-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
.search-input {
  width: 100%; padding: 11px 38px 11px 42px;
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-body); font-size: var(--text-base);
  font-weight: 400; outline: none; transition: all .2s;
  box-shadow: var(--shadow);
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(143,217,196,.1); }
html.light .search-input:focus { box-shadow: 0 0 0 3px rgba(42,122,104,.1); }
.search-input::placeholder { color: var(--text3); }
.search-clear {
  position: absolute; right: 11px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text3);
  cursor: pointer; padding: 3px; display: flex;
}
.search-clear:hover { color: var(--text); }

/* ── SORT TABS ── */
.tabs-list {
  display: flex; gap: 3px; background: var(--bg2);
  border: 1px solid var(--border2);
  padding: 3px; flex-shrink: 0;
}
.tab-btn {
  padding: 7px 16px; border: none;
  font-family: var(--font-body); font-size: var(--text-sm);
  font-weight: 500; cursor: pointer; background: transparent;
  color: var(--text2); transition: all .15s;
}
.tab-btn.active { background: var(--primary); color: #101a17; font-weight: 700; }
html.light .tab-btn.active { color: #fff; }
.tab-btn:not(.active):hover { background: var(--bg3); color: var(--text); }

/* ── RESULTS META ── */
.results-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; flex-wrap: wrap; gap: 8px;
}
.q-count { font-size: var(--text-sm); color: var(--text3); font-family: var(--font-mono); font-weight: 500; }
.active-filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 12px; font-size: var(--text-sm);
  background: rgba(143,217,196,.1); border: 1px solid rgba(143,217,196,.25);
  color: var(--primary); font-weight: 700; cursor: pointer;
}
.active-filter-pill:hover {
  background: rgba(224,122,110,.1); border-color: rgba(224,122,110,.25); color: var(--red);
}
html.light .active-filter-pill { background: rgba(42,122,104,.08); border-color: rgba(42,122,104,.2); }

/* ── QUESTION CARDS ── */
/* Questions sit in one list with dividers, not separate boxes */
#questionsList:has(.question-card) {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.question-card {
  border-radius: 0;
  cursor: pointer; transition: background .15s;
  display: flex; overflow: hidden;
}
.question-card + .question-card { border-top: 1px solid var(--border); }
.question-card:hover { background: var(--card-hover); }
.vote-col {
  display: flex; flex-direction: column; align-items: center;
  gap: 5px; padding: 16px 6px 16px 16px; min-width: 56px;
  flex-shrink: 0;
}
.vote-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); padding: 5px;
  transition: all .15s; display: flex; align-items: center; line-height: 1;
}
.vote-btn:hover { color: var(--primary); background: var(--bg3); }
.vote-btn.voted-up   { color: var(--green); }
.vote-btn.voted-down { color: var(--red); }
.vote-score {
  font-weight: 700; font-size: var(--text-md);
  color: var(--text2); line-height: 1;
  font-family: var(--font-mono);
}
.vote-score.positive { color: var(--green); }
.vote-score.negative { color: var(--red); }
.bulb-count {
  display: flex; align-items: center; gap: 4px;
  font-size: var(--text-xs); color: var(--text3);
  margin-top: 7px; font-family: var(--font-mono); font-weight: 500;
}
.card-content { flex: 1; padding: 16px 20px 16px 10px; min-width: 0; }
.card-title {
  font-family: var(--font-disp); font-size: var(--text-lg);
  font-weight: 700; color: var(--text);
  margin-bottom: 6px; line-height: 1.4;
}
.card-about { font-size: var(--text-about); color: var(--text2); margin-bottom: 10px; font-family: var(--font-body); line-height: 1.6; }
.card-about .lbl {
  font-weight: 700; color: var(--text3);
  font-size: var(--text-about);   font-family: var(--font-body);
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-primary {
  padding: 3px 11px;
  font-size: var(--text-about); font-weight: 700;
  background: rgba(143,217,196,.1); color: var(--green);
  border: 1px solid rgba(143,217,196,.2);
}
html.light .tag-primary { background: rgba(42,122,104,.08); border-color: rgba(42,122,104,.2); }
.tag-secondary {
  padding: 3px 11px;
  font-size: var(--text-about); font-weight: 500;
  background: var(--bg3); color: var(--text3); border: 1px solid var(--border);
}
.card-meta { font-size: var(--text-xs); color: var(--text3); margin-top: 9px; font-family: var(--font-mono); font-weight: 500; }

/* ── SEARCH HIGHLIGHT ── */
.hl { background: rgba(143,217,196,.2); color: var(--primary); padding: 0 2px; }
html.light .hl { background: rgba(42,122,104,.15); }

/* ── STATES ── */
.loading-state {
  text-align: center; padding: 56px 24px; color: var(--text3);
  font-family: var(--font-body); font-style: italic; font-size: var(--text-base);
}
.spinner {
  width: 30px; height: 30px; border: 2px solid var(--border2);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state {
  text-align: center; padding: 56px 24px; color: var(--text3);
  font-size: var(--text-base); font-family: var(--font-body);
}
.err-box {
  background: rgba(224,122,110,.08); border: 1px solid rgba(224,122,110,.25);
  padding: 13px 18px; color: var(--red);
  font-size: var(--text-base); margin-bottom: 14px;
}

/* ── STANDALONE PAGES (profile, reset) ── */
.narrow-page { max-width: 520px; }
.sec-hd { display: flex; align-items: baseline; gap: 14px; margin-bottom: 18px; }
.sec-title { font-family: var(--font-disp); font-size: var(--text-xl); font-weight: 700; white-space: nowrap; }
.sec-line { flex: 1; height: 1px; background: var(--border); }
.activity-list {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.activity-list:has(.empty-state) { background: none; border: none; }
.activity-row { display: flex; gap: 14px; align-items: flex-start; padding: 14px 18px; }
.activity-row + .activity-row { border-top: 1px solid var(--border); }
.activity-score { min-width: 32px; text-align: center; font-weight: 700; color: var(--text2); padding-top: 2px; }
.activity-score.positive { color: var(--green); } .activity-score.negative { color: var(--red); }
.activity-body { flex: 1; min-width: 0; }
.activity-text { color: var(--text); line-height: 1.55; overflow-wrap: anywhere; }
.activity-meta { font-size: var(--text-sm); color: var(--text3); margin-top: 4px; }
.activity-meta a { color: var(--primary); text-decoration: none; }
.activity-meta a:hover { text-decoration: underline; }
.author-link { color: inherit; text-decoration: none; font-weight: 600; }
.author-link:hover { color: var(--primary); text-decoration: underline; }
.btn-delete:hover { color: var(--red); background: rgba(224,122,110,.08); }
@media (max-width: 680px) {
  .activity-row { flex-wrap: wrap; }
  .activity-actions { width: 100%; }
}

/* ── SKELETON (placeholder rows while data loads) ── */
.skel-card { pointer-events: none; }
.skel {
  display: block; background: var(--bg3); border-radius: 3px;
  position: relative; overflow: hidden;
}
.skel::after {
  content: ''; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent);
  animation: skelShimmer 1.4s ease-in-out infinite;
}
html.light .skel::after { background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent); }
@keyframes skelShimmer { to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .skel::after { animation: none; } }
.skel-tags  { display: flex; gap: 6px; }

/* ── DETAIL VIEW ── */
.back-btn {
  display: inline-flex; align-items: center; gap: 7px;
  background: none; border: none; cursor: pointer; color: var(--text2);
  font-size: var(--text-base); font-family: var(--font-body);
  font-weight: 500; padding: 7px 0; transition: color .15s; margin-bottom: 18px;
}
.back-btn:hover { color: var(--text); }
.detail-card {
  background: var(--card-bg); border: 1px solid var(--border);
  margin-bottom: 26px;
  box-shadow: var(--shadow); overflow: hidden;
}
.detail-card-inner { display: flex; }
.detail-content    { flex: 1; padding: 26px 30px; min-width: 0; }
.detail-title {
  font-family: var(--font-disp); font-size: var(--text-2xl);
  font-weight: 700; margin-bottom: 12px; line-height: 1.3;
}
.detail-about { color: var(--text2); margin-bottom: 14px; font-family: var(--font-body); font-size: var(--text-about); line-height: 1.7; }
.detail-meta  { font-size: var(--text-xs); color: var(--text3); margin-top: 12px; font-family: var(--font-mono); font-weight: 500; }

/* ── SORT BAR ── */
.sort-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 11px;
}
.sort-btns { display: flex; gap: 6px; }
.sort-btn {
  padding: 6px 14px;
  border: 1px solid var(--border2); font-size: var(--text-sm);
  font-family: var(--font-body); font-weight: 500;
  cursor: pointer; background: transparent; color: var(--text2); transition: all .15s;
}
.sort-btn.active { background: var(--primary); color: #101a17; border-color: var(--primary); font-weight: 700; }
html.light .sort-btn.active { color: #fff; }
.sort-btn:not(.active):hover { background: var(--bg3); color: var(--text); }

/* ── INTUITION / TAKEAWAY CARDS ── */
.i-card {
  background: var(--card-bg); border: 1px solid var(--border);
  margin-bottom: 12px;
  overflow: hidden;
}
.i-card-inner { display: flex; }
.i-content    { flex: 1; padding: 20px 24px; min-width: 0; }
.i-label {
  font-size: var(--text-xs); font-weight: 700;
    color: var(--text3); margin-bottom: 5px;
}
.i-statement {
  font-family: var(--font-disp); font-size: var(--text-lg);
  font-weight: 700; color: var(--text);
  margin-bottom: 14px; line-height: 1.4;
}
.i-explanation {
  color: var(--text2); font-size: var(--text-base);
  line-height: 1.8; white-space: pre-wrap;
  font-family: var(--font-body); font-weight: 400;
}
.i-example {
  background: var(--bg3); border: 1px solid var(--border);
  padding: 14px; margin-top: 12px;
}
.i-links { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.i-link  { font-size: var(--text-sm); color: var(--primary); text-decoration: none; word-break: break-all; }
.i-link:hover { text-decoration: underline; }
.i-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: var(--text-xs); color: var(--text3); flex-wrap: wrap; gap: 8px;
  font-family: var(--font-mono); font-weight: 500;
}
.comment-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; color: var(--text2);
  font-size: var(--text-sm); font-family: var(--font-body);
  font-weight: 500; padding: 4px 9px; transition: all .15s;
}
.comment-btn:hover { background: var(--bg3); color: var(--text); }

/* ── REPORT BUTTON ── */
.btn-report {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; color: var(--text3);
  font-size: var(--text-xs); font-family: var(--font-body);
  padding: 4px 8px; transition: all .15s;
}
.btn-report:hover { color: var(--red); background: rgba(224,122,110,.08); }

/* ── IMAGE PREVIEW ── */
.img-preview-box { margin-top: 10px; position: relative; display: inline-block; }
.img-preview-box img { max-width: 100%; max-height: 200px; border: 1px solid var(--border2); object-fit: contain; }
.img-preview-remove {
  position: absolute; top: 7px; right: 7px;
  background: rgba(0,0,0,.65); border: none; border-radius: 50%;
  width: 24px; height: 24px; cursor: pointer; color: #fff;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.img-preview-remove:hover { background: var(--red); }

/* ── COMMENTS ── */
.comments-section {
  border-top: 1px solid var(--border); padding: 16px 22px;
  background: var(--bg3); display: none;
}
.comments-section.open { display: block; }
.comment-item {
  background: var(--bg2); border: 1px solid var(--border);
  padding: 12px 14px; margin-bottom: 9px;
}
.comment-text { font-size: var(--text-base); color: var(--text); line-height: 1.6; }
.comment-meta { font-size: var(--text-xs); color: var(--text3); margin-top: 5px; font-family: var(--font-mono); font-weight: 500; }
.comment-form  { display: flex; gap: 9px; margin-top: 12px; align-items: flex-start; }
.comment-input {
  flex: 1; padding: 9px 13px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body); font-size: var(--text-base);
  resize: none; min-height: 62px; outline: none; transition: border-color .15s;
  line-height: 1.6;
}
.comment-input:focus { border-color: var(--primary); }
.comment-input::placeholder { color: var(--text3); }

/* ── TAB CONTENT ── */
.tab-content        { display: none; }
.tab-content.active { display: block; }

/* ── FORM CARD ── */
.form-card {
  background: var(--card-bg); border: 1px solid var(--border);
  padding: 26px 30px;
  box-shadow: var(--shadow); margin-top: 26px;
}
.form-title {
  font-family: var(--font-disp); font-size: var(--text-xl);
  font-weight: 700; margin-bottom: 20px;
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: var(--text-xs);
  font-weight: 700; color: var(--text3);
  margin-bottom: 7px; }
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 14px;
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-body); font-size: var(--text-base);
  font-weight: 400; outline: none; transition: all .15s;
  line-height: 1.6;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary); background: var(--bg2);
  box-shadow: 0 0 0 3px rgba(143,217,196,.08);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text3); }
.form-textarea { resize: vertical; min-height: 96px; }
.form-select   { appearance: none; cursor: pointer; }
.word-count    { font-size: var(--text-xs); color: var(--text3); text-align: right; margin-top: 5px; font-family: var(--font-mono); font-weight: 500; }
.word-count.over { color: var(--red); }
.link-input-row { display: flex; gap: 9px; }
.link-list { display: flex; flex-direction: column; gap: 7px; margin-top: 9px; }
.link-item {
  display: flex; align-items: center; gap: 9px;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 8px 12px; font-size: var(--text-sm);
}
.link-item a { flex: 1; color: var(--primary); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.remove-link-btn { background: none; border: none; cursor: pointer; color: var(--text3); padding: 2px; transition: color .15s; }
.remove-link-btn:hover { color: var(--red); }
.form-divider { border: none; border-top: 1px solid var(--border); margin: 22px 0; }
.login-notice {
  background: rgba(143,217,196,.06); border: 1px solid rgba(143,217,196,.15);
  padding: 13px 18px;
  font-size: var(--text-base); color: var(--text2); margin-bottom: 18px;
}
html.light .login-notice { background: rgba(42,122,104,.05); border-color: rgba(42,122,104,.15); }

/* ── MODAL ── */
.forgot-link { display: inline-block; margin-top: 8px; font-size: var(--text-sm); }
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200; align-items: flex-start; justify-content: center;
  padding: 28px; overflow-y: auto;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg2); border: 1px solid var(--border2);
  padding: 30px; max-width: 600px; width: 100%;
  margin: auto; box-shadow: var(--shadow-lg);
  animation: modalIn .22s cubic-bezier(.22,1,.36,1);
}
@keyframes modalIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:none; } }
.modal-title {
  font-family: var(--font-disp); font-size: var(--text-xl);
  font-weight: 700; margin-bottom: 5px;
}
.modal-sub { font-size: var(--text-base); color: var(--text2); margin-bottom: 22px; font-family: var(--font-body); line-height: 1.6; }
.modal-footer { display: flex; justify-content: flex-end; gap: 11px; margin-top: 24px; }

/* ── SUBTOPIC MODAL ── */
.sub-preview { background: var(--bg3); border: 1px solid var(--border); padding: 13px 16px; margin-top: 13px; display: none; }
.sub-preview.show { display: block; }
.sub-preview-label {
  font-size: var(--text-xs); font-weight: 700;
    color: var(--text3); margin-bottom: 9px;
}
.sub-preview-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.sub-preview-tag  { padding: 3px 10px; font-size: var(--text-xs); font-weight: 700; }
.sub-preview-tag.structure { background: rgba(143,179,224,.12); color: var(--blue); border: 1px solid rgba(143,179,224,.25); }
.sub-preview-tag.technique { background: rgba(217,180,95,.1);   color: var(--gold); border: 1px solid rgba(217,180,95,.25); }

/* ── TOPIC PICKER ── */
.topic-picker-grid  { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.topic-pill-option  {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; font-size: var(--text-sm);
  font-weight: 600; cursor: pointer; border: 1px solid var(--border2);
  background: var(--bg3); color: var(--text2);
  transition: all .15s; user-select: none;
}
.topic-pill-option:hover { border-color: rgba(108,192,192,.4); color: var(--teal); background: rgba(108,192,192,.06); }
.topic-pill-option.selected { background: rgba(108,192,192,.12); border-color: rgba(108,192,192,.4); color: var(--teal); }
.topic-pill-option .check-icon    { opacity: 0; transition: opacity .1s; color: var(--teal); }
.topic-pill-option.selected .check-icon { opacity: 1; }
.topic-pill-option .topic-count   { font-size: var(--text-xs); font-weight: 400; opacity: .6; margin-left: 2px; }

/* ── SSC ACCORDION ── */
.ssc-accordion        { display: flex; flex-direction: column; gap: 9px; margin-top: 9px; }
.ssc-accordion-item   { background: var(--bg3); border: 1px solid var(--border); overflow: hidden; }
.ssc-accordion-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 14px; font-size: var(--text-sm); font-weight: 700;
  color: var(--teal); background: rgba(108,192,192,.06);
}
.ssc-accordion-body   { padding: 11px 14px; }

/* ── QUESTION PICKER IN MODAL ── */
.q-search-wrap { position: relative; margin-bottom: 9px; }
.q-search-wrap .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text3); pointer-events: none; }
.q-search-input {
  width: 100%; padding: 10px 13px 10px 38px;
  background: var(--bg3); border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-body); font-size: var(--text-base);
  font-weight: 400; outline: none; transition: all .15s;
}
.q-search-input:focus { border-color: var(--primary); background: var(--bg2); box-shadow: 0 0 0 3px rgba(143,217,196,.08); }
.q-search-input::placeholder { color: var(--text3); }
.q-picker-list {
  max-height: 230px; overflow-y: auto; border: 1px solid var(--border2);
  background: var(--bg3); box-shadow: var(--shadow-lg);
}
.q-picker-list:empty::after {
  content: 'No questions found'; display: block; padding: 15px 18px;
  font-size: var(--text-base); color: var(--text3); font-style: italic;
}
.q-picker-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 15px;
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background .1s; user-select: none;
}
.q-picker-item:last-child { border-bottom: none; }
.q-picker-item:hover { background: var(--bg4); }
.q-picker-text  { flex: 1; min-width: 0; }
.q-picker-title { font-size: var(--text-base); font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-disp); }
.q-picker-sub   { font-size: var(--text-xs); color: var(--text3); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.q-selected-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; min-height: 0; }
.q-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; background: rgba(143,217,196,.1);
  border: 1px solid rgba(143,217,196,.25);
  font-size: var(--text-sm); color: var(--green); font-weight: 700;
}
.q-chip-remove {
  background: none; border: none; cursor: pointer; color: var(--green);
  opacity: .7; padding: 0; display: flex; align-items: center;
  transition: opacity .1s; margin-left: 2px;
}
.q-chip-remove:hover { opacity: 1; }

/* ── AUTH MODAL ── */
.auth-tabs {
  display: flex; gap: 3px; background: var(--bg3);
  padding: 3px; margin-bottom: 20px;
}
.auth-tab {
  flex: 1; padding: 8px; border: none;
  font-family: var(--font-body); font-size: var(--text-base);
  font-weight: 500; cursor: pointer; background: transparent;
  color: var(--text2); transition: all .15s;
}
.auth-tab.active { background: var(--bg2); color: var(--text); box-shadow: var(--shadow); font-weight: 700; }
.btn-google-modal {
  background: var(--bg3); color: var(--text); border: 1px solid var(--border2);
  width: 100%; justify-content: center; padding: 12px 18px;
  font-size: var(--text-base); margin-bottom: 5px;
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  transition: all .15s; font-family: var(--font-body); font-weight: 500;
}
.btn-google-modal:hover { border-color: var(--primary); background: var(--bg4); }
.divider {
  display: flex; align-items: center; gap: 11px;
  color: var(--text3); font-size: var(--text-sm); margin: 16px 0;
}
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-msg { padding: 10px 14px; font-size: var(--text-base); margin-bottom: 16px; display: none; }
.auth-msg.err { background: rgba(224,122,110,.08); border: 1px solid rgba(224,122,110,.3); color: var(--red); }
.auth-msg.ok  { background: rgba(143,217,196,.08); border: 1px solid rgba(143,217,196,.3); color: var(--green); }

/* ── PREVIEW PANEL ── */
.preview-toggle {
  display: flex; gap: 3px; background: var(--bg3);
  border: 1px solid var(--border2);
  padding: 3px; margin-bottom: 9px;
}
.preview-tab {
  flex: 1; padding: 6px 11px; border: none;
  font-family: var(--font-body); font-size: var(--text-sm);
  font-weight: 500; cursor: pointer; background: transparent;
  color: var(--text3); transition: all .15s; text-align: center;
}
.preview-tab.active { background: var(--bg2); color: var(--text); box-shadow: var(--shadow); font-weight: 700; }
.preview-pane          { display: none; }
.preview-pane.active   { display: block; }
.preview-rendered {
  background: var(--bg3); border: 1px solid var(--border2);
  padding: 13px 16px; min-height: 84px;
  font-family: var(--font-body); font-size: var(--text-base);
  color: var(--text2); line-height: 1.8; white-space: pre-wrap;
}

/* ── EDIT MODE ── */
.edit-section       { border-top: 1px solid var(--border); padding: 16px 22px; background: var(--bg3); display: none; }
.edit-section.open  { display: block; }
.edit-actions       { display: flex; gap: 9px; margin-top: 13px; justify-content: flex-end; }
.edit-word-count    { font-size: var(--text-xs); color: var(--text3); font-family: var(--font-mono); text-align: right; margin-top: 5px; font-weight: 500; }
.edit-word-count.over { color: var(--red); }
.btn-edit {
  display: inline-flex; align-items: center; gap: 5px;
  background: none; border: none; cursor: pointer; color: var(--text3);
  font-size: var(--text-xs); font-family: var(--font-body);
  padding: 4px 8px; transition: all .15s;
}
.btn-edit:hover { color: var(--text); background: var(--bg4); }

/* ── SPOILER (Discord-style: each ||block|| hides on its own) ── */
.spoiler {
  display: inline; cursor: pointer; padding: 1px 3px;
  background: var(--border2); color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;   /* each wrapped line gets its own block */
  transition: background .15s, color .15s; user-select: none;
}
.spoiler:hover { background: var(--border3); }
.spoiler:not(.revealed) * { color: transparent !important; visibility: hidden; }   /* hides math and links inside too */
.spoiler.revealed { background: rgba(127,137,156,.16); color: inherit; cursor: auto; user-select: text; }

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 26px; right: 26px; z-index: 999;
  background: var(--bg2); border: 1px solid var(--border2);
  padding: 13px 20px;
  font-size: var(--text-base); font-weight: 500;
  box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 11px;
  animation: toastIn .25s ease; max-width: 340px;
}
.toast.success { border-color: var(--green); color: var(--green); }
.toast.error   { border-color: var(--red);   color: var(--red); }
@keyframes toastIn { from { opacity:0; transform:translateY(10px); } to { opacity:1; transform:none; } }

/* ── FOOTER ── */
footer {
  text-align: center; padding: 22px 32px; border-top: 1px solid var(--border);
  position: relative; z-index: 1;
}
footer p  { font-family: var(--font-body); font-size: var(--text-sm); color: var(--text3); }
footer a  { color: var(--primary); text-decoration: none; font-weight: 700; }

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
  /* Narrow phones: keep the header inside the screen */
  .header-inner { padding: 0 12px; gap: 8px; }
  .header-right { gap: 6px; }
  .logo { gap: 8px; }
  .logo-mark-svg { width: 32px; height: 32px; }
  .user-pill { display: none !important; }
  .btn-post-main { padding: 8px 10px; }
  .btn-post-chevron { display: none; }
  .btn-sm { padding: 7px 10px; }
}
@media (max-width: 680px) {
  .header-inner { padding: 0 20px; }
  main { padding: 22px 20px 52px; }
  .logo-tagline { display: none; }
  .topic-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  :root {
    --text-base: 15px;
    --text-md: 16px;
    --text-lg: 18px;
  }
}