/* Copyright (c) 2026 Tomasetti Tech LLC. All rights reserved. */
/* TALK Shop — the forum's one stylesheet.
   Extracted from base.html's inline <style> (2026-09-12 architecture pass)
   so the presentation layer has one home. Served from /static/forum.css;
   in production NGINX aliases /static/ to /opt/repair-backend/forum/static/,
   so this file ships via deploy-talk.ps1 (same lane as preview.js).
   Palette: lifted from repair-design.css (Tj-approved light theme).
   2026-09-28: wired to the house kit (docs/UI-KIT.md) — the bridge below maps
   the kit's --t-* tokens onto the forum palette in BOTH themes; the kit's own
   controls (ttk-jelly nav, ttk-badge, ttk-field, ttk-tabs, ttk-drawer,
   ttk-modal, ttk-toast) read them from there. */

/* ================================================================
   TALK Shop — Tomasetti Audio Labs Knowledge
   Palette: lifted from repair-design.css (Tj-approved light theme)
   ================================================================ */

/* ---------- Light theme (default) ---------- */
:root {
  --display: 'Outfit', sans-serif;
  --sans: 'Outfit', sans-serif;
  --mono: 'Share Tech Mono', monospace;

  --canvas: #f3f1f7;
  --canvas-deep: #ece9f3;
  --surface: #ffffff;
  --surface-hover: #f0edf6;

  --ink: #20172c;
  --ink-soft: #44365a;
  --muted: #6f637c;
  --faint: #8b7f9c;

  --line: rgba(63, 45, 88, 0.14);
  --line-strong: rgba(63, 45, 88, 0.26);

  --purple: #6036b8;
  --purple-dark: #4d2a99;
  --purple-mid: #7a5cc7;
  --purple-soft: rgba(96, 54, 184, 0.08);
  --purple-softer: rgba(96, 54, 184, 0.05);

  --green: #18845d;
  --blue: #277d91;
  --red: #dc2626;
  --amber: #d97706;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;

  --card-bg: var(--surface);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lift: 0 10px 30px rgba(63, 45, 88, 0.1);

  /* Backward-compat aliases for child templates */
  --accent: var(--purple);
  --accent-hover: var(--purple-dark);
  --accent-light: var(--purple-soft);
  --accent-text: #ffffff;
  --text: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: var(--muted);
  --text-mid: var(--muted);
  --border: var(--line);
  --border-hover: var(--line-strong);
  --bg: var(--canvas);
  --tag-bg: var(--purple-soft);
  --tag-text: var(--purple);
  --upvote: var(--purple);

  /* ── THE KIT BRIDGE (light) ── every --t-* the kit reads, mapped onto the
     forum palette. Without this the kit's dark-portal fallbacks paint dark
     controls on this light-first surface. --ttk-on-accent is NOT a --t- var:
     the kit hardcodes it, so it is overridden directly. #6036b8 carries white;
     the dark theme's lighter purple carries dark ink. */
  --t-bg: var(--canvas);
  --t-surface: var(--surface);
  --t-card-bg: var(--surface);
  --t-panel: var(--canvas-deep);
  --t-ink: var(--ink);
  --t-ink-mute: var(--muted);
  --t-accent: var(--purple);
  --t-green: var(--green);
  --t-amber: var(--amber);
  --t-red: var(--red);
  --t-line: var(--line);
  --t-radius: var(--radius-sm);
  --t-font-ui: var(--sans);
  --t-font-mono: var(--mono);
  --ttk-on-accent: #ffffff;
  --ttk-shadow: var(--shadow-md);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --canvas: #140d20;
  --canvas-deep: #0f0a1a;
  --surface: #211632;
  --surface-hover: #2a1d3d;

  --ink: #f1ecf7;
  --ink-soft: #ddd2ea;
  --muted: #aa9bb8;
  --faint: #8f819d;

  --line: rgba(205, 183, 232, 0.16);
  --line-strong: rgba(205, 183, 232, 0.3);

  --purple: #9b7be8;
  --purple-dark: #7655c9;
  --purple-mid: #b49bf2;
  --purple-soft: rgba(155, 123, 232, 0.14);
  --purple-softer: rgba(155, 123, 232, 0.08);

  --green: #3ecf8e;
  --blue: #7cc7f7;
  --red: #f87171;
  --amber: #fbbf24;

  --card-bg: var(--surface);
  --shadow-sm: 0 2px 6px rgba(0,0,0,0.3);
  --shadow: 0 4px 12px rgba(0,0,0,0.35);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lift: 0 12px 34px rgba(0, 0, 0, 0.4);

  /* Backward-compat aliases for child templates */
  --accent: var(--purple);
  --accent-hover: var(--purple-dark);
  --accent-light: var(--purple-soft);
  --accent-text: #ffffff;
  --text: var(--ink);
  --text-secondary: var(--ink-soft);
  --text-muted: var(--muted);
  --text-mid: var(--muted);
  --border: var(--line);
  --border-hover: var(--line-strong);
  --bg: var(--canvas);
  --tag-bg: var(--purple-soft);
  --tag-text: var(--purple);
  --upvote: var(--purple);

  /* ── THE KIT BRIDGE (dark) — --t-* re-resolve through the flipped palette
     automatically; only on-accent needs its own dark value. ── */
  --ttk-on-accent: #14121a;
}

/* ---------- Base reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  margin: 0;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-dark); }
p { margin: 0; }
img { max-width: 100%; }

/* ---------- Skip link (keyboard accessible) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  background: var(--purple);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 var(--radius-sm) 0;
  font-weight: 700;
  font-size: 0.9rem;
  transition: left 0.15s;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Focus ring (keyboard accessible) ---------- */
:focus-visible {
  outline: 3px solid var(--purple);
  outline-offset: 3px;
}

/* ---------- Pride bar ---------- */
.t-pride {
  width: 100%;
  height: 5px;
  flex-shrink: 0;
  background: linear-gradient(
    90deg,
    #e40303 0%, #ff8c00 14%, #ffed00 28%,
    #008026 42%, #004dff 57%, #750787 72%,
    #d896ff 86%, #ff69b4 100%
  );
}

/* ---------- Header ---------- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 1.5rem;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 1.5rem; }
.logo {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--purple);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--display);
  letter-spacing: -0.01em;
}
.logo svg { width: 26px; height: 26px; flex-shrink: 0; }
.logo .logo-sub {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  margin-left: 0.15rem;
}
/* The jelly nav (kit 01) owns the link look; the host contributes only the
   layout. No-JS fallback: html:not(.ttk-js) paints the current link itself,
   and stands down the moment the kit loads (its blob takes over). */
.header-nav { display: flex; gap: 0.25rem; align-items: center; }
html:not(.ttk-js) .header-nav .ttk-jelly-item.on {
  background: var(--purple-soft);
  color: var(--purple);
  border-radius: 999px;
}
.header-right { display: flex; align-items: center; gap: 0.5rem; }
/* Header-sized magnetic buttons: the kit's .ttk-mag is a big pill; the chrome
   needs the btn-sm footprint. */
.header-right .ttk-mag {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--radius-xs);
  min-height: 36px;
}

/* ---------- Mobile burger + drawer nav ---------- */
.nav-burger {
  display: none;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--purple);
  border-radius: var(--radius-xs);
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}
.nav-burger svg { width: 20px; height: 20px; }
.nav-burger:hover { background: var(--purple-softer); border-color: var(--purple); }
.drawer-nav { display: flex; flex-direction: column; margin: 0.5rem 0 1rem; }
.drawer-nav a {
  padding: 0.7rem 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  min-height: 44px;
  display: flex;
  align-items: center;
}
.drawer-nav a:hover { color: var(--purple); }
.drawer-auth { display: flex; flex-direction: column; gap: 0.6rem; }
.drawer-auth a {
  padding: 0.55rem 0.5rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.drawer-auth .ttk-btn { justify-content: center; }
.drawer-help {
  margin-top: 0.75rem;
  padding-top: 0.75rem !important;
  border-top: 1px solid var(--line);
  color: var(--purple) !important;
  font-weight: 700;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: transparent;
  cursor: pointer;
  color: var(--purple);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.15s, border-color 0.15s;
  min-height: 44px;
}
.theme-toggle:hover { background: var(--purple-softer); border-color: var(--purple); }
.theme-toggle .tt-moon, .theme-toggle .tt-sun { width: 15px; height: 15px; display: block; }
.theme-toggle svg[hidden] { display: none !important; }
.theme-toggle .tt-label { text-transform: uppercase; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
  line-height: 1;
  font-family: var(--sans);
  min-height: 44px;
}
.btn-primary { background: var(--purple); color: #fff; }
.btn-primary:hover { background: var(--purple-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--purple); border: 1px solid var(--line-strong); }
.btn-outline:hover { border-color: var(--purple); background: var(--purple-soft); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; min-height: 36px; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--purple-softer); color: var(--ink); }
/* kit 29 danger variant (report / remove-content buttons) */
.ttk-btn.danger { background: var(--red); color: #fff; }
.ttk-btn.danger:hover { background: color-mix(in srgb, var(--red) 85%, black); }
.btn-sm-danger { padding: 0.35rem 0.75rem; font-size: 0.8rem; min-height: 36px; }

/* ---------- Notification dot on the bell ---------- */
.notif-btn { position: relative; }
.notif-dot {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 99px;
}

/* ---------- Layout ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 1.25rem; display: flex; gap: 1.5rem; width: 100%; flex: 1; }
.main-col { flex: 1; min-width: 0; }
.side-col { width: 310px; flex-shrink: 0; }
.narrow-col { max-width: 720px; }

/* ---------- Shared text styles (moved out of inline templates) ---------- */
.page-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; }
.sect-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 0.5rem; }
.card-pad { padding: 1.25rem 1.5rem; margin-bottom: 1rem; }
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.label-opt { font-weight: 400; text-transform: none; letter-spacing: 0; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: -0.5rem; margin-bottom: 1rem; }
.btn-row { display: flex; gap: 0.5rem; }
.minirow { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.minirow:last-child { border-bottom: none; }
.minirow-link { font-weight: 700; display: inline-block; }
.minirow-meta { font-size: 0.78rem; color: var(--text-muted); margin: 0.15rem 0; }
.minirow-body { font-size: 0.85rem; color: var(--text-secondary); }

/* ---------- Hero (home) ---------- */
.hero-card {
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--surface), var(--accent-light));
}
.hero-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.hero-title { font-size: 1.6rem; line-height: 1.2; margin-bottom: 0.45rem; }
.hero-sub { color: var(--text-secondary); max-width: 44rem; margin-bottom: 0.8rem; }
.hero-cta { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.hero-cta .ttk-mag { padding: 0.6rem 1.3rem; font-size: 0.875rem; }

/* ---------- Group tabs + sort bar (kit 01 jelly) ----------
   Specificity (0,2,0) on the layout rules: the kit's .ttk-jelly sets
   display/flex-wrap at (0,1,0) and ttk.css loads last, so equal-specificity
   host rules lose the tie and the bars cannot wrap on a 390px phone. */
nav.grouptabs { display: flex; align-items: center; gap: 0.25rem; margin-bottom: 1rem; flex-wrap: wrap; }
nav.sortbar {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 1rem;
  padding: 0.35rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.sortbar .ttk-jelly-item { font-size: 0.8rem; padding: 0.45rem 0.85rem; min-height: 40px; }
.sortbar-sep { width: 1px; height: 1rem; background: var(--border); margin: 0 0.35rem; flex-shrink: 0; }

/* ---------- Category cards (home) ---------- */
.catgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.catgrid-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; gap: 0.5rem; }
.catgrid-title { font-size: 1rem; font-weight: 700; color: var(--text); margin: 0; }
.catgrid-count { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.catgrid-blurb { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.catgrid-cats { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.75rem; }
.cat-chip {
  font-size: 0.75rem;
  padding: 0.15rem 0.45rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
}
.cat-chip:hover { color: var(--accent-hover); }
.catgrid-latest { display: block; font-size: 0.8rem; color: var(--text-secondary); text-decoration: none; margin-bottom: 0.75rem; }
.catgrid-latest span { color: var(--text-muted); }
.catgrid-latest:hover { color: var(--purple); }

/* ---------- Forced-group header ---------- */
.forced-head { margin-bottom: 1rem; }
.forced-head h2 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.forced-head p { font-size: 0.85rem; color: var(--text-muted); margin: 0.25rem 0 0; }

/* ---------- Solved proof line ---------- */
.solved-note { font-size: 0.85rem; font-weight: 600; color: var(--green); margin: 0 0 1rem; }
.solved-note a { font-weight: 600; color: var(--accent); }

/* ---------- Category page header ---------- */
.cat-head { margin-bottom: 1rem; }
.cat-head-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.cat-head-title { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 0.15rem; }
.cat-head-desc { font-size: 0.85rem; color: var(--text-muted); }

/* ---------- Cards + thread list ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.15s;
  margin-bottom: 1rem;
}
.card:hover { border-color: var(--line-strong); }
.card-body { padding: 1rem; }
.thread-item {
  display: flex;
  gap: 0;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  transition: all 0.15s;
  cursor: pointer;
}
.thread-item:hover { border-color: var(--line-strong); background: var(--surface-hover); }
.notif-item { cursor: default; }
.notif-unread { background: var(--accent-light); border-color: var(--purple-mid); }
.notif-line { font-size: 0.85rem; color: var(--text); }
.notif-user { font-weight: 600; }
.notif-when { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* Vote column */
.vote-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 36px;
  padding-right: 0.75rem;
}
.vote-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--faint);
  font-size: 1rem;
  line-height: 1;
  padding: 2px;
  border-radius: 3px;
  transition: all 0.15s;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vote-btn:hover { color: var(--purple); background: var(--purple-softer); }
.vote-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--ink);
  min-width: 20px;
  text-align: center;
}

/* Content column */
.thread-content { flex: 1; min-width: 0; }
.thread-meta-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  flex-wrap: wrap;
}
.thread-meta-top .cat-link { color: var(--purple); font-weight: 600; }
.thread-meta-top .cat-link:hover { text-decoration: underline; }
.thread-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 0.3rem;
}
.thread-title a { color: inherit; overflow-wrap: break-word; }
.thread-title a:hover { color: var(--purple); }
.thread-excerpt {
  font-size: 0.85rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.thread-meta-bottom {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  row-gap: 0.3rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.thread-meta-bottom .action {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 44px;
}
.thread-meta-bottom .action:hover { background: var(--purple-softer); color: var(--ink); }
.thread-meta-bottom svg { width: 14px; height: 14px; }

/* ---------- Thread page ---------- */
.thread-tags { display: flex; gap: 0.35rem; margin-bottom: 0.5rem; flex-wrap: wrap; }
.thread-h1 { font-size: 1.35rem; font-weight: 700; color: var(--text); line-height: 1.35; margin-bottom: 0.5rem; overflow-wrap: break-word; }
.thread-byline { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.thread-byline-user { font-weight: 500; }
.thread-symptoms { color: var(--accent); }
.thread-solved-note { margin: 0 0 1rem; }
.solved-by { color: var(--text-muted); }
.thread-actions { display: flex; gap: 0.5rem; margin-top: 1rem; padding-top: 0.75rem; border-top: 1px solid var(--border); flex-wrap: wrap; align-items: flex-start; }
.inspect-details { position: relative; }
.inspect-details summary { list-style: none; }
.inspect-details summary::-webkit-details-marker { display: none; }
.inspect-body {
  margin-top: 0.6rem;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-secondary);
  max-width: 34rem;
}
.inspect-body p { margin-bottom: 0.5rem; }
.inspect-body .ttk-cb { margin-bottom: 0.6rem; }

/* ---------- Posts ---------- */
.post-card { margin-bottom: 0.5rem; }
.post-is-ai { border-left: 3px solid var(--accent); }
.post-is-solution { border: 1px solid var(--green); }
.post-row { display: flex; gap: 0.75rem; }
.post-main { flex: 1; min-width: 0; }
.post-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.post-meta-user { font-weight: 600; color: var(--text); }
.post-edited { font-style: italic; }
.post-actions { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.5rem; flex-wrap: wrap; }
.post-action {
  background: none;
  border: none;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-family: inherit;
  min-height: 44px;
  text-decoration: none;
}
.post-action:hover { color: var(--ink); }
.post-action:disabled { cursor: not-allowed; opacity: 0.5; }
.post-action:disabled:hover { color: var(--muted); }
.helpful-btn.active, .post-action.active { color: var(--green); font-weight: 600; }
.post-action.active:hover { color: var(--green); }
.post-delete { color: var(--red); }
.post-delete:hover { color: var(--red); }
.share-wrap { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); font-size: 0.75rem; }
/* the report popover (kit 34) needs room for its form */
.report-pop { min-width: 280px; }
.report-pop-title { font-size: 0.75rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.report-select { font-size: 0.8rem; margin-bottom: 0.4rem; min-height: auto; padding: 0.4rem 0.5rem; }
.report-details { font-size: 0.8rem; margin-bottom: 0.5rem; min-height: auto; padding: 0.4rem 0.5rem; }

/* ---------- Post body (markdown) ---------- */
.post-body h1, .post-body h2, .post-body h3 { margin: 1rem 0 0.5rem; color: var(--ink); }
.post-body p { margin-bottom: 0.75rem; color: var(--ink); overflow-wrap: break-word; }
.post-body code { background: var(--canvas-deep); padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85em; font-family: 'SF Mono', 'Fira Code', monospace; }
.post-body pre { background: var(--canvas-deep); color: var(--ink); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin-bottom: 1rem; max-width: 100%; }
.post-body pre code { background: none; padding: 0; }
.post-body blockquote { border-left: 3px solid var(--purple); padding-left: 1rem; color: var(--muted); margin-bottom: 0.75rem; }
.post-body ul, .post-body ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.post-body img { max-width: 100%; border-radius: var(--radius-sm); margin: 0.5rem 0; }

/* ---------- Search results ---------- */
.searchbar { display: flex; gap: 0.5rem; align-items: flex-end; margin-bottom: 0.75rem; }
.searchbar-field { flex: 1; }
.result-count { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 1rem; }
.result-sub { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.search-snippet mark, .searchbar mark {
  background: color-mix(in srgb, var(--amber) 30%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ---------- Flash messages (the kit 12b fallback: these styles ARE the
     no-JS alert; with JS the kit lifts the div into a toast and hides it) ---- */
.flash, .ttk-flash {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.875rem;
  font-weight: 500;
}
.flash-success { background: rgba(24, 132, 93, 0.1); color: var(--green); border: 1px solid rgba(24, 132, 93, 0.2); }
.flash-error { background: rgba(220, 38, 38, 0.08); color: var(--red); border: 1px solid rgba(220, 38, 38, 0.15); }
.flash-info { background: rgba(39, 125, 145, 0.1); color: var(--blue); border: 1px solid rgba(39, 125, 145, 0.15); }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 1rem; }
.form-input {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--surface);
  font-family: var(--sans);
  transition: border-color 0.15s;
}
.form-input:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
/* kit 20 fields need the same height the old .form-input had */
.ttk-field input, .ttk-field textarea {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
}
.ttk-field textarea { min-height: 88px; resize: vertical; }
.auth-cta, .intake-bench-cta { width: 100%; justify-content: center; margin-top: 0.25rem; }
.settings-sect { margin-bottom: 1.5rem; }
.settings-sect .sect-title { margin-bottom: 0.75rem; }
.settings-sect .ttk-cb { font-size: 0.875rem; }

/* ---------- Auth pages ---------- */
.auth-wrap { max-width: 400px; margin: 2rem auto; }
.auth-wrap.auth-wide { max-width: 440px; }
.auth-title { font-size: 1.1rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; text-align: center; }
.auth-sub { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-bottom: 1.25rem; }
.auth-alt { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-alt + .auth-alt { margin-top: 0.5rem; }

/* ---------- Sidebar ---------- */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}
.sidebar-widget-header {
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--canvas-deep);
}
.sidebar-widget-body { padding: 0.75rem 1rem; }
.sidebar-link {
  display: block;
  padding: 0.4rem 0;
  font-size: 0.85rem;
  color: var(--ink);
}
.sidebar-link:hover { color: var(--purple); }
.sidebar-about { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.75rem; }
.sidebar-stat { display: flex; gap: 0.4rem; margin-bottom: 0.4rem; font-size: 0.8rem; }
.sidebar-stat strong { color: var(--text); }
.sidebar-stat span { color: var(--text-muted); }
.sidebar-partof { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.sidebar-cta { width: 100%; justify-content: center; }
.sidebar-cats { padding: 0.5rem 1rem; }
.sidebar-section {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0.6rem 0 0.3rem;
}
.sidebar-section-gap { margin-top: 0.9rem; }
.sidebar-rules { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.6; }
.sidebar-rules p { margin-bottom: 0.2rem; }

/* ---------- Replies + related ---------- */
.reply-card { margin-top: 1rem; }
.reply-as { font-size: 0.9rem; font-weight: 600; color: var(--text); margin-bottom: 0.75rem; }
.reply-submit { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.related-card { margin-top: 1.5rem; }
.empty-btn-row { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Composer (kit 10 tabs + host skin) ---------- */
.composer-wrap { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; transition: border-color 0.15s; }
.composer-wrap:focus-within { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.composer-ttk { display: flex; flex-direction: column; align-items: stretch; }
.composer-ttk .ttk-tab-row {
  border-bottom: 1px solid var(--line);
  background: var(--canvas-deep);
  position: relative;
  display: flex;
}
.composer-ttk .ttk-tab {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  min-height: 44px;
  color: var(--ttk-muted);
}
.composer-textarea {
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--surface);
  color: var(--ink);
  min-height: 160px;
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85rem;
  resize: vertical;
  width: 100%;
  padding: 0.75rem;
}
.composer-preview {
  overflow-y: auto;
  max-height: 400px;
  background: var(--surface);
  padding: 0.75rem;
  min-height: 120px;
}
.composer-preview:empty::before {
  content: 'Nothing to preview yet — start typing...';
  color: var(--muted); font-style: italic; font-size: 0.85rem;
}
.composer-preview pre { background: var(--canvas-deep); color: var(--ink); padding: 0.75rem; border-radius: 6px; overflow-x: auto; margin: 0.5rem 0; font-size: 0.85rem; }
.composer-preview code { background: var(--canvas-deep); padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.85em; font-family: 'SF Mono', 'Fira Code', monospace; }
.composer-preview pre code { background: none; padding: 0; }
.composer-preview blockquote { border-left: 3px solid var(--purple); padding-left: 0.75rem; color: var(--muted); margin: 0.5rem 0; }
.composer-preview img { max-width: 100%; border-radius: var(--radius-sm); }

/* ---------- Intake (the front door) ---------- */
.intake-hero { margin-bottom: 1rem; }
.intake-title { font-size: 1.5rem; line-height: 1.25; margin-bottom: 0.4rem; }
.intake-sub { color: var(--text-secondary); max-width: 46rem; }
.intake-done { border: 1px solid var(--green); }
.intake-done-p { margin-bottom: 0.5rem; }
.intake-done-p:last-child { margin-bottom: 0; }
.symptom-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.5rem 1rem;
  margin-top: 0.35rem;
}
.intake-cta-zone { margin-top: 0.5rem; }
.intake-alt { margin: 0.75rem 0 0; }

/* ---------- About page ---------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
  text-align: center;
}
.stat-tile { padding: 0.5rem 0.25rem; }
.stat-num { font-size: 1.45rem; font-weight: 800; color: var(--text); }
.stat-solved { color: var(--green); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.about-cta-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.about-cta-line { color: var(--text-secondary); font-size: 0.9rem; }

/* ---------- Profile ---------- */
.profile-name { font-size: 1.25rem; font-weight: 700; color: var(--text); margin-bottom: 0.15rem; }
.profile-joined { font-size: 0.8rem; color: var(--text-muted); }
.profile-stats { display: flex; gap: 1.25rem; margin-top: 0.4rem; font-size: 0.8rem; }
.profile-stats strong { color: var(--text); }
.profile-stats span span { color: var(--text-muted); }
.profile-helpful { color: var(--green); }
.profile-rep-note { font-size: 0.7rem; color: var(--text-muted); margin-top: 0.35rem; }

/* ---------- Last-activity cue in listing rows ---------- */
.last-activity { color: var(--text-muted); }
.last-activity a { color: var(--text-secondary); font-weight: 600; }

/* ---------- Suggested topics at the end of a thread ---------- */
.suggested-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.suggested-item {
  display: block;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.suggested-item:hover { border-color: var(--accent); text-decoration: none; }
.suggested-meta { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.3rem; font-size: 0.72rem; color: var(--text-muted); flex-wrap: wrap; }
.suggested-title { font-size: 0.85rem; font-weight: 600; color: var(--text); line-height: 1.35; }
.suggested-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.2rem; }

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: auto;
  border-top: 1px solid var(--line);
}
.footer a { color: var(--ink-soft); font-weight: 500; }
.footer a:hover { color: var(--purple); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .side-col { display: none; }
  .page { padding: 1rem; }
}
@media (max-width: 640px) {
  /* The nav links live in the drawer (burger) below this width; auth links
     move there too. Get help + theme + burger stay in the chrome — every
     control here is at least 44px tall. Specificity: the kit's
     .ttk-jelly:not(.ttk-jelly-bare){display:inline-flex} is (0,2,0) and
     ttk.css loads last, so the hide rule needs (0,3,0) to beat it. */
  .header { height: auto; min-height: 54px; flex-wrap: wrap; padding: 0 1rem; }
  .header .header-left .header-nav { display: none; }
  .header .header-right .auth-link { display: none; }
  .header-right .ttk-mag { display: none; }
  .nav-burger { display: inline-flex; }
  .header-right { gap: 0.35rem; flex-wrap: wrap; }
  .header .header-right .btn { white-space: nowrap; padding-left: 0.6rem; padding-right: 0.6rem; }
  .theme-toggle .tt-label { display: none; }
  .logo { font-size: 1rem; }
  .logo-sub { display: none; }
  .thread-item { padding: 0.6rem 0.75rem; }
  .vote-col { min-width: 28px; padding-right: 0.5rem; }
  .catgrid { grid-template-columns: 1fr; }
  .field-grid { grid-template-columns: 1fr; }
  .hero-cta .ttk-mag { width: 100%; justify-content: center; }
  .about-cta-row { flex-direction: column; align-items: stretch; }
  .about-cta-row .ttk-btn { justify-content: center; }
  /* sort bar stays reachable: full width, wrapped rows, 44px targets */
  nav.sortbar { width: 100%; }
  .sortbar .ttk-jelly-item { flex: 1 1 auto; justify-content: center; min-height: 44px; }
  .suggested-grid { grid-template-columns: 1fr; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  :root { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Print ---------- */
@media print {
  .t-pride, .theme-toggle, .header, .nav-burger, .ttk-drawer { display: none !important; }
  body { background: #fff; color: #000; }
}

/* ---------- Avatars: deterministic initial chips (crm.forum.present.avatar).
   Palette keyed by username hash; pastels with dark text read in both
   themes. No images, no JS — CSP is satisfied by construction. ---------- */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  user-select: none;
}
.avatar.lg { width: 32px; height: 32px; font-size: 0.9rem; }
.avatar.xl { width: 64px; height: 64px; font-size: 1.5rem; }
.thread-avatar-link { display: inline-flex; vertical-align: -6px; }
.thread-avatar-link:hover { text-decoration: none; }

.avatar.av-0 { background: #e7dff7; color: #4d2a99; }
.avatar.av-1 { background: #d7ecdd; color: #1f6b3f; }
.avatar.av-2 { background: #fde3d1; color: #a34a12; }
.avatar.av-3 { background: #d8e6f5; color: #1f4f7d; }
.avatar.av-4 { background: #f9dfe9; color: #9c2f5e; }
.avatar.av-5 { background: #efe6cf; color: #7a5d10; }
.avatar.av-6 { background: #dceeee; color: #16605f; }
.avatar.av-7 { background: #e4e4ef; color: #3f3f74; }

/* ---------- Draft-restored hint (preview.js autosave) ---------- */
.draft-restored {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0.3rem 0;
}
