/* ==========================================================================
   srcx design system — dark-first, tokens + components
   ========================================================================== */

:root {
  /* Brand */
  --brand-lime: #a5dc56;
  --brand-lime-strong: #8fd13a;
  --brand-navy: #0c0c4f;

  /* Dark theme (default) */
  --bg: #0a0c12;
  --bg-2: #0f121a;
  --surface: #141826;
  --surface-2: #1b2030;
  --surface-3: #232a3d;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ecf5;
  --text-muted: #a0a8bf;
  --text-dim: #6e778f;
  --accent: var(--brand-lime);
  --accent-strong: var(--brand-lime-strong);
  --accent-text: #0b1205;
  --accent-soft: rgba(165, 220, 86, 0.14);
  --link: #8fb4ff;
  --danger: #ff6b6b;
  --danger-soft: rgba(255, 107, 107, 0.14);
  --warn: #ffb454;
  --warn-soft: rgba(255, 180, 84, 0.14);
  --success: #4ade80;
  --success-soft: rgba(74, 222, 128, 0.14);
  --info: #5fb8ff;
  --info-soft: rgba(95, 184, 255, 0.14);
  --overlay: rgba(4, 6, 12, 0.7);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 3px var(--accent-soft);

  /* Typography */
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.75rem;
  --fs-3xl: 2.25rem;
  --fs-4xl: 3rem;
  --lh: 1.6;

  /* Spacing */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-12: 48px; --s-16: 64px;

  /* Radii */
  --r-xs: 4px; --r-sm: 8px; --r: 12px; --r-lg: 16px; --r-xl: 24px; --r-full: 999px;

  /* Layout */
  --container: 1200px;
  --container-narrow: 760px;
  --header-h: 64px;
  --t: 160ms cubic-bezier(0.4, 0, 0.2, 1);
  --t-slow: 320ms cubic-bezier(0.4, 0, 0.2, 1);

  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #f4f5f9;
  --bg-2: #eceef4;
  --surface: #ffffff;
  --surface-2: #f3f4f8;
  --surface-3: #e8eaf1;
  --border: rgba(12, 14, 40, 0.09);
  --border-strong: rgba(12, 14, 40, 0.18);
  --text: #12152a;
  --text-muted: #4d5470;
  --text-dim: #7a8199;
  --accent: #5f9c14;
  --accent-strong: #4d820c;
  --accent-text: #ffffff;
  --accent-soft: rgba(95, 156, 20, 0.12);
  --link: #2f5fd6;
  --danger: #d8434a;
  --danger-soft: rgba(216, 67, 74, 0.1);
  --warn: #c77a12;
  --warn-soft: rgba(199, 122, 18, 0.12);
  --success: #1f9d55;
  --success-soft: rgba(31, 157, 85, 0.12);
  --info: #1f7ed6;
  --info-soft: rgba(31, 126, 214, 0.12);
  --overlay: rgba(20, 24, 40, 0.5);
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, 0.08);
  --shadow: 0 8px 24px -10px rgba(20, 24, 40, 0.18);
  --shadow-lg: 0 24px 60px -24px rgba(20, 24, 40, 0.28);
  color-scheme: light;
}

/* --------------------------------------------------------------------------
   Reset & base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  min-height: 100svh;
  overflow-x: clip;
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--text);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(165, 220, 86, 0.10), transparent 60%),
    radial-gradient(800px 500px at 100% 0%, rgba(124, 92, 255, 0.10), transparent 60%);
}
html[data-theme="light"] body::before { opacity: 0.6; }
img, svg, video { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 var(--s-3); line-height: 1.2; font-weight: 700; letter-spacing: -0.015em; color: var(--text); }
h1 { font-size: var(--fs-3xl); } h2 { font-size: var(--fs-2xl); } h3 { font-size: var(--fs-xl); } h4 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--s-3); }
small, .text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.muted { color: var(--text-muted); }
.dim { color: var(--text-dim); }
.mono { font-family: var(--font-mono); }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }
code, kbd { font-family: var(--font-mono); font-size: 0.9em; background: var(--surface-2); padding: 0.1em 0.4em; border-radius: var(--r-xs); }
::selection { background: var(--accent); color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-xs); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 var(--s-5); }
.container-narrow { width: 100%; max-width: var(--container-narrow); margin: 0 auto; padding: 0 var(--s-5); }
main#app { flex: 1; padding: var(--s-8) 0 var(--s-16); }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-6); }
.page-title h1 { margin: 0; font-size: var(--fs-2xl); }
.page-title .sub { color: var(--text-muted); margin: var(--s-1) 0 0; }
.grid { display: grid; gap: var(--s-5); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s-6); align-items: start; }
.layout-sidebar-left { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.sticky { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
.stack { display: flex; flex-direction: column; gap: var(--s-4); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.row { display: flex; align-items: center; gap: var(--s-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.mt-2 { margin-top: var(--s-2); } .mt-4 { margin-top: var(--s-4); } .mt-6 { margin-top: var(--s-6); } .mt-8 { margin-top: var(--s-8); }
.mb-2 { margin-bottom: var(--s-2); } .mb-4 { margin-bottom: var(--s-4); } .mb-6 { margin-bottom: var(--s-6); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-sidebar, .layout-sidebar-left { grid-template-columns: minmax(0, 1fr); }
  .sticky { position: static; }
}
@media (max-width: 640px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  main#app { padding: var(--s-5) 0 calc(var(--s-12) + env(safe-area-inset-bottom, 0px)); }
  .container, .container-narrow { padding: 0 var(--s-4); }
  h1 { font-size: var(--fs-2xl); }
  .page-title { align-items: flex-start; }
  .input, .textarea, .select { font-size: 16px; }
  .dropdown { min-width: 0; width: min(260px, calc(100vw - 16px)); max-width: calc(100vw - 16px); }
}

/* --------------------------------------------------------------------------
   Header / nav
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: auto;
  min-height: var(--header-h);
  padding-top: env(safe-area-inset-top, 0px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--border);
}
html.profile-chrome[data-theme="light"] body.has-profile-bg::before { opacity: 1; }
html.profile-chrome .site-header {
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  border-bottom-color: var(--border);
}
.site-header .container { height: var(--header-h); display: flex; align-items: center; gap: var(--s-5); min-width: 0; }
.logo { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; color: var(--text); text-decoration: none !important; }
.logo .x { color: var(--accent); }
.logo img { width: 28px; height: 28px; border-radius: 8px; }
.nav-links { display: flex; align-items: center; gap: var(--s-1); margin-left: var(--s-2); }
.nav-link {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 8px 12px; border-radius: var(--r-sm); color: var(--text-muted); font-weight: 500; font-size: var(--fs-sm);
  text-decoration: none !important; transition: background var(--t), color var(--t);
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.nav-link .icon { width: 16px; height: 16px; }
.nav-spacer { flex: 1; }
.nav-search { display: flex; align-items: center; gap: 4px; min-width: 0; position: relative; }
.nav-search .input { width: 168px; max-width: 26vw; }
.live-search {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 70;
  width: min(400px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: min(70vh, 480px); overflow-y: auto;
}
.live-group { padding: 8px 0 4px; border-bottom: 1px solid var(--border); }
.live-label { display: flex; align-items: center; gap: 6px; padding: 4px 12px 6px; font-size: var(--fs-xs); font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.live-hit { display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px; color: inherit; text-decoration: none !important; }
.live-hit:hover, .live-hit.is-active { background: var(--surface-2); }
.live-hit .grow { min-width: 0; font-size: var(--fs-sm); line-height: 1.3; }
.live-hit .sub { display: block; font-size: var(--fs-xs); color: var(--text-dim); font-weight: 400; }
.live-more { display: block; padding: 10px 12px; font-size: var(--fs-sm); font-weight: 600; border-top: 1px solid var(--border); }
a.mention { color: var(--accent); font-weight: 600; text-decoration: none !important; }
a.mention:hover { text-decoration: underline !important; }
.mention-suggest {
  position: fixed; z-index: 90;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  width: min(280px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
  max-height: min(240px, 45vh); overflow-y: auto; overflow-x: hidden;
}
.mention-hit {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 12px; border: 0; background: transparent; color: inherit;
  text-align: left; cursor: pointer; font: inherit;
}
.mention-hit:hover, .mention-hit.is-active { background: var(--surface-2); }
.mention-hit .grow { min-width: 0; line-height: 1.3; }
.mention-hit .n { font-size: var(--fs-sm); font-weight: 600; overflow-wrap: anywhere; }
.mention-hit .sub { display: block; font-size: var(--fs-xs); color: var(--text-dim); font-weight: 400; }
.mention-suggest .mention-empty { margin: 0; padding: 12px; }
.hover-card {
  position: fixed; z-index: 95;
  background: var(--hc-panel, var(--surface));
  color: var(--hc-text, var(--text));
  border: 1px solid var(--hc-border, var(--border));
  border-radius: var(--r);
  box-shadow: var(--shadow-lg);
  padding: 0;
  overflow: hidden;
  width: min(280px, calc(100vw - 16px));
  max-width: calc(100vw - 16px);
}
.hover-banner {
  height: 64px;
  background: var(--hc-banner, linear-gradient(120deg, color-mix(in srgb, var(--accent) 40%, var(--surface)), var(--surface-3)));
  background-size: cover;
  background-position: center;
}
.hover-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hover-card-body {
  position: relative;
  padding: 0 12px 12px;
  margin-top: -22px;
  background: var(--hc-body, var(--hc-panel, var(--surface)));
  background-size: cover;
  color: var(--hc-text, var(--text));
}
.hover-card-body::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--hc-scrim, rgba(8,10,18,.72));
  pointer-events: none;
}
.hover-card-body > * { position: relative; z-index: 1; }
.hover-card-head { display: flex; gap: 10px; align-items: flex-end; text-decoration: none !important; color: inherit; padding-top: 0; }
.hover-card-head .avatar { border: 2px solid var(--hc-panel, var(--surface)); background: var(--hc-panel, var(--surface)); flex: none; }
.hover-card-head .n { font-weight: 700; color: var(--hc-text, var(--text)); }
.hover-card-head .sub { font-size: var(--fs-xs); color: var(--hc-muted, var(--text-dim)); }
.hover-bio { margin: 8px 0; font-size: var(--fs-sm); color: var(--hc-muted, var(--text-muted)); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.hover-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hover-meta { font-size: var(--fs-sm); color: var(--hc-muted, var(--text-dim)); }
.hover-card .btn-primary { background: var(--hc-accent, var(--accent)); color: var(--hc-accent-text, var(--accent-text)); border-color: transparent; }
#report-wrap, #report-profile-wrap { display: contents; }
.report-reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.report-reasons .chip { cursor: pointer; background: var(--surface-2); font: inherit; }
.report-reasons .chip[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
.report-btn { white-space: nowrap; }
.activity-strip { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--s-4); }
.activity-item { display: flex; gap: var(--s-3); align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none !important; color: inherit; }
.activity-item:hover { background: var(--surface-2); }
.activity-item .t { font-size: var(--fs-sm); overflow-wrap: anywhere; }
.activity-item .when { font-size: var(--fs-xs); color: var(--text-dim); }
.nav-actions { display: flex; align-items: center; gap: var(--s-2); }
.notif-menu { position: relative; }
.notif-btn { position: relative; }
.notif-btn .count-pill {
  position: absolute; top: 0; right: 0; margin: 0; min-width: 16px; height: 16px;
  padding: 0 4px; font-size: 10px; line-height: 16px; display: inline-flex; align-items: center; justify-content: center;
}
.notif-dropdown {
  width: min(360px, calc(100vw - 16px)); max-width: calc(100vw - 16px);
  padding: 0; overflow: hidden; right: 0;
}
.notif-dropdown .dropdown-head { padding: 10px 12px; border-bottom: 1px solid var(--border); gap: 8px; }
.notif-dropdown #notif-preview { max-height: min(360px, 55vh); overflow-y: auto; }
.notif-dropdown > .dropdown-item { border-top: 1px solid var(--border); }
.notif-item { display: flex; gap: var(--s-3); align-items: flex-start; padding: 10px 12px; text-decoration: none !important; color: inherit; border-bottom: 1px solid transparent; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item .t { font-size: var(--fs-sm); line-height: 1.35; overflow-wrap: anywhere; }
.notif-item .when { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
.nav-burger { display: none; }
.nav-drawer { display: none; }
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-search { display: none; }
  .nav-search.live-open {
    display: flex; flex-direction: column; align-items: stretch; gap: 8px;
    position: fixed; z-index: 70;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 4px);
    left: 8px; right: 8px; width: auto; max-width: none;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
    padding: 8px; box-shadow: var(--shadow-lg);
  }
  .nav-search.live-open .input { width: 100%; max-width: none; }
  .nav-search.live-open .live-search {
    position: static; width: 100%; max-width: none; box-shadow: none; border: 0; max-height: min(60vh, 420px);
  }
  .nav-burger { display: inline-flex; }
  .nav-actions > a.btn { display: none; }
  .user-menu-btn .name { display: none; }
  .user-menu-btn { padding: 4px; }
  .logo { font-size: 1.15rem; min-width: 0; }
  .site-header .container { gap: var(--s-2); }
  .nav-drawer {
    display: block; position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    left: 0; right: 0; z-index: 49;
    padding-left: calc(var(--s-3) + env(safe-area-inset-left, 0px));
    padding-right: calc(var(--s-3) + env(safe-area-inset-right, 0px));
    background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    padding-top: var(--s-3); padding-bottom: var(--s-3);
    transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all var(--t);
  }
  .nav-drawer.open { transform: none; opacity: 1; pointer-events: auto; }
  .nav-drawer .nav-link { display: flex; padding: 12px; font-size: var(--fs-md); min-height: 44px; }
}

/* User menu */
.user-menu { position: relative; }
.user-menu-btn { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 8px 4px 4px; border-radius: var(--r-full); border: 1px solid var(--border); background: var(--surface); }
.user-menu-btn:hover { border-color: var(--border-strong); }
.user-menu-btn .name { font-size: var(--fs-sm); font-weight: 600; max-width: 120px; }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 220px; z-index: 60;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg);
  padding: var(--s-2); opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none; transition: all var(--t);
}
.dropdown.open { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-item {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left;
  padding: 10px 12px; border-radius: var(--r-sm); border: 0; background: transparent; color: var(--text); font-size: var(--fs-sm);
  text-decoration: none !important; transition: background var(--t);
}
.dropdown-item:hover { background: var(--surface-2); }
.dropdown-item .icon { width: 16px; height: 16px; color: var(--text-muted); }
.dropdown-item.danger { color: var(--danger); }
.dropdown-sep { height: 1px; background: var(--border); margin: var(--s-2) 0; }
.dropdown-head { padding: 8px 12px 10px; }
.dropdown-head .nick { font-weight: 700; }
.dropdown-head .role { font-size: var(--fs-xs); color: var(--text-dim); }
.count-pill { margin-left: auto; background: var(--accent); color: var(--accent-text); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--r-full); }
.dropdown.notif-dropdown { width: min(360px, calc(100vw - 16px)); max-width: calc(100vw - 16px); padding: 0; overflow: hidden; }
@media (max-width: 900px) {
  .dropdown.notif-dropdown {
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px) + 4px);
    left: 8px; right: 8px;
    width: auto; max-width: none; min-width: 0;
  }
}

/* Footer */
.site-footer { border-top: 1px solid var(--border); padding: var(--s-8) 0 calc(var(--s-8) + env(safe-area-inset-bottom, 0px)); color: var(--text-dim); font-size: var(--fs-sm); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; justify-content: space-between; }
.site-footer a { color: var(--text-muted); }

/* --------------------------------------------------------------------------
   Icons
   -------------------------------------------------------------------------- */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 14px; height: 14px; }
.icon-lg { width: 24px; height: 24px; }

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font-weight: 600; font-size: var(--fs-sm); line-height: 1.2; white-space: nowrap;
  background: var(--surface-2); color: var(--text); text-decoration: none !important;
  transition: background var(--t), border-color var(--t), transform var(--t), box-shadow var(--t), opacity var(--t);
  user-select: none;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-outline { background: transparent; border-color: var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: var(--success-soft); color: var(--success); }
.btn-success:hover { background: var(--success); color: #062b14; }
.btn-sm { padding: 6px 10px; font-size: var(--fs-xs); border-radius: 6px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-lg { padding: 13px 22px; font-size: var(--fs-md); border-radius: var(--r); }
.btn-icon { padding: 8px; width: 36px; height: 36px; border-radius: var(--r-sm); }
.btn-icon.btn-sm { width: 30px; height: 30px; padding: 6px; }
.site-header .nav-burger { display: none; }
@media (max-width: 900px) {
  .site-header .nav-burger { display: inline-flex; }
}
.btn-block { width: 100%; }
.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; color: var(--text); animation: spin 0.7s linear infinite;
}
.btn-primary.is-loading::after { color: var(--accent-text); }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------------------
   Forms
   -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.field .hint { font-size: var(--fs-xs); color: var(--text-dim); }
.field .error { font-size: var(--fs-xs); color: var(--danger); display: none; }
.field.has-error .error { display: block; }
.field.has-error .input, .field.has-error .textarea, .field.has-error .select { border-color: var(--danger); }
.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color var(--t), box-shadow var(--t), background var(--t);
}
html[data-theme="light"] .input, html[data-theme="light"] .textarea, html[data-theme="light"] .select { background: var(--surface); }
.input::placeholder, .textarea::placeholder { color: var(--text-dim); }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: var(--glow); }
.input:disabled, .textarea:disabled { opacity: 0.6; }
.textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.input-sm { padding: 6px 10px; font-size: var(--fs-sm); }
.input-group { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; width: 100%; }
.input-group .input { flex: 1 1 auto; min-width: 0; width: 0; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-dim); pointer-events: none; }
.input-icon .input { padding-left: 38px; }
.char-count { font-size: var(--fs-xs); color: var(--text-dim); text-align: right; }
.form-actions { display: flex; gap: var(--s-3); justify-content: flex-end; flex-wrap: wrap; margin-top: var(--s-2); }
.form-msg { font-size: var(--fs-sm); padding: 10px 12px; border-radius: var(--r-sm); display: none; }
.form-msg.show { display: block; }
.form-msg.error { background: var(--danger-soft); color: var(--danger); }
.form-msg.success { background: var(--success-soft); color: var(--success); }
.form-msg.info { background: var(--info-soft); color: var(--info); }

/* Switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s-2); cursor: pointer; font-size: var(--fs-sm); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 22px; border-radius: var(--r-full); background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background var(--t); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-muted); transition: transform var(--t), background var(--t); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); background: var(--accent-text); }
.switch input:focus-visible + .track { box-shadow: var(--glow); }

/* Color input */
.color-input { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 10px 4px 4px; border-radius: var(--r-full); border: 1px solid var(--border-strong); background: var(--bg-2); max-width: 100%; }
.color-input input[type="color"] { width: 28px; height: 28px; border: 0; padding: 0; background: transparent; border-radius: 50%; cursor: pointer; -webkit-appearance: none; appearance: none; }
.color-input input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.color-input input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.color-input input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }
.color-input .hex { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; }
.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2); transition: transform var(--t); }
.swatch:hover { transform: scale(1.12); }
.swatch.active { border-color: var(--text); }
input[type="range"].range { width: 100%; accent-color: var(--accent); }

/* --------------------------------------------------------------------------
   Cards & surfaces
   -------------------------------------------------------------------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-5); box-shadow: var(--shadow-sm); }
.card-hover { transition: transform var(--t), border-color var(--t), box-shadow var(--t); }
.card-hover:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow); }
.card-title { font-size: var(--fs-lg); margin-bottom: var(--s-4); display: flex; align-items: center; gap: var(--s-2); }
.card-title .icon { color: var(--accent); }
.card-sm { padding: var(--s-4); border-radius: var(--r); }
.panel { background: var(--surface-2); border-radius: var(--r); padding: var(--s-4); }

/* Post card */
.post-card { display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.post-card .cover { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--surface-2); }
.post-card .body { padding: var(--s-4) var(--s-5) var(--s-5); display: flex; flex-direction: column; gap: var(--s-3); flex: 1; }
.post-card .title { font-size: var(--fs-lg); margin: 0; line-height: 1.3; }
.post-card .title a { color: var(--text); }
.post-card .excerpt { color: var(--text-muted); font-size: var(--fs-sm); margin: 0; }
.post-card .meta { display: flex; align-items: center; gap: var(--s-3); font-size: var(--fs-xs); color: var(--text-dim); flex-wrap: wrap; }
.post-card .foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-top: auto; padding-top: var(--s-2); border-top: 1px solid var(--border); }
.post-card.horizontal { flex-direction: row; }
.post-card.horizontal .cover { width: 220px; aspect-ratio: 4 / 3; flex: none; }
@media (max-width: 640px) { .post-card.horizontal { flex-direction: column; } .post-card.horizontal .cover { width: 100%; aspect-ratio: 16 / 9; } }
.author-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-size: var(--fs-sm); font-weight: 500; text-decoration: none !important; }
.author-chip:hover .nick { text-decoration: underline; }
.stat-inline { display: inline-flex; align-items: center; gap: 4px; color: var(--text-dim); font-size: var(--fs-xs); }
.stat-inline .icon { width: 14px; height: 14px; }
.like-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--r-full); border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 600; transition: all var(--t); }
.like-btn:hover { border-color: var(--danger); color: var(--danger); }
.like-btn .icon { width: 15px; height: 15px; }
.like-btn.liked { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.like-btn.liked .icon { fill: currentColor; }
.like-btn.pop .icon { animation: pop 0.35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.4); } 100% { transform: scale(1); } }

/* Chips / badges */
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--r-full); font-size: var(--fs-xs); font-weight: 600; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); text-decoration: none !important; }
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chip-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip-success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.chip-info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.chip-sm { padding: 1px 8px; font-size: 11px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* Avatar */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-3); border: 1px solid var(--border); flex: none; }
.avatar-xs { width: 24px; height: 24px; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 112px; height: 112px; border-width: 3px; }
.avatar-fallback { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); background: var(--accent-soft); text-transform: uppercase; }
.verified { display: inline-flex; color: var(--info); vertical-align: middle; }
.verified .icon { width: 16px; height: 16px; fill: currentColor; stroke: var(--bg); }

/* Badges (placas) */
.badge-img { width: 28px; height: 28px; object-fit: contain; image-rendering: -webkit-optimize-contrast; }
.badge-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r); border: 1px solid var(--border); background: var(--surface-2); transition: border-color var(--t); }
.badge-item:hover { border-color: var(--border-strong); }
.badge-item .badge-img { width: 40px; height: 40px; }
.badge-item .name { font-weight: 600; font-size: var(--fs-sm); }
.badge-item .desc { font-size: var(--fs-xs); color: var(--text-muted); }
.badge-item.is-main { border-color: var(--accent); background: var(--accent-soft); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s-3); }
.badge-tip { position: relative; display: inline-flex; }

/* Stats */
.stat { display: flex; flex-direction: column; gap: 2px; padding: var(--s-4); border-radius: var(--r); background: var(--surface-2); }
.stat .val { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.stat .lbl { font-size: var(--fs-xs); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.stat .icon { color: var(--accent); }
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: var(--s-3); }

/* Tabs */
.tabs { display: flex; gap: var(--s-1); border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; border: 0; background: transparent; color: var(--text-muted); font-weight: 600; font-size: var(--fs-sm); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: color var(--t), border-color var(--t); }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab .count { font-size: 11px; background: var(--surface-2); padding: 0 6px; border-radius: var(--r-full); color: var(--text-dim); }
.tab-panel { min-width: 0; max-width: 100%; }

/* Segmented */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: var(--r-sm); border: 1px solid var(--border); max-width: 100%; flex-wrap: wrap; }
.segmented button { padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text-muted); font-size: var(--fs-xs); font-weight: 600; transition: all var(--t); }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Pagination */
.pagination { display: flex; gap: var(--s-1); justify-content: center; align-items: center; margin-top: var(--s-6); flex-wrap: wrap; }
.pagination button { min-width: 36px; height: 36px; padding: 0 10px; border-radius: var(--r-sm); border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); font-size: var(--fs-sm); font-weight: 600; }
.pagination button:hover:not(:disabled) { border-color: var(--border-strong); color: var(--text); }
.pagination button[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-color: transparent; }
.pagination button:disabled { opacity: 0.4; cursor: default; }

/* Empty state */
.empty { text-align: center; padding: var(--s-10) var(--s-5); color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.empty .icon { width: 40px; height: 40px; margin: 0 auto var(--s-3); color: var(--text-dim); }
.empty h3 { font-size: var(--fs-lg); color: var(--text); }
.empty p { margin: 0 0 var(--s-4); font-size: var(--fs-sm); }

/* Skeleton */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--r-sm); min-height: 14px; }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.skeleton-text { height: 12px; margin-bottom: 8px; }
.skeleton-title { height: 20px; width: 60%; margin-bottom: 12px; }
.skeleton-card { height: 260px; border-radius: var(--r-lg); }
.skeleton-avatar { width: 40px; height: 40px; border-radius: 50%; }

/* --------------------------------------------------------------------------
   Modal, toast, tooltip
   -------------------------------------------------------------------------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: calc(var(--s-5) + env(safe-area-inset-top, 0px)) calc(var(--s-5) + env(safe-area-inset-right, 0px)) calc(var(--s-5) + env(safe-area-inset-bottom, 0px)) calc(var(--s-5) + env(safe-area-inset-left, 0px)); opacity: 0; transition: opacity var(--t); backdrop-filter: blur(4px); }
.modal-backdrop.open { opacity: 1; }
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); transform: translateY(10px) scale(0.98); transition: transform var(--t); }
.modal-backdrop.open .modal { transform: none; }
.modal-lg { max-width: 760px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-5) 0; }
.modal-head h3 { margin: 0; font-size: var(--fs-lg); }
.modal-body { padding: var(--s-5); }
.modal-foot { display: flex; gap: var(--s-3); justify-content: flex-end; padding: 0 var(--s-5) var(--s-5); flex-wrap: wrap; }

.toasts { position: fixed; right: calc(var(--s-5) + env(safe-area-inset-right, 0px)); bottom: calc(var(--s-5) + env(safe-area-inset-bottom, 0px)); z-index: 200; display: flex; flex-direction: column; gap: var(--s-2); max-width: min(380px, calc(100% - 40px)); left: auto; }
.toast { display: flex; align-items: flex-start; gap: var(--s-3); padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: var(--fs-sm); animation: toast-in var(--t-slow) both; }
.toast .icon { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.toast.success .icon { color: var(--success); } .toast.error .icon { color: var(--danger); } .toast.info .icon { color: var(--info); } .toast.warn .icon { color: var(--warn); }
.toast.out { animation: toast-out var(--t) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(20px); } }

[data-tip] { position: relative; }
[data-tip]::after { content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%) translateY(4px); padding: 6px 10px; border-radius: var(--r-sm); background: var(--surface-3); color: var(--text); font-size: var(--fs-xs); white-space: nowrap; opacity: 0; pointer-events: none; transition: all var(--t); box-shadow: var(--shadow); z-index: 20; }
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translateX(-50%); }

/* --------------------------------------------------------------------------
   Prose (contenido de posts)
   -------------------------------------------------------------------------- */
.prose { font-size: 1.05rem; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.6em 0 0.6em; scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h1 { font-size: var(--fs-2xl); } .prose h2 { font-size: var(--fs-xl); } .prose h3 { font-size: var(--fs-lg); }
.prose p { margin: 0 0 1.1em; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.prose img { border-radius: var(--r); margin: 1.2em auto; max-height: 640px; object-fit: contain; }
.prose figure { margin: 1.2em 0; } .prose figcaption { text-align: center; font-size: var(--fs-sm); color: var(--text-muted); }
.prose blockquote { margin: 1.2em 0; padding: 0.6em 1.2em; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-muted); font-style: italic; }
.prose .code-block { position: relative; margin: 1.2em 0; }
.prose .code-block pre { margin: 0; padding-right: 4.5em; }
.prose .code-lang {
  position: absolute; top: 8px; right: 10px; z-index: 1;
  font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted); pointer-events: none;
}
.prose pre { margin: 1.2em 0; padding: 1em 1.2em; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); overflow: auto; font-size: 0.9em; line-height: 1.55; font-family: var(--font-mono); white-space: pre; tab-size: 2; }
.prose pre code { display: block; background: transparent; padding: 0; font-family: inherit; white-space: pre; tab-size: 2; overflow-wrap: normal; word-break: normal; }
.prose pre code.hljs { background: transparent; padding: 0; white-space: pre; }
.prose :not(pre) > code { display: inline; color: var(--accent); font-family: var(--font-mono); }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.prose li { margin: 0.3em 0; }
.prose hr { margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: var(--fs-sm); }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose iframe, .prose video { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: var(--r); margin: 1.2em 0; }
.prose .callout { padding: 12px 16px; border-radius: var(--r-sm); background: var(--info-soft); border-left: 3px solid var(--info); margin: 1.2em 0; }
.prose .callout-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.prose .callout-tip { background: var(--success-soft); border-left-color: var(--success); }
.prose mark { background: var(--accent-soft); color: var(--accent); padding: 0 3px; border-radius: 3px; }
.prose .spoiler { background: var(--text); color: transparent; border-radius: 3px; cursor: pointer; transition: all var(--t); }
.prose .spoiler:hover, .prose .spoiler.show { background: var(--surface-2); color: var(--text); }
.prose .kbd { font-family: var(--font-mono); font-size: 0.85em; border: 1px solid var(--border-strong); border-bottom-width: 2px; padding: 0 5px; border-radius: 4px; }

/* --------------------------------------------------------------------------
   Activity heatmap
   -------------------------------------------------------------------------- */
.heatmap { --cell: 12px; --gap: 3px; display: flex; gap: var(--s-2); font-size: 10px; color: var(--text-dim); overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; max-width: 100%; width: 100%; min-width: 0; }
.heatmap .weeks { flex: 0 0 auto; }
.heatmap .days { display: grid; grid-template-rows: repeat(7, var(--cell)); gap: var(--gap); margin-top: 16px; }
.heatmap .days span { height: var(--cell); line-height: var(--cell); }
.heatmap .weeks { display: grid; grid-auto-flow: column; grid-template-rows: 14px repeat(7, var(--cell)); gap: var(--gap); }
.heatmap .month { grid-row: 1; height: 14px; line-height: 14px; white-space: nowrap; }
.heatmap .cell { width: var(--cell); height: var(--cell); border-radius: 3px; background: var(--surface-2); border: 1px solid rgba(255,255,255,0.03); transition: transform var(--t); padding: 0; cursor: pointer; font: inherit; color: inherit; }
.heatmap .cell.on { outline: 2px solid var(--text); outline-offset: 1px; z-index: 2; }
.day-feed { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--border); }
.day-feed-title { margin: 0; }
.day-feed-list { display: flex; flex-direction: column; gap: 4px; margin-top: var(--s-3); }
.day-feed-item { display: flex; align-items: center; gap: var(--s-3); padding: 10px 8px; border-radius: var(--r-sm); text-decoration: none !important; color: inherit; }
.day-feed-item:hover { background: var(--surface-2); }
.day-feed-item .t { display: block; font-size: var(--fs-sm); line-height: 1.4; overflow-wrap: anywhere; }
.day-feed-item .when { display: block; font-size: var(--fs-xs); color: var(--text-dim); margin-top: 2px; }
.day-feed-item .icon { color: var(--text-dim); flex: none; }
.heatmap .cell:hover { transform: scale(1.25); outline: 1px solid var(--text-muted); z-index: 1; }
.heatmap .cell.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heatmap .cell.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heatmap .cell.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-2)); }
.heatmap .cell.l4 { background: var(--accent); }
.heatmap .cell.future { opacity: 0.25; }
.heat-tip {
  position: fixed; z-index: 120;
  padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--surface-3); color: var(--text);
  font-size: var(--fs-xs); line-height: 1.35;
  white-space: nowrap; max-width: min(320px, calc(100vw - 16px));
  overflow-wrap: anywhere; box-shadow: var(--shadow);
  pointer-events: none;
}
.heatmap-legend { display: flex; align-items: center; gap: 4px; font-size: var(--fs-xs); color: var(--text-dim); justify-content: flex-end; margin-top: var(--s-2); }
.heatmap-legend .cell { width: 11px; height: 11px; border-radius: 3px; background: var(--surface-2); }
.heatmap-legend .cell.l1 { background: color-mix(in srgb, var(--accent) 30%, var(--surface-2)); }
.heatmap-legend .cell.l2 { background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); }
.heatmap-legend .cell.l3 { background: color-mix(in srgb, var(--accent) 80%, var(--surface-2)); }
.heatmap-legend .cell.l4 { background: var(--accent); }

/* --------------------------------------------------------------------------
   Misc
   -------------------------------------------------------------------------- */
.divider-text { display: flex; align-items: center; gap: var(--s-3); color: var(--text-dim); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.08em; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.kbd-hint { font-size: var(--fs-xs); color: var(--text-dim); }
.fade-in { animation: fade-in var(--t-slow) both; }
@keyframes fade-in { from { opacity: 0; transform: translateY(6px); } }
.list-item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r); transition: background var(--t); }
.list-item:hover { background: var(--surface-2); }
.list-item .grow { min-width: 0; }
.list-item .name { font-weight: 600; font-size: var(--fs-sm); }
.list-item .sub { font-size: var(--fs-xs); color: var(--text-dim); }
.progress { height: 6px; border-radius: var(--r-full); background: var(--surface-2); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; transition: width var(--t-slow); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-dim); }
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.status-dot.warn { background: var(--warn); }
.status-dot.off { background: var(--danger); }
.hero-gradient-text { background: linear-gradient(90deg, var(--text), var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); font-weight: 600; }
.table tr:hover td { background: var(--surface-2); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

@media (max-width: 640px) {
  .heatmap { --cell: 10px; --gap: 2px; }
  .btn { min-height: 44px; }
  .btn-sm, .btn-icon, .btn-icon.btn-sm { min-height: 36px; }
  .tab { padding: 12px 14px; }
  .prose table { display: block; overflow-x: auto; }
  .stats-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1; min-height: 40px; }
}
