/* ============================================================================
   mews — cyber-intel portal mockup styles
   Design brief: dark, cyber, professional, clean. One teal-cyan accent.
   Themes: dark (default), light — toggled via [data-theme] on <html>.
   ============================================================================ */

/* ---- Tokens: dark (default) --------------------------------------------- */
:root {
  --bg-0:   #070a0f;
  --bg-1:   #0b1016;
  --bg-2:   #11171f;
  --bg-3:   #161d27;
  --line:   #1a2230;
  --line-2: #243042;

  --text:      #f1f5fa;   /* primary — close to white, easy to read */
  --text-mute: #b4c2d6;   /* body / summary text — was too dim before */
  --text-dim:  #6e7c92;   /* timestamps, captions — still subdued, but readable */

  --accent:      #3ddbd9;
  --accent-2:    #5eead4;
  --accent-dim:  rgba(61, 219, 217, 0.10);
  --accent-line: rgba(61, 219, 217, 0.35);

  --purple:      #a78bfa;
  --purple-soft: rgba(167, 139, 250, 0.14);
  --purple-line: rgba(167, 139, 250, 0.32);

  --danger: #ff3d57;
  --warn:   #ff9040;
  --ok:     #51cf66;
  --gold:   #fbbf24;

  --radius:    4px;
  --radius-lg: 6px;

  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --grid-opacity: 0.35;
  --shadow-soft: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-pop:  0 8px 32px rgba(0,0,0,0.55), 0 0 0 1px var(--line-2);
}

/* ---- Tokens: light ------------------------------------------------------- */
[data-theme="light"] {
  --bg-0:   #f4f6fa;
  --bg-1:   #ffffff;
  --bg-2:   #eef2f7;
  --bg-3:   #e4eaf2;
  --line:   #dfe5ee;
  --line-2: #c3ccd9;

  --text:      #0b1016;
  --text-mute: #4a5566;
  --text-dim:  #7a8699;

  --accent:      #0f9d97;
  --accent-2:    #0b857e;
  --accent-dim:  rgba(15, 157, 151, 0.09);
  --accent-line: rgba(15, 157, 151, 0.38);

  --purple:      #7c3aed;
  --purple-soft: rgba(124, 58, 237, 0.08);
  --purple-line: rgba(124, 58, 237, 0.30);

  --danger: #dc2626;
  --warn:   #ea580c;
  --ok:     #16a34a;
  --gold:   #ca8a04;

  --grid-opacity: 0.55;
  --shadow-soft: 0 4px 18px rgba(15, 23, 42, 0.08);
  --shadow-pop:  0 12px 40px rgba(15, 23, 42, 0.14), 0 0 0 1px var(--line);
}

/* ---- Scrollbar -----------------------------------------------------------
   Low-contrast, theme-aware. Default Windows/Firefox scrollbars render as
   bright-white in dark mode, which yells louder than any content. */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar       { width: 10px; height: 10px; background: transparent; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-line); background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* ---- Reset --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 180ms ease, color 180ms ease;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-2); }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
.mono { font-family: var(--mono); font-feature-settings: "ss01","cv02","cv11"; }

/* Global UI scale — reverted to 1.0 (native) on 2026-04-25 per Viktor.
   (The 1.25 bump was added earlier; kept as a reference comment for the
   `getBoundingClientRect / zoom` coordination code that lived in app.js
   tooltip positioning — still correct-by-accident at zoom=1.) */
/* body { zoom: 1.25; } */

/* subtle grid background */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  background-position: -1px -1px;
  opacity: var(--grid-opacity);
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 75%);
}

/* ---- Top bar ------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 260px 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 0 24px;
  height: 56px;
  background: color-mix(in srgb, var(--bg-0) 82%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 15px; letter-spacing: 0.12em;
  font-weight: 600; color: var(--text);
  text-transform: uppercase;
}
.logo a { color: inherit; display: flex; align-items: center; gap: 10px; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  color: var(--text);         /* shield outline inherits; accent is inside */
  position: relative;
}
.logo-mark svg { display: block; }
/* Blink the terminal underscore on ~1.5s cycle. Using CSS keyframes rather
   than SMIL because they're better supported and honor prefers-reduced-motion. */
@keyframes logo-cursor-blink {
  0%, 45%   { opacity: 1; }
  50%, 95%  { opacity: 0; }
  100%      { opacity: 1; }
}
.logo-mark .logo-cursor { animation: logo-cursor-blink 1.4s infinite steps(1, end); }
@media (prefers-reduced-motion: reduce) {
  .logo-mark .logo-cursor { animation: none; }
}
.logo-sub {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; margin-left: 2px;
}
.pulse-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  position: relative;
  animation: pulse 2.2s ease-out infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(61,219,217,0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(61,219,217,0); }
  100% { box-shadow: 0 0 0 0 rgba(61,219,217,0); }
}

.search {
  position: relative;
  max-width: 520px;
  width: 100%;
  justify-self: start;
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 44px 0 36px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-family: var(--sans);
  transition: border-color 120ms, background 120ms;
}
.search input::placeholder { color: var(--text-dim); }
.search input:focus {
  outline: none;
  border-color: var(--accent-line);
  background: var(--bg-2);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim); pointer-events: none;
}
.search-kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-0);
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.btn {
  height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  transition: border-color 120ms, background 120ms, color 120ms;
  white-space: nowrap;
}
.btn:hover { border-color: var(--line-2); background: var(--bg-2); }
.btn.accent {
  border-color: var(--accent-line);
  color: var(--accent);
  background: var(--accent-dim);
}
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn .mono { font-size: 11px; letter-spacing: 0.08em; }

/* theme toggle — cycles sun/moon/monitor */
.btn.theme-toggle { position: relative; }
.btn.theme-toggle svg { width: 15px; height: 15px; stroke-width: 1.8; }

/* sign-in / user chip */
.user-chip {
  height: 32px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 0 10px 0 3px;
  border-radius: 20px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12.5px;
  transition: border-color 120ms, background 120ms;
}
.user-chip:hover { border-color: var(--accent-line); background: var(--bg-2); }
.user-chip .avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  color: #081016;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0;
}

/* ---- Layout -------------------------------------------------------------- */
.layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 56px);
  position: relative;
  z-index: 1;
}

/* ---- Sidebar (filters) --------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 56px;
  align-self: start;
  height: calc(100vh - 56px);
  overflow-y: auto;
  padding: 18px 16px 24px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, var(--bg-0) 0%, color-mix(in srgb, var(--bg-0) 85%, transparent) 100%);
}
/* sidebar quick-nav (signed-in shortcuts: My likes, etc.) */
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 2px 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.sidebar-navlink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 4px;
  color: var(--text-mute);
  text-decoration: none;
  font-size: 13px;
  transition: all 120ms;
}
.sidebar-navlink:hover {
  color: var(--text);
  background: var(--bg-2);
}
.sidebar-navlink.active {
  color: var(--accent);
  background: var(--accent-dim);
}
.sidebar-navlink svg { width: 14px; height: 14px; flex-shrink: 0; }
.sidebar-navlink.active svg { fill: var(--accent); stroke: var(--accent); }
.sidebar-navlink .n {
  margin-left: auto;
  font-size: 10.5px;
  color: var(--text-dim);
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 0 6px;
  border-radius: 3px;
  line-height: 16px;
}
.sidebar-navlink.active .n {
  color: var(--accent);
  border-color: var(--accent-line);
  background: transparent;
}

.sidebar-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  padding: 0 4px 8px;
}
.sidebar-heading .reset {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  transition: color 120ms;
}
.sidebar-heading .reset:hover { color: var(--accent); }

.filter-group {
  border-top: 1px solid var(--line);
  padding: 12px 4px 10px;
}
.filter-group:first-of-type { border-top: 0; padding-top: 4px; }
/* filter-group-title is now a <button> so it's keyboard-accessible and the
   caret can animate. The visual layout stays identical to the <div> era. */
button.filter-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: transparent;
  border: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.15em;
  color: var(--text-mute);
  text-transform: uppercase;
  padding: 4px 0 8px;
  user-select: none;
  cursor: pointer;
  text-align: left;
}
button.filter-group-title:hover { color: var(--text); }
button.filter-group-title .caret {
  flex-shrink: 0;
  transition: transform 120ms ease-out;
  color: var(--text-dim);
}
.filter-group.collapsed button.filter-group-title .caret {
  transform: rotate(-90deg);
}
button.filter-group-title > span:nth-child(2) { flex: 1; }
.filter-group.collapsed .filter-chips { display: none; }

.filter-group-title .count {
  color: var(--text-dim);
  font-size: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
  line-height: 16px;
  height: 16px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  margin: 2px 3px 2px 0;
  color: var(--text-mute);
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
  user-select: none;
  white-space: nowrap;
}
.filter-chip:hover { color: var(--text); border-color: var(--line-2); background: var(--bg-2); }
.filter-chip .n { color: var(--text-dim); font-size: 10px; }
.filter-chip.active {
  color: var(--bg-0);
  background: var(--accent);
  border-color: var(--accent);
}
.filter-chip.active .n { color: rgba(7,10,15,0.55); }

.filter-chips { display: flex; flex-wrap: wrap; margin: 0 -3px; }

/* sidebar digest widget */
.sidebar-cta {
  margin-top: 20px;
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--bg-1), var(--bg-2));
  position: relative;
  overflow: hidden;
}
.sidebar-cta::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--purple));
}
.sidebar-cta h4 {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.sidebar-cta p {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.5;
}
.sidebar-cta .btn { width: 100%; justify-content: center; height: 30px; font-size: 12px; }

/* ---- Main column --------------------------------------------------------- */
/* The feed column stretches to a generous max-width so list rows use the
   full available width on wide displays. The sponsor banner is constrained
   separately (.sponsor-card max-width below) and centered, so it doesn't
   stretch awkwardly when the rest of the column does. */
.main {
  padding: 22px 32px 64px;
  min-width: 0;
  max-width: 1600px;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  /* Pin to the top of the viewport when scrolling — keeps the sort +
     unread-toggle + "N results" counter visible as the feed scrolls past.
     top:55px overlaps the 56px topbar by 1px on purpose: avoids the
     sub-pixel hairline gap that some browsers render when sticky elements
     are exactly butted, which Viktor reported as "moves slightly". */
  position: sticky;
  top: 55px;
  z-index: 5;
  background: var(--bg-0);
  /* Force a compositor layer so the sticky position is recomputed on the
     GPU rather than blended with parent transforms — eliminates the
     1-2px scroll jitter that earlier showed up when scrolling fast. */
  will-change: transform;
}
/* Sponsor card at the top of the feed also pins so the "supporter" banner
   stays in view while the reader scrolls. Constrained to 980px and
   centered so the banner stays a readable, focused-width box even when
   the surrounding feed column stretches wider. */
.feed > .sponsor-card:first-child {
  position: sticky;
  /* Stack: topbar (56) + page-header (~50) + type-bar (~38) ≈ 144 */
  top: 144px;
  z-index: 3;
  background: var(--bg-0);
  max-width: 980px;
  align-self: center;
  width: 100%;
}
.page-title {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}
.page-title .mono-accent {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  margin-left: 10px;
  letter-spacing: 0.12em;
  font-weight: 500;
}
.page-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
}
.page-sub .sep { margin: 0 8px; color: var(--line-2); }

.active-filters {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  min-height: 28px; margin-bottom: 12px;
}
.active-filters:empty { display: none; }
.active-filters .af-label {
  font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.18em;
  color: var(--text-dim); text-transform: uppercase;
  margin-right: 4px;
}
.active-filter {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 11px;
  padding: 3px 4px 3px 8px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 3px;
}
.active-filter .x {
  color: var(--text-dim); padding: 0 4px; line-height: 1;
  cursor: pointer; font-size: 13px;
}
.active-filter .x:hover { color: var(--accent); }

/* ---- Feed ---------------------------------------------------------------- */
.feed { display: flex; flex-direction: column; }

.feed-row {
  display: grid;
  grid-template-columns: 78px 1fr 64px;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  transition: background 120ms;
  position: relative;
}
/* overlay anchor — fills the row behind content so right-click / middle-
   click / ctrl-click all work on "the row", while interactive children
   (tags, like, share, CVE chips) sit on top and stay clickable. */
.feed-row .row-cover {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  text-indent: -99999px;
  white-space: nowrap;
  cursor: pointer;
}
.feed-row > .feed-meta,
.feed-row > .feed-body,
.feed-row > .feed-score {
  position: relative;
  z-index: 2;
  pointer-events: none;
}
/* but re-enable clicks on the explicitly-interactive descendants */
.feed-row .tag,
.feed-row .like-btn,
.feed-row .share-btn-mini,
.feed-row .paywall-stub,
.feed-row .feed-actions a,
.feed-row .feed-actions button,
.feed-row a.cve,
.feed-row .itw,
.feed-row .feed-source a {
  pointer-events: auto;
  position: relative;
  z-index: 3;
}
.feed-row:first-child { border-top: 0; }
.feed-row:hover { background: linear-gradient(90deg, var(--accent-dim), transparent 60%); }
.feed-row:hover .feed-title { color: var(--accent-2); }

.feed-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.4;
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.feed-meta .ago { color: var(--text-mute); }
.feed-meta .abs { color: var(--text-dim); font-size: 10px; }

.severity {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em;
  padding: 1px 0;
  margin-top: 4px;
}
.severity::before {
  content: "";
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--sev-color);
  box-shadow: 0 0 6px var(--sev-glow);
}

.feed-body { min-width: 0; }
.feed-title {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  color: var(--text);
  margin: 0 0 6px;
  letter-spacing: -0.005em;
  transition: color 120ms;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.feed-source {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  margin-bottom: 8px;
  display: flex; gap: 6px;
  align-items: center; flex-wrap: wrap;
}
.feed-source .src-name { color: var(--text); }
.feed-source .cve {
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 10px;
}
.feed-source .itw {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
  border-radius: 3px;
  padding: 0 5px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
}
.feed-source .itw::before {
  content: "";
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--warn);
  animation: pulse-warn 1.6s ease-out infinite;
}
@keyframes pulse-warn {
  0%   { box-shadow: 0 0 0 0 rgba(255,144,64,0.5); }
  70%  { box-shadow: 0 0 0 6px rgba(255,144,64,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,144,64,0); }
}

.feed-summary {
  font-size: 13.5px;
  color: var(--text-mute);
  line-height: 1.55;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.feed-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 2px;
}

.feed-score {
  font-family: var(--mono);
  text-align: right;
  padding-top: 2px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}
/* CVSS v3.1 block — sits ABOVE the editorial score when the article has
   a CVE. Colour-coded severity band so critical/high jump out at a glance. */
.feed-cvss {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.feed-cvss-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
}
.feed-cvss-label {
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 3px;
}
.feed-cvss-critical .feed-cvss-val { color: var(--danger); }
.feed-cvss-high     .feed-cvss-val { color: var(--warn); }
.feed-cvss-medium   .feed-cvss-val { color: var(--gold); }
.feed-cvss-low      .feed-cvss-val { color: var(--ok); }

/* Editorial-score block — smaller, at the bottom of the score column. */
.feed-edit-score {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.feed-score-val {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  line-height: 1;
}
.feed-score-label {
  font-size: 9px; letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 2px;
}
.feed-score-bar {
  height: 2px; width: 54px;
  background: var(--bg-2);
  border-radius: 1px; overflow: hidden;
}
.feed-score-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 45%, transparent);
}

/* like button: small footprint, big feeling */
.like-btn {
  margin-top: 8px;
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  padding: 3px 7px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg-1);
  transition: color 120ms, border-color 120ms, background 120ms, transform 100ms;
}
.like-btn:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.like-btn svg { width: 12px; height: 12px; stroke-width: 2; }
.like-btn.liked {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 42%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.like-btn.liked svg { fill: var(--danger); stroke: var(--danger); }
.like-btn.liked.bump { animation: like-bump 360ms ease; }
@keyframes like-bump {
  0%, 100% { transform: scale(1); }
  30%      { transform: scale(1.18); }
  60%      { transform: scale(0.96); }
}

/* ---- Tag chips (inline, colored by category hue) ------------------------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.02em;
  padding: 2px 7px;
  height: 20px; line-height: 1;
  border-radius: 3px;
  color: hsl(var(--tag-hue, 210), 45%, 78%);
  background: hsla(var(--tag-hue, 210), 55%, 55%, 0.07);
  border: 1px solid hsla(var(--tag-hue, 210), 55%, 55%, 0.22);
  white-space: nowrap;
}
[data-theme="light"] .tag {
  color: hsl(var(--tag-hue, 210), 55%, 35%);
  background: hsla(var(--tag-hue, 210), 60%, 60%, 0.10);
  border-color: hsla(var(--tag-hue, 210), 55%, 50%, 0.35);
}
.tag .cat {
  font-size: 9px;
  color: hsla(var(--tag-hue, 210), 35%, 65%, 0.85);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding-right: 5px;
  border-right: 1px solid hsla(var(--tag-hue, 210), 45%, 50%, 0.25);
}
[data-theme="light"] .tag .cat {
  color: hsla(var(--tag-hue, 210), 55%, 40%, 0.85);
}
.tag.mitre {
  color: #cbbaff;
  background: var(--purple-soft);
  border-color: var(--purple-line);
}
[data-theme="light"] .tag.mitre {
  color: #5b21b6;
}

/* ---- Sponsor card (direct-sold premium) ---------------------------------- */
.sponsor-card {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  margin-bottom: 4px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--gold) 6%, transparent), transparent 70%),
    var(--bg-1);
  position: relative;
  cursor: pointer;
  transition: border-color 120ms, background 120ms;
}
.sponsor-card:hover { border-color: color-mix(in srgb, var(--gold) 55%, var(--line-2)); }
.sponsor-card .sp-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
  padding-top: 2px;
}
.sponsor-card .sp-body { min-width: 0; }
.sponsor-card .sp-name {
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}
.sponsor-card .sp-name .sp-brand {
  color: var(--gold);
  margin-right: 6px;
}
.sponsor-card .sp-tag {
  font-size: 12.5px;
  color: var(--text-mute);
  margin-bottom: 6px;
}
.sponsor-card .sp-blurb {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sponsor-card .sp-cta {
  display: inline-flex; align-items: center;
  padding: 0 14px; height: 32px;
  border-radius: var(--radius);
  background: var(--gold);
  color: #1a1305;
  font-size: 12px; font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.sponsor-card .sp-cta:hover { background: #ffcb3d; color: #1a1305; }

/* ---- Programmatic ad banner (labelled placeholder) ---------------------- */
.ad-banner {
  margin: 18px 0;
  padding: 20px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: repeating-linear-gradient(
    45deg,
    var(--bg-1) 0 12px,
    var(--bg-2) 12px 13px
  );
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.ad-banner::before {
  content: "AD";
  position: absolute;
  top: 6px; left: 8px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  color: var(--text-dim);
  background: var(--bg-0);
  padding: 1px 5px;
  border-radius: 2px;
  border: 1px solid var(--line);
}

/* ---- Paywall lock overlay on feed rows ---------------------------------- */
.feed-row.locked .feed-summary { display: none; }
.paywall-stub {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--accent-dim), transparent 70%);
  margin: 0 0 10px;
  color: var(--text-mute);
  font-size: 12.5px;
}
.paywall-stub svg { width: 14px; height: 14px; color: var(--accent); }
.paywall-stub .cta {
  margin-left: auto;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid var(--accent-line);
  padding: 3px 9px;
  border-radius: 3px;
  background: var(--accent-dim);
  transition: background 120ms;
}
.paywall-stub .cta:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); }

/* ---- Footer -------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--line);
  padding: 22px 32px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}
.footer a { color: var(--text-mute); }
.footer a:hover { color: var(--accent); }

/* ---- Article detail page ------------------------------------------------- */
.article-wrap {
  max-width: 920px;
  padding: 28px 32px 64px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.breadcrumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--text-mute); }
.breadcrumb a:hover { color: var(--accent); }

.article-header {
  padding-bottom: 20px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.article-kicker {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.article-kicker .dot { color: var(--line-2); }
.article-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.25;
  margin: 0 0 14px;
}
.article-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-mute);
}
.article-meta .pipe { color: var(--line-2); }
.article-meta a { color: var(--accent); }

/* article social + like action row */
.article-actions {
  display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.article-actions .like-btn-lg {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--bg-1);
  font-size: 13px;
  color: var(--text-mute);
  transition: all 120ms;
}
.article-actions .like-btn-lg:hover {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
}
.article-actions .like-btn-lg svg { width: 15px; height: 15px; stroke-width: 2; }
.article-actions .like-btn-lg.liked {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger) 45%, transparent);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.article-actions .like-btn-lg.liked svg { fill: var(--danger); stroke: var(--danger); }
.article-actions .like-btn-lg .count-lg {
  font-family: var(--mono); font-size: 13px; font-weight: 600;
}
.article-actions .divider {
  width: 1px; height: 20px; background: var(--line); margin: 0 4px;
}
.article-actions .share-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-right: 2px;
}
.share-btn {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--bg-1);
  color: var(--text-mute);
  transition: all 120ms;
}
.share-btn:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}
.share-btn svg { width: 14px; height: 14px; }
.share-btn.copied {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 45%, transparent);
}

/* compact inline share for feed rows */
.feed-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.share-btn-mini {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-1);
  color: var(--text-dim);
  transition: all 120ms;
}
.share-btn-mini:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}
.share-btn-mini svg { width: 11px; height: 11px; stroke-width: 2; }
.share-btn-mini.copied { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.feed-actions .like-btn { margin-top: 0; }       /* override the default */
.feed-actions .share-divider {
  width: 1px; height: 16px; background: var(--line); margin: 0 2px;
}

.summary-block {
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-left: 2px solid var(--accent);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 22px;
}
.summary-block h3,
.commentary-block h3 {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin: 0 0 10px;
  font-weight: 500;
}
.summary-block p { margin: 0; color: var(--text); line-height: 1.65; }

.commentary-block {
  background: linear-gradient(180deg, var(--purple-soft), color-mix(in srgb, var(--purple) 2%, transparent));
  border: 1px solid var(--purple-line);
  border-left: 2px solid var(--purple);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin-bottom: 28px;
}
.commentary-block h3 { color: var(--purple); }
.commentary-block p { margin: 0; color: var(--text); line-height: 1.65; }
.commentary-block .byline {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-top: 12px;
}

/* article-level paywall overlay (when full content is locked) */
.article-paywall {
  margin: 8px 0 28px;
  padding: 26px 28px;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent-dim), transparent);
  text-align: center;
}
.article-paywall h3 {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--text);
}
.article-paywall p {
  margin: 0 auto 14px;
  max-width: 460px;
  color: var(--text-mute);
  font-size: 13px;
}
.article-paywall .btn {
  height: 36px;
  padding: 0 18px;
}

/* in-article sponsor card */
.sponsor-inline {
  padding: 16px 20px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 6%, transparent), var(--bg-1));
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}
.sponsor-inline .sp-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-transform: uppercase;
}

/* ---- read / unread toggle (header segmented control) ------------------- */
.read-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-1);
}
.read-toggle button {
  font: inherit;
  font-size: 12px;
  padding: 6px 12px;
  color: var(--text-mute);
  background: transparent;
  border: 0;
  border-right: 1px solid var(--line);
  cursor: pointer;
  transition: all 120ms;
}
.read-toggle button:last-child { border-right: 0; }
.read-toggle button:hover { color: var(--text); background: var(--bg-2); }
.read-toggle button.active {
  color: var(--accent);
  background: var(--accent-dim);
}

/* ---- feed row "read" state ---------------------------------------------- */
.feed-row.read .feed-title { color: var(--text-mute); }
.feed-row.read .feed-summary { opacity: 0.75; }
.feed-row.read .feed-score-val { opacity: 0.55; }
.feed-row.read::before {
  content: "";
  position: absolute;
  left: -2px; top: 16px; bottom: 16px;
  width: 2px;
  background: var(--text-dim);
  opacity: 0.4;
  border-radius: 2px;
  z-index: 4;
}

/* ---- user tags (private categorisation) -------------------------------- */
/* Uses its own blue accent so it visually separates from the purple
   editorial-commentary block and the teal research-refs panel. */
.user-tags-panel {
  --usertag-hue: 210;
  --usertag-base: hsl(var(--usertag-hue), 90%, 60%);
  --usertag-soft: hsla(var(--usertag-hue), 90%, 60%, 0.08);
  --usertag-line: hsla(var(--usertag-hue), 90%, 60%, 0.32);
  margin: 0 0 28px;
  padding: 20px 22px;
  border: 1px solid var(--usertag-line);
  border-left: 2px solid var(--usertag-base);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--usertag-soft), transparent);
}
.user-tags-panel .poc-panel-title { color: var(--usertag-base); }
.user-tags-hint {
  font-size: 12px;
  color: var(--text-mute);
  margin: 0 0 12px;
}
.user-tags-input-row { display: flex; }
.user-tags-suggestions {
  margin-top: 6px;
  min-height: 0;
}
.user-tags-suggestions-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 4px;
}
.user-tags-suggestions-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.user-tags-suggestions-hint {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-mute);
  padding: 4px 0;
}
.user-tags-status {
  min-height: 18px;
  margin: 6px 2px 10px;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--text-mute);
  transition: color 120ms, opacity 120ms;
}
.user-tags-status.status-ok  { color: var(--ok); }
.user-tags-status.status-err { color: var(--danger); }
.user-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; min-height: 26px; }
.user-tags-empty { color: var(--text-dim); font-size: 12px; font-style: italic; }
.user-tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 4px 3px 10px;
  color: hsl(var(--tag-hue, 210), 75%, 80%);
  background: hsla(var(--tag-hue, 210), 75%, 55%, 0.12);
  border: 1px solid hsla(var(--tag-hue, 210), 75%, 55%, 0.38);
  border-radius: 12px;
}
.user-tag-x {
  color: hsla(var(--tag-hue, 210), 55%, 75%, 0.7);
  padding: 0 6px; font-size: 14px; line-height: 1; cursor: pointer;
  background: transparent; border: 0;
}
.user-tag-x:hover { color: var(--danger); }
.user-tag-chip-apply {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  color: hsl(var(--tag-hue, 210), 65%, 75%);
  background: transparent;
  border: 1px dashed hsla(var(--tag-hue, 210), 75%, 55%, 0.40);
  border-radius: 12px;
  cursor: pointer;
}
.user-tag-chip-apply:hover {
  background: hsla(var(--tag-hue, 210), 75%, 55%, 0.15);
  border-style: solid;
}
.user-tags-form { margin-bottom: 10px; }
.user-tags-form input {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-family: var(--sans);
}
.user-tags-form input:focus {
  outline: none;
  border-color: hsla(210, 90%, 60%, 0.45);
  box-shadow: 0 0 0 3px hsla(210, 90%, 60%, 0.12);
}
.user-tags-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.user-tags-quicklabel {
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.18em;
  color: var(--text-dim); text-transform: uppercase; margin-right: 4px;
}

/* ---- "GITHUB POC" source badge ----------------------------------------- */
.poc-badge {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: #081016;
  background: #a78bfa;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 2px;
}
[data-theme="light"] .poc-badge { color: #fff; }

/* ---- PoC panel (GitHub repos) ----------------------------------------- */
.poc-panel {
  margin: 0 0 28px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--line));
  border-left: 2px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 5%, transparent), transparent);
}
.poc-panel-title {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin: 0 0 14px;
  font-weight: 500;
}
.poc-cve-group { margin-bottom: 16px; }
.poc-cve-group:last-child { margin-bottom: 0; }
.poc-cve-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.poc-cve-head a {
  font-size: 13px; font-weight: 600;
  color: var(--danger);
  text-decoration: none;
}
.poc-cve-head a:hover { color: var(--accent); }
.poc-cve-count {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.poc-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.poc-row {
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  text-decoration: none;
  color: var(--text);
  transition: all 120ms;
}
.poc-row:hover {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-2));
  color: var(--text);
}
.poc-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.poc-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  word-break: break-all;
}
.poc-desc {
  font-size: 12.5px;
  color: var(--text-mute);
  line-height: 1.45;
  margin: 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.poc-meta {
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.06em;
  display: flex;
  gap: 8px;
  align-items: center;
}
.poc-meta .poc-stars { color: var(--gold); }
.poc-meta .poc-dot   { color: var(--line-2); }

/* language badge (used on PoC rows) */
.lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-family: var(--mono);
  letter-spacing: 0.02em;
  color: var(--text-mute);
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.lang-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
}

/* CVE hover tooltip (populated by /api/cve/:id) */
.cve-tooltip {
  position: absolute;
  max-width: 420px;
  min-width: 280px;
  padding: 12px 14px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  z-index: 200;
  font-size: 12.5px;
  line-height: 1.5;
  /* interactive — user must be able to click the action links inside */
  pointer-events: auto;
}
.cve-tip-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.cve-tip-id {
  font-size: 13px; font-weight: 600; color: var(--danger);
}
.cve-tip-cvss {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.cve-tip-desc {
  color: var(--text-mute);
  font-size: 12.5px;
  line-height: 1.55;
  margin-bottom: 8px;
}
.cve-tip-empty, .cve-tip-loading {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.cve-tip-meta {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

/* --- In-the-wild hover popover --- */
.itw-trigger { cursor: help; }
.itw-tip-cves {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 10px;
}
.itw-tip-cve {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  text-decoration: none;
}
.itw-tip-cve:hover { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--text); }

.itw-tip-sources-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 4px 0 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.itw-tip-sources {
  list-style: none;
  margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 8px;
}
.itw-tip-sources li { line-height: 1.4; }
.itw-tip-title {
  color: var(--text);
  text-decoration: none;
  font-size: 12.5px;
}
.itw-tip-title:hover { color: var(--accent); text-decoration: underline; }
.itw-tip-meta {
  display: flex; flex-wrap: wrap; gap: 4px;
  font-size: 10.5px;
  color: var(--text-dim);
  margin-top: 2px;
}
.itw-tip-ref-cve {
  color: var(--warn);
  font-size: 10.5px;
}
.cve-tip-hint { color: var(--accent); }
.cve-tip-src { color: var(--text-dim); }
.cve-tip-actions {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.cve-tip-link {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--accent);
  text-decoration: none;
  padding: 3px 0;
}
.cve-tip-link:hover { color: var(--accent-2); text-decoration: underline; }

/* CVE external references — compact pill buttons */
.cve-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
.cve-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.02em;
  padding: 5px 10px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--text-mute);
  text-decoration: none;
  transition: all 120ms;
}
.cve-ref:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-dim);
}
.cve-ref svg { opacity: 0.75; }

/* Tag taxonomy section */
.tag-matrix {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px 20px;
  margin-bottom: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-1);
}
.tag-matrix .mx-label {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding-top: 3px;
}
.tag-matrix .mx-vals { display: flex; flex-wrap: wrap; gap: 5px; }

.related-head {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 32px 0 12px;
}
.related-list { display: flex; flex-direction: column; gap: 0; }

/* ---- Modal (login + digest) --------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 6, 10, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}
[data-theme="light"] .modal-backdrop { background: rgba(11, 16, 22, 0.35); }
.modal-backdrop.open { opacity: 1; pointer-events: auto; }
.modal-card {
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 420px;
  position: relative;
  box-shadow: var(--shadow-pop);
  transform: translateY(6px) scale(0.98);
  transition: transform 180ms ease;
}
.modal-card.wide { max-width: 540px; }
.modal-backdrop.open .modal-card { transform: translateY(0) scale(1); }
.modal-card .modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 28px; height: 28px;
  border-radius: 4px;
  color: var(--text-dim);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background 120ms, color 120ms;
}
.modal-card .modal-close:hover { background: var(--bg-2); color: var(--text); }
.modal-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.modal-card .modal-sub {
  margin: 0 0 18px;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1.5;
}

/* login modal specifics */
.provider-btn {
  width: 100%;
  height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  transition: border-color 120ms, background 120ms;
}
.provider-btn:hover { border-color: var(--accent-line); background: var(--bg-3); }
.provider-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.provider-btn .arrow { margin-left: auto; color: var(--text-dim); }

.or-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 14px 0;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.or-divider::before, .or-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}

.magic-link-form { display: flex; flex-direction: column; gap: 8px; }
.magic-link-form input {
  height: 40px;
  padding: 0 14px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit;
  font-family: var(--sans);
}
.magic-link-form input:focus {
  outline: none;
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
}
.magic-link-form button.accent {
  height: 40px;
  background: var(--accent);
  color: #061013;
  font-weight: 600;
  border: 0;
  border-radius: var(--radius);
  transition: background 120ms;
}
.magic-link-form button.accent:hover { background: var(--accent-2); }

.fine-print {
  margin-top: 14px;
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.5;
  text-align: center;
}
.fine-print a { color: var(--text-mute); }

/* ---- Login modal: OTP + social providers ------------------------------- */
.modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-2);
}

.social-stack { display: flex; flex-direction: column; gap: 8px; }
.social-btn {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 14px;
  background: var(--bg-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font: inherit;
  font-family: var(--sans);
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.social-btn:not(:disabled):hover { background: var(--bg-3); border-color: var(--accent-line); }
.social-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.social-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.social-label { text-align: left; font-size: 14px; }
.social-hint {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 2px 8px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
}

/* OTP step — single wide input, large mono font, spaced digits. */
.otp-form .otp-input {
  height: 56px;
  font-family: var(--mono);
  font-size: 28px;
  letter-spacing: 0.45em;
  text-align: center;
  padding: 0 0 0 0.45em;           /* compensate trailing letter-spacing */
  caret-color: var(--accent);
}
.otp-form .otp-input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}
.otp-err {
  min-height: 18px;
  font-size: 12px;
  color: var(--danger);
  line-height: 1.4;
  margin-top: 4px;
}
.otp-err a { color: var(--accent); }

.otp-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  font-size: 12px;
}
.otp-link {
  color: var(--text-mute);
  border-bottom: 1px dashed var(--line-2);
  padding-bottom: 1px;
  cursor: pointer;
}
.otp-link:hover { color: var(--accent); border-color: var(--accent-line); }

/* magic-link sent confirmation */
.magic-sent {
  text-align: center;
  padding: 20px 0;
}
.magic-sent .check {
  width: 44px; height: 44px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ok) 18%, transparent);
  color: var(--ok);
  display: inline-flex; align-items: center; justify-content: center;
}
.magic-sent h3 { margin: 0 0 6px; font-size: 15px; }
.magic-sent p { margin: 0; color: var(--text-mute); font-size: 13px; }

/* digest modal specifics */
.digest-field { margin-bottom: 16px; }
.digest-field label {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.digest-field input[type="email"] {
  width: 100%; height: 38px;
  padding: 0 12px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  color: var(--text);
  font: inherit; font-family: var(--sans);
}
.digest-field input[type="email"]:focus {
  outline: none; border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-dim);
}

.cadence-row { display: flex; gap: 6px; }
.cadence-opt {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  cursor: pointer;
  transition: all 120ms;
}
.cadence-opt:hover { border-color: var(--line-2); }
.cadence-opt.selected {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.cadence-opt .label {
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.cadence-opt.selected .label { color: var(--accent); }
.cadence-opt .hint {
  font-size: 11px;
  color: var(--text-dim);
  line-height: 1.35;
}

.digest-tags {
  max-height: 220px;
  overflow-y: auto;
  padding: 10px 10px 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.digest-tag-group { margin-bottom: 10px; }
.digest-tag-group .gt {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--text-dim);
  text-transform: uppercase;
  margin-bottom: 4px;
}

.digest-summary {
  font-size: 12px;
  color: var(--text-mute);
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 2px solid var(--accent);
  background: var(--accent-dim);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.digest-summary b { color: var(--accent); font-family: var(--mono); font-weight: 500; }

/* ---- Responsive trims ---------------------------------------------------- */
@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 12px; padding: 0 14px; }
  .logo-sub { display: none; }
  .main { padding: 18px 16px 48px; }
  .feed-row { grid-template-columns: 64px 1fr; }
  .feed-score { display: none; }
  .sponsor-card { grid-template-columns: 1fr; text-align: left; }
  .sponsor-card .sp-cta { justify-self: flex-start; }
  .tag-matrix { grid-template-columns: 1fr; }
}

/* ---- CVE tooltip: PoC count badge ------------------------------------- */
.cve-tip-poc {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  background: var(--accent-dim);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
/* CISA KEV — authoritative "exploited in the wild" flag. Red to read
   as a strong warning; outranks PoC count when shown together. */
.cve-tip-kev {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 10px;
  color: #ffffff;
  background: var(--danger);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Search-pattern cards on /cve/:id --------------------------------- */
.search-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.search-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 120ms, background 120ms;
}
.search-card:hover {
  border-color: var(--accent);
  background: var(--bg-3);
}
.search-card.primary {
  border-left: 2px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-dim), transparent 80%);
}
.search-more { margin-top: 14px; }
.search-more summary {
  cursor: pointer;
  color: var(--text-mute);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 0;
  list-style: none;
}
.search-more summary::-webkit-details-marker { display: none; }
.search-more summary::before { content: '▸ '; color: var(--text-dim); }
.search-more[open] summary::before { content: '▾ '; }
.search-more summary:hover { color: var(--accent); }
.search-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.search-engine {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.search-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}
.search-query {
  font-size: 11px;
  color: var(--text);
  background: var(--bg-1);
  padding: 4px 8px;
  border-radius: 4px;
  word-break: break-word;
  line-height: 1.4;
}
.search-note {
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.4;
}

/* ---- CISA KEV banner (inside the vuln panel when kev=true) ------------- */
.kev-banner {
  margin: -4px 0 18px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 50%, transparent);
  border-left: 3px solid var(--danger);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--danger) 10%, transparent);
}
.kev-banner-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kev-pill {
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--danger);
  color: #ffffff;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
}
.kev-banner-text { color: var(--text); font-size: 13px; }
.kev-ransomware {
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent);
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 12%, transparent);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.kev-action { margin-top: 8px; font-size: 12.5px; color: var(--text-mute); line-height: 1.5; }
.kev-action-label { color: var(--text-dim); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---- NVD data panel on /cve/:id --------------------------------------- */
.nvd-panel {
  margin: 24px 0 20px;
  padding: 22px 24px;
  background: var(--bg-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.nvd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
}
.nvd-cell { min-width: 0; }
.nvd-cell.wide { grid-column: 1 / -1; }
.nvd-cell-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.nvd-cell-value {
  font-size: 28px;
  line-height: 1;
  color: var(--text);
  font-weight: 500;
}
.nvd-cell-sub {
  font-size: 11px;
  color: var(--text-mute);
  line-height: 1.4;
  margin-top: 6px;
}
.nvd-sev-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  color: var(--text-mute);
}
.nvd-sev-critical { color: #ff3d57; border-color: color-mix(in srgb, #ff3d57 50%, transparent); background: color-mix(in srgb, #ff3d57 10%, transparent); }
.nvd-sev-high     { color: #ff9040; border-color: color-mix(in srgb, #ff9040 50%, transparent); background: color-mix(in srgb, #ff9040 10%, transparent); }
.nvd-sev-medium   { color: #fbbf24; border-color: color-mix(in srgb, #fbbf24 50%, transparent); background: color-mix(in srgb, #fbbf24 10%, transparent); }
.nvd-sev-low      { color: #51cf66; border-color: color-mix(in srgb, #51cf66 50%, transparent); background: color-mix(in srgb, #51cf66 10%, transparent); }
.nvd-sev-info     { color: var(--text-dim); }
.nvd-cwe-list { display: flex; flex-wrap: wrap; gap: 6px; }
.nvd-cwe {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 120ms;
}
.nvd-cwe:hover { border-color: var(--accent); color: var(--accent); }
.nvd-cwe-name { color: var(--text-mute); }
.nvd-desc {
  color: var(--text-mute);
  line-height: 1.55;
  margin: 0;
}

/* ---- CWE page ---------------------------------------------------------- */
.cwe-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cwe-list li {
  padding: 10px 14px;
  border-left: 2px solid var(--accent-line);
  background: var(--bg-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 13px;
  color: var(--text);
}
.cwe-cve-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.cwe-cve-row {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 120ms;
}
.cwe-cve-row:hover { border-color: var(--accent); }
.cwe-cve-row .mono { color: var(--accent); }
.cwe-cve-date { color: var(--text-dim); justify-self: end; font-size: 11px; }

/* Filter chips with a zero facet count — still clickable (to untoggle if
   they happen to be active), but visually dimmed so the user can tell at a
   glance that adding this filter would produce an empty result. */
.filter-chip.zero {
  opacity: 0.35;
  filter: saturate(0.5);
}
.filter-chip.zero:hover { opacity: 0.7; }

/* Admin ingest log + blocklist rows */
.admin-ingest-log {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow: auto;
}
.admin-ingest-log-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 12px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--bg-2);
  border-left: 2px solid var(--line-2);
}
.admin-ingest-log-row.kind-ok      { border-left-color: var(--ok); }
.admin-ingest-log-row.kind-dup     { border-left-color: var(--gold); opacity: 0.85; }
.admin-ingest-log-row.kind-blocked { border-left-color: var(--warn); opacity: 0.75; }
.admin-ingest-log-row.kind-err     { border-left-color: var(--danger); }
.admin-ingest-host { color: var(--text-mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-ingest-msg  { color: var(--text); }

.admin-blocklist { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.admin-block-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.profile-form textarea {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
  min-height: 90px;
}
.profile-form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}

/* Admin icon-button in the topbar. Slightly accented outline so it reads as
   a privileged control — not just another RSS button. */
.btn.icon.admin-btn {
  border-color: var(--accent-line);
  color: var(--accent);
}
.btn.icon.admin-btn:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* Feed pagination — "Load more" button centred below the feed. */
.feed-paginator {
  display: flex;
  justify-content: center;
  padding: 24px 0 48px;
}
.feed-load-more {
  padding: 10px 24px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent-line);
  background: var(--accent-dim);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 120ms, border-color 120ms;
}
.feed-load-more:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 18%, transparent); border-color: var(--accent); }
.feed-load-more:disabled { opacity: 0.6; cursor: progress; }

/* Top-of-feed per-type filter row. Replaces the sidebar `type` chip list
   + the old News & Tools nav. Buttons sit just under .page-header, scroll
   horizontally on narrow viewports rather than wrap so the row stays one
   line. .active gets the same accent treatment as a selected sidebar nav. */
.type-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  position: sticky;
  top: 105px;
  z-index: 4;
  background: var(--bg-0);
}
.type-btn {
  appearance: none;
  background: transparent;
  border: 1px solid var(--line-2);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms;
}
.type-btn:hover { color: var(--text); border-color: var(--accent-line); }
.type-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent-line);
  color: var(--accent);
}

/* Server-paginated Prev / page-N / Next nav. Lives inside #feed-paginator
   when the home route is unfiltered; replaced by .feed-load-more when
   client-side filters are active. */
.page-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.1em;
}
.page-nav .btn { padding: 8px 16px; text-transform: uppercase; text-decoration: none; }
.page-nav .btn.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.page-indicator { color: var(--text-dim); padding: 0 8px; }

/* Feed sort dropdown — lives in the page header next to the read-toggle. */
.sort-select {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 5px 10px;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 12px;
  cursor: pointer;
}
.sort-select:hover  { border-color: var(--accent-line); }
.sort-select:focus  { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-dim); }

/* ---- Admin users directory ---------------------------------------------- */
.admin-users-table td, .admin-users-table th { vertical-align: middle; }
.admin-users-table td:first-child, .admin-users-table th:first-child { width: 28px; padding-right: 4px; }

/* Presence dot — green when online, grey when offline */
.presence-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-dim);
  vertical-align: middle;
}
.presence-dot.online {
  background: var(--ok);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 25%, transparent);
}
.presence-dot.offline { opacity: 0.5; }

/* iOS-style toggle switch for the is_admin column */
.admin-toggle {
  position: relative;
  display: inline-block;
  width: 36px; height: 20px;
  cursor: pointer;
}
.admin-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.admin-toggle-slider {
  position: absolute; inset: 0;
  background: var(--bg-3);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  transition: background 120ms, border-color 120ms;
}
.admin-toggle-slider::before {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  background: var(--text-mute);
  border-radius: 50%;
  transition: transform 120ms, background 120ms;
}
.admin-toggle input:checked + .admin-toggle-slider {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  border-color: var(--accent);
}
.admin-toggle input:checked + .admin-toggle-slider::before {
  transform: translateX(16px);
  background: var(--accent);
}
.admin-toggle input:disabled + .admin-toggle-slider { opacity: 0.55; cursor: not-allowed; }

/* ---- Profile page -------------------------------------------------------- */
.profile-wrap { max-width: 880px; margin: 0 auto; padding: 32px 28px 64px; }
.profile-section {
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-1);
}
.profile-section-title {
  font-size: 12px;
  font-family: var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 18px;
}
.profile-form { display: flex; flex-direction: column; gap: 16px; max-width: 480px; }
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-label {
  font-size: 11px;
  font-family: var(--mono);
  letter-spacing: 0.12em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.profile-form input[type="email"],
.profile-form input[type="text"],
.profile-form select {
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.profile-form input:read-only { color: var(--text-mute); background: var(--bg-0); }
.profile-form input:focus, .profile-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-dim);
}
.profile-hint { font-size: 11px; color: var(--text-dim); }
.profile-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.profile-status { font-size: 12px; color: var(--text-mute); font-family: var(--mono); }
.profile-status.status-ok  { color: var(--ok); }
.profile-status.status-err { color: var(--danger); }

.profile-empty {
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  color: var(--text-mute);
  font-size: 13px;
}

.profile-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text);
}
.profile-table th, .profile-table td {
  text-align: left;
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.profile-table tbody tr:last-child td { border-bottom: none; }
.profile-table th {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  text-transform: uppercase;
  font-weight: 500;
  border-bottom: 1px solid var(--line-2);
}

.session-badge {
  display: inline-block;
  padding: 2px 9px;
  font-size: 10px;
  font-family: var(--mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 10px;
  border: 1px solid var(--line-2);
  color: var(--text-mute);
}
.session-badge.current { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.session-badge.active  { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.session-badge.expired { color: var(--text-dim); opacity: 0.7; }

.btn.danger {
  border-color: color-mix(in srgb, var(--danger) 40%, transparent);
  color: var(--danger);
  background: color-mix(in srgb, var(--danger) 8%, transparent);
}
.btn.danger:hover { background: color-mix(in srgb, var(--danger) 18%, transparent); color: var(--text); }
.btn.danger:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { padding: 4px 10px; font-size: 12px; }

.profile-plan {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.plan-name { font-size: 18px; font-family: var(--mono); color: var(--accent); }
.plan-meta { font-size: 12px; color: var(--text-mute); margin-top: 6px; line-height: 1.5; max-width: 520px; }

@media (max-width: 640px) {
  .profile-wrap { padding: 22px 14px 48px; }
  .profile-section { padding: 16px 14px; }
  .profile-table { font-size: 12px; }
  .profile-table th, .profile-table td { padding: 7px 8px; }
  .profile-form { max-width: 100%; }
}
