/* =============================================================================
   KilusNa — COMPONENTS
   buttons · chips/tabs · side nav · CTA cards · panel headers · hero ·
   report/discussion/petition/video cards · right-rail cards · search dropdown ·
   modals + forms · feedback states · toast
   Everything consumes tokens.css; no hardcoded hex anywhere in this file.
   ============================================================================= */

/* `hidden` must always win (author styles otherwise beat the UA rule) */
[hidden] { display: none !important; }

/* ===== Buttons ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 9px 20px;
  border: 1px solid transparent;
  border-radius: var(--r-btn);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.btn-outline {
  background: var(--card);
  border-color: var(--border);
  color: var(--body);
}

.btn-outline:hover {
  background: var(--hover);
  border-color: var(--border-strong);
  color: var(--text);
}

/* Primary (filled accent). A bare --accent edge is only 1.55:1 on --card, so
   the button carries a 1px --accent-text border as its defining edge in light
   (5.93:1 vs --card and --bg; 8.25:1 against its own hover fill). .btn already
   declares a 1px transparent border in a border-box box, so swapping the
   colour costs no layout shift. In dark the ring is the same gold as the fill
   — invisible by design, because a gold fill already reads 12.06:1 on --card. */
.btn-primary {
  background: var(--accent);
  border-color: var(--accent-text);
  color: var(--on-accent);
}

.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-text); }

.btn-block { width: 100%; }

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
}

/* Square icon button (theme toggle, modal close, drawer close, …) */
.icon-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}

.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }

.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ===== Generic card ====================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

/* ===== Filter chips (rectangular, reference button geometry) =============
   Shared by Reports / Pending Review / KilusNaTV / Discussions filters. */
.pub-filter-btn,
.reports-cat-btn,
.filter-btn,
.sort-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 7px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  font-size: var(--fs-desc);
  font-weight: 600;
  color: var(--body);
  text-align: center;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.pub-filter-btn:hover,
.reports-cat-btn:hover,
.filter-btn:hover,
.sort-btn:hover {
  /* the border follows the label colour so the hover state keeps a ≥3:1 edge
     on a light page (--accent would be 1.55:1) */
  border-color: var(--accent-text);
  color: var(--accent-text);
}

.pub-filter-btn.active,
.reports-cat-btn.active,
.filter-btn.active,
.sort-btn.active,
.pub-filter-btn[aria-pressed="true"],
.reports-cat-btn[aria-pressed="true"],
.filter-btn[aria-pressed="true"],
.sort-btn[aria-pressed="true"] {
  background: var(--accent);
  /* filled chips are their own affordance: the 1px --accent-text ring keeps
     the gold plate's edge at 5.93:1 on --card (bare --accent is 1.55:1) */
  border-color: var(--accent-text);
  color: var(--on-accent);
}

.pub-filters,
.reports-category-filter,
.kilosph-tv-filters,
.freedom-wall-sort {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

/* ===== Feed tabs (reference sort-tab pill pattern) ======================= */
.feed-tabs {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.feed-tabs::-webkit-scrollbar { display: none; }

.feed-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 44px;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.feed-tab svg { width: 14px; height: 14px; }
.feed-tab:hover { border-color: var(--border); }

.feed-tab.active,
.feed-tab[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-text);
  color: var(--accent-text);
}

/* ===== Side navigation (left rail + mobile drawer) ======================= */
.sidebar-nav-heading {
  display: block;
  padding: var(--s3) var(--s3) var(--s2);
  font-size: var(--fs-tiny);
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--faint);
}

.sidebar-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 var(--s2) var(--s2);
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--r-btn);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--body);
  transition: background .15s ease, color .15s ease;
}

.sidebar-nav-link svg { width: 18px; height: 18px; color: var(--accent-text); }

.sidebar-nav-link:hover { background: var(--accent-soft); color: var(--accent-text); }

.sidebar-nav-link.active,
.sidebar-nav-link[aria-current="page"] {
  background: var(--accent);
  /* the active row's edge IS its affordance on a white rail: inset ring, so
     the 5.93:1 --accent-text outline costs no layout change (dark: same gold
     as the fill, invisible — the fill already reads 12.06:1 there) */
  box-shadow: inset 0 0 0 1px var(--accent-text);
  color: var(--on-accent);
}

.sidebar-nav-link.active svg,
.sidebar-nav-link[aria-current="page"] svg { color: var(--on-accent); }

.sidebar-divider {
  margin: var(--s2) var(--s3);
}

/* ===== Left-rail cards =================================================== */
.side-nav { padding-bottom: var(--s2); }

/* Vertical rhythm between left-rail cards (Browse Topics → Be a Verified
   Member → Report Responsibly): same 16px gap the right rail's .sidebar-card
   uses; the final card zeroes its own margin via .sidebar-card:last-child. */
.sidebar-left .card { margin-bottom: var(--s4); }

/* Reference `.report` CTA card, restyled for "Be a Verified Member" */
.verified-cta {
  padding: 22px 18px;
  text-align: center;
}

.cta-icon {
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 50%;
}

.cta-icon svg { width: 22px; height: 22px; }

.cta-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.cta-text {
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: var(--s4);
}

/* ===== Panel headers ===================================================== */
.panel-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-header h1 {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--text);
}

.panel-header p {
  font-size: var(--fs-desc);
  color: var(--muted);
}

.panel-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s2);
}

.tv-logo-img {
  height: 44px;
  width: auto;
  border-radius: 6px;
}

/* ===== Topic filter banner =============================================== */
.topic-filter-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--s3);
  padding: 10px var(--s4);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-btn);
  font-size: var(--fs-sm);
  color: var(--body);
}

.topic-filter-bar.is-open { display: flex; }
.topic-filter-bar strong { color: var(--text); }

.btn-clear-filter {
  min-height: 34px;
  padding: 4px 10px;
  background: var(--card);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-btn);
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-text);
}

.btn-clear-filter:hover { background: var(--hover); }

/* ===== Hero (extrapolated — the reference has no hero) =================== */
.hero {
  position: relative;
  overflow: hidden;
  padding: var(--s7) var(--s6);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-card);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-glow);
  pointer-events: none;
}

.hero-content { position: relative; max-width: 640px; }

/* On the pale --accent-soft plate only --accent-text clears 4.5:1 as text
   (5.38:1 light / 9.14:1 dark); --accent-dark would sit at 1.95:1 in light. */
.hero-eyebrow {
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.hero-title {
  margin-top: var(--s3);
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.hero-title span { color: var(--accent-text); }

.hero-description {
  margin-top: var(--s3);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--body);
}

.hero-features {
  display: flex;
  flex-wrap: wrap;
  gap: 10px var(--s4);
  margin-top: var(--s4);
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--body);
}

.hero-feature-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  background: var(--accent);
  border-radius: 50%;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s5);
}

/* ===== Report / post card (reference `.post` adapted) ==================== */
.report-card {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-areas: "vote body";
  gap: 14px;
  padding: var(--s5);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.report-card > .vote { grid-area: vote; }
.report-card > .report-body { grid-area: body; min-width: 0; }
.report-card > .report-thumb { grid-area: thumb; }

/* Mobile-first thumb layout (≥641 switches to the 3-col desktop grid) */
.report-card.has-thumb {
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-areas:
    "vote thumb"
    "vote body";
}

/* Cards without a vote rail (discussions, petitions) reclaim the column */
.discussion-card,
.petition-card {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "body";
}

/* --- display-only vote rail (logged-out state on the live site) --------- */
.vote {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding-top: 2px;
}

.vote-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  color: var(--faint);
  transition: color .12s ease;
}

.vote-icon svg { width: 16px; height: 16px; }
.vote-up:hover { color: var(--accent-text); }
.vote-down:hover { color: var(--red); }

.vote-num {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--body);
}

/* --- meta row ---------------------------------------------------------- */
.report-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px var(--s2);
  margin-bottom: 6px;
  font-size: var(--fs-meta);
  line-height: 1.4;
  color: var(--faint);
}

.report-category {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--fs-meta);
  font-weight: 600;
  border-radius: var(--r-pill);
}

/* Semantic pill: soft bg + DARK text (the reference's coloured badge text is
   4.2–4.4:1 at 9–10px, so the tone moves to the dot + border instead). */
.verdict-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  font-size: var(--fs-badge);
  font-weight: 700;
  letter-spacing: .5px;
  line-height: 1.5;
  text-transform: uppercase;
  color: var(--text);
}

.verdict-badge::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--tone, var(--muted));
  border-radius: 50%;
}

.tone-verified { background: var(--green-soft); border-color: var(--green); --tone: var(--green); }
.tone-victory { background: var(--green-soft); border-color: var(--green); --tone: var(--green); }
.tone-review { background: var(--amber-soft); border-color: var(--amber); --tone: var(--amber); }
.tone-disputed { background: var(--red-soft); border-color: var(--red); --tone: var(--red); }
.tone-open { background: var(--accent-soft); border-color: var(--accent); --tone: var(--accent); }


.report-time { color: var(--faint); }

.report-location {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--faint);
}

.report-location svg { width: 12px; height: 12px; }

/* --- title / summary --------------------------------------------------- */
.report-title {
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 6px;
}

.report-title a { color: inherit; }

.report-summary {
  font-size: var(--fs-desc);
  line-height: 1.55;
  color: var(--body);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* --- relationship pills ------------------------------------------------ */
.pub-rel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.pub-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--hover);
  color: var(--body);
  font-size: var(--fs-meta);
  border-radius: var(--r-pill);
}

.pub-pill small { font-size: var(--fs-tiny); color: var(--muted); }

.pub-pill-topic {
  background: var(--accent-soft);
  color: var(--accent-text);
  font-weight: 600;
}

/* --- footer / actions -------------------------------------------------- */
.report-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  margin-top: var(--s3);
  font-size: var(--fs-xs);
}

.report-author { color: var(--faint); }

.report-author a {
  color: var(--body);
  transition: color .15s ease;
}

.report-author a:hover { color: var(--accent-text); text-decoration: underline; }

.report-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.react-count,
.react-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 6px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--muted);
  border-radius: var(--r-btn);
  transition: background .15s ease, color .15s ease;
}

.react-count svg,
.react-btn svg { width: 15px; height: 15px; }

.react-btn:hover { background: var(--hover); color: var(--accent-text); }
/* the saved state colours the icon in the text-accent: solid --accent is only
   1.55:1 on --card, --accent-text is 5.93:1 */
.react-btn.bookmark:hover { color: var(--accent-text); }

/* --- thumbnail --------------------------------------------------------- */
.report-thumb {
  position: relative;
  width: 100%;
  height: 150px;
  overflow: hidden;
  background-color: var(--border);
  background-size: cover;
  background-position: center;
  border-radius: var(--r-btn);
}

.report-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.thumb-t1 { background-image: var(--grad-t1); }
.thumb-t2 { background-image: var(--grad-t2); }

/* reference's light streak across the gradient placeholders */
.thumb-t1::after,
.thumb-t2::after {
  content: "";
  position: absolute;
  top: 0;
  height: 100%;
  background: var(--thumb-streak);
  opacity: var(--thumb-streak-opacity);
  pointer-events: none;
}

.thumb-t1::after { left: 40%; width: 22%; }
.thumb-t2::after { left: 42%; width: 18%; background: var(--thumb-streak-2); }

.thumb-count {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  background: var(--img-chip);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 600;
  border-radius: var(--r-pill);
}

.thumb-count svg { width: 12px; height: 12px; }

/* ===== Petition card ===================================================== */
.petition-meta-text {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  font-size: var(--fs-desc);
  color: var(--body);
  margin-bottom: var(--s3);
}

.petition-meta-text a { color: var(--body); }
.petition-meta-text a:hover { color: var(--accent-text); text-decoration: underline; }
.petition-meta-text .target { color: var(--muted); }

.progress {
  height: 8px;
  overflow: hidden;
  background: var(--accent-soft);
  border-radius: var(--r-pill);
}

.progress-fill {
  display: block;
  height: 100%;
  width: var(--pct, 0%);
  background: var(--accent);
  /* the bar's edge is how the value is read, and a gold fill on a pale track
     (or on --card) is only ~1.5:1: the same inset --accent-text outline the
     filled buttons use keeps it at 5.93:1 without touching the 8px geometry */
  box-shadow: inset 0 0 0 1px var(--accent-text);
  border-radius: var(--r-pill);
}

/* ===== Video card (extrapolated) ======================================== */
.video-card {
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
}

.video-thumb {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
}

.video-v1 { background-image: var(--grad-v1); }
.video-v2 { background-image: var(--grad-v2); }
.video-v3 { background-image: var(--grad-v3); }

.video-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--play-bg);
  color: var(--white);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-pop);
  transition: background .15s ease;
}

/* hover swaps the glyph to --on-accent as well: a white play icon on the gold
   fill is only 1.44:1, black-on-gold is 11.42:1 */
.video-play:hover { background: var(--accent); color: var(--on-accent); }
.video-play svg { width: 26px; height: 26px; }

/* The player that replaces a thumbnail when a catalogue video is played. The
   thumb already carries the 16:9 frame, so the embed only has to fill it. */
.video-embed {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--s4);
}

.video-category {
  align-self: flex-start;
  padding: 3px 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font-size: var(--fs-meta);
  font-weight: 600;
  border-radius: var(--r-pill);
}

.video-title { font-size: var(--fs-title); font-weight: 700; line-height: 1.4; }

.video-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  font-size: var(--fs-meta);
  color: var(--faint);
}

/* ===== Section header (Recent Reports) ================================== */
.pub-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  flex-wrap: wrap;
}

.pub-preview-title {
  font-size: var(--fs-modal);
  font-weight: 700;
  color: var(--text);
}

.pub-preview-viewall {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 4px;
  background: none;
  border: none;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--accent-text);
}

.pub-preview-viewall:hover { text-decoration: underline; }

.pub-preview-feed,
.reports-feed,
.pub-feed,
.freedom-wall-posts,
.kilosph-tv-videos {
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

/* ===== Feedback states =================================================== */
.loading-state,
.empty-state,
.error-state {
  padding: var(--s7);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.error-state { color: var(--red); }

.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: var(--s4);
}

/* ===== Right-rail cards ================================================== */
.sidebar-card {
  padding: var(--s4);
  margin-bottom: var(--s4);
}

.sidebar-card:last-child { margin-bottom: 0; }

/* When the rail's cards are relocated under main content (<1280), the
   wrapper's gap replaces their own bottom margins */
.rail-below .sidebar-card { margin-bottom: 0; }

.sidebar-card-title {
  font-size: var(--fs-h4);
  font-weight: 700;
  color: var(--text);
}

.impact-list {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
  margin-top: var(--s3);
}

.impact-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

.impact-item svg { width: 18px; height: 18px; color: var(--accent-text); }

.impact-value {
  font-size: var(--fs-title);
  font-weight: 700;
  color: var(--text);
  min-width: 3ch;
}

.impact-label {
  font-size: var(--fs-label);
  color: var(--muted);
}

.trending-list {
  display: flex;
  flex-direction: column;
  margin-top: var(--s2);
}

.trending-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  min-height: 44px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--r-btn);
  transition: background .15s ease;
}

.trending-list .trending-item:last-child { border-bottom: none; }
.trending-item:hover { background: var(--accent-soft); }
/* the count still lifts one step on hover so it stays distinct on the
   --accent-soft plate (muted 5.64:1; faint is 4.82:1 there) */
.trending-item:hover .trending-count { color: var(--muted); }

.trending-tag {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.trending-tag .hash { color: var(--accent-text); }

.trending-count {
  font-size: var(--fs-tiny);
  color: var(--faint);
  white-space: nowrap;
}

.responsible-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.responsible-icon {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent-text);
  border-radius: 50%;
}

.responsible-icon svg { width: 18px; height: 18px; }

.responsible-quote {
  margin-top: var(--s3);
  font-size: var(--fs-xs);
  font-style: italic;
  color: var(--body);
}

.responsible-list {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin-top: var(--s3);
}

.responsible-item {
  display: flex;
  align-items: flex-start;
  gap: var(--s2);
  font-size: var(--fs-xs);
  color: var(--body);
}

.responsible-check {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--accent-text);
}

/* ===== Search dropdown =================================================== */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 60;
  display: none;
  max-height: min(60vh, 420px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
}

.search-results.is-open { display: block; }

.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.search-result:hover { background: var(--accent-soft); }

.search-result-type {
  font-size: var(--fs-meta);
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--accent-text);
}

.search-result-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}

.search-result-subtitle {
  font-size: var(--fs-xs);
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  line-clamp: 1;
  overflow: hidden;
}

.search-empty {
  padding: 14px;
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.search-deep-link {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 12px 14px;
  background: var(--hover);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--accent-text);
  text-align: left;
}

.search-deep-link:hover { background: var(--accent-soft); }

/* ===== Modals ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--s5) var(--s4);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--scrim);
}

.modal-overlay.open { display: flex; }

/* `margin:auto` keeps tall sheets scrollable without clipping when centred */
.modal {
  width: 100%;
  max-width: 640px;
  margin: auto;
  padding: var(--s6) 28px;
  background: var(--card);
  color: var(--text);
  border-radius: var(--r-modal);
  box-shadow: var(--shadow-modal);
}

.modal-sm { max-width: 480px; }
.modal-large { max-width: 760px; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.modal-head h2 {
  font-size: var(--fs-modal);
  font-weight: 700;
}

.modal-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin: -10px -12px 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-pill);
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}

.modal-close:hover { background: var(--hover); color: var(--text); }
.modal-close svg { width: 16px; height: 16px; }

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  margin-top: var(--s5);
}

/* --- forms ------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--s4);
}

.form-group label {
  font-size: var(--fs-meta);
  font-weight: 500;
  color: var(--muted);
}

.form-control {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  background: var(--card);
  border: 1px solid var(--input-border);
  border-radius: var(--r-input);
  font-size: var(--fs-desc);
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: var(--ring);
}

textarea.form-control {
  min-height: 0;
  resize: vertical;
  line-height: 1.55;
}

.deep-search-form {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--s3);
}

.form-row .form-group { margin-bottom: 0; }

/* anonymous toggle (hidden until the account supports it) */
.toggle-label {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  font-size: var(--fs-sm);
  color: var(--body);
  cursor: pointer;
}

.toggle-label input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.anonymous-alias {
  display: block;
  margin-top: var(--s1);
  font-size: var(--fs-xs);
  color: var(--muted);
}

.deep-search-results {
  display: flex;
  flex-direction: column;
  gap: var(--s3);
}

.results-count {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--muted);
}

.deep-result-card {
  display: block;
  padding: var(--s3) var(--s4);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-btn);
  transition: border-color .15s ease, background .15s ease;
}

.deep-result-card:hover { border-color: var(--accent-text); background: var(--accent-soft); }
/* hover swaps the card plate to --accent-soft: --faint is 4.26:1 there in dark
   (4.82:1 light), so both small lines lift one step, as the feed's trending
   count already does */
.deep-result-card:hover .deep-result-meta,
.deep-result-card:hover .deep-result-date { color: var(--muted); }

.deep-result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
  font-size: var(--fs-meta);
}

.deep-result-type {
  font-weight: 700;
  letter-spacing: .4px;
  text-transform: uppercase;
  color: var(--accent-text);
}

.deep-result-date { color: var(--faint); }

.deep-result-title {
  margin-top: 4px;
  font-size: var(--fs-title);
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.deep-result-excerpt {
  margin-top: 4px;
  font-size: var(--fs-desc);
  color: var(--body);
}

.deep-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
  margin-top: var(--s2);
  font-size: var(--fs-meta);
  color: var(--faint);
}

/* ===== Toast ============================================================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: var(--s6);
  z-index: 200;
  max-width: min(90vw, 420px);
  padding: 12px 18px;
  background: var(--toast-bg);
  color: var(--toast-text);
  font-size: var(--fs-sm);
  font-weight: 500;
  border-radius: var(--r-card);
  box-shadow: var(--shadow-pop);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s ease;
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%);
}
