/* ============================================================================
   BHAI-LOK · Adaptive Editorial Glass — Universal Design System
   One stylesheet for every page and every element.
   Usage:  <link rel="stylesheet" href="assets/bhai-lok-system.css">
           <body data-theme="image-warm|image-dark|image-cool|noir|light">
   Icons:  <svg><use href="assets/bhai-lok-icons.svg#i-…"/></svg>
   Shell:  .app-bg, .app-atmosphere, .app-shell, .topbar, .sidebar, .main,
           .bottom-nav — identical on every page.
   Components are token-driven; switching data-theme reflows the whole UI.
   ========================================================================== */

/* ───────── 1. Shared tokens (non-color, every theme) ───────── */
:root{
  --font-display:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-body:'Inter',system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  --font-mono:'JetBrains Mono',ui-monospace,'SF Mono',Menlo,monospace;

  --fs-h1:32px; --fs-h2:20px; --fs-h3:15px;
  --fs-body:15px; --fs-meta:13px; --fs-mono:12px;

  --gap-xs:8px; --gap-sm:12px; --gap-md:16px; --gap-lg:24px; --gap-xl:32px;
  --radius:10px; --radius-lg:16px; --radius-pill:999px;

  --sidebar-w:256px; --rail-w:312px; --topbar-h:60px;

  /* z-index ladder (never use 9999 etc.) */
  --z-bg:0; --z-atmo:1; --z-shell:10; --z-sidebar:20; --z-topbar:30;
  --z-sticky:40; --z-dropdown:50; --z-popover:60; --z-drawer:70;
  --z-modal:80; --z-dialog:90; --z-critical:100;
}

/* ───────── 2. Theme: Image Warm (default) ───────── */
:root,[data-theme="image-warm"]{
  --bg:      oklch(0.16 0.012 60);
  --surface: oklch(0.21 0.004 250);
  --fg:      oklch(0.98 0 0);
  --muted:   color-mix(in oklch, var(--fg) 72%, transparent);
  --muted-2: color-mix(in oklch, var(--fg) 52%, transparent);
  --border:  color-mix(in oklch, var(--fg) 9%, transparent);
  --border-2:color-mix(in oklch, var(--fg) 16%, transparent);
  --accent:      oklch(0.72 0.14 55);              /* bright amber — text on dark */
  --accent-fill: oklch(0.48 0.16 50);              /* deep amber — fills w/ white text */
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --alert:       oklch(0.63 0.19 28);
  --on-primary: oklch(0.16 0.012 60);
  --glass-chrome:   color-mix(in oklch, var(--surface) 58%, transparent);
  --glass-surface:  color-mix(in oklch, var(--surface) 70%, transparent);
  --glass-elevated: color-mix(in oklch, var(--surface) 86%, transparent);
  --glass-solid:    color-mix(in oklch, var(--surface) 94%, transparent);
  --scrim-top: oklch(0.13 0.012 60 / 0.46);
  --scrim-mid: oklch(0.13 0.012 60 / 0.32);
  --scrim-bot: oklch(0.10 0.012 60 / 0.62);
  --theme-bg: url("../image-vela-gpt-image-2-mt5txpdn.png");
}

/* ───────── Theme: Image Dark ───────── */
[data-theme="image-dark"]{
  --accent:      oklch(0.78 0.08 240);              /* bright neutral — text on dark */
  --accent-fill: oklch(0.52 0.09 240);              /* deep neutral — fills */
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --on-primary: oklch(0.14 0.008 240);
  --scrim-top: oklch(0.08 0.008 250 / 0.46);
  --scrim-mid: oklch(0.08 0.008 250 / 0.32);
  --scrim-bot: oklch(0.05 0.008 250 / 0.62);
  --theme-bg: linear-gradient(160deg, oklch(0.14 0.006 250), oklch(0.07 0.005 250));
}

/* ───────── Theme: Image Cool ───────── */
[data-theme="image-cool"]{
  --accent:      oklch(0.80 0.10 200);              /* bright teal — text on dark */
  --accent-fill: oklch(0.52 0.11 200);              /* deep teal — fills */
  --accent-soft: color-mix(in oklch, var(--accent) 18%, transparent);
  --on-primary: oklch(0.14 0.02 220);
  --scrim-top: oklch(0.08 0.02 220 / 0.46);
  --scrim-mid: oklch(0.08 0.02 220 / 0.32);
  --scrim-bot: oklch(0.05 0.02 220 / 0.62);
  --theme-bg: linear-gradient(160deg, oklch(0.14 0.03 210), oklch(0.07 0.02 230));
}

/* ───────── Theme: Noir (no image, deep monochrome, layered) ───────── */
[data-theme="noir"]{
  --bg:      oklch(0.03 0.005 250);
  --surface: oklch(0.09 0.005 250);
  --fg:      oklch(0.96 0 0);
  --muted:   color-mix(in oklch, var(--fg) 70%, transparent);
  --muted-2: color-mix(in oklch, var(--fg) 50%, transparent);
  --border:  color-mix(in oklch, var(--fg) 8%, transparent);
  --border-2:color-mix(in oklch, var(--fg) 14%, transparent);
  --accent:      oklch(0.72 0.10 50);               /* muted warm — text on dark */
  --accent-fill: oklch(0.50 0.12 50);               /* deep warm — fills */
  --accent-soft: color-mix(in oklch, var(--accent) 16%, transparent);
  --alert:   oklch(0.60 0.19 28);
  --on-primary: oklch(0.05 0 0);
  --glass-chrome:   oklch(0.07 0.005 250);
  --glass-surface:  oklch(0.09 0.005 250);
  --glass-elevated: oklch(0.12 0.005 250);
  --glass-solid:    oklch(0.14 0.005 250);
  --theme-bg: none;
  --scrim-top: transparent; --scrim-mid: transparent;
  --scrim-bot: oklch(0 0 0 / 0.4);
}

/* ───────── Theme: Light (clean, no faked dark glass) ───────── */
[data-theme="light"]{
  --bg:      oklch(0.97 0.003 60);
  --surface: oklch(1 0 0);
  --fg:      oklch(0.18 0.01 250);
  --muted:   oklch(0.46 0.01 250);
  --muted-2: oklch(0.55 0.01 250);
  --border:  oklch(0.86 0.005 60);
  --border-2:oklch(0.78 0.006 60);
  --accent:      oklch(0.50 0.16 50);               /* deep warm — text on light */
  --accent-fill: oklch(0.44 0.17 50);               /* deeper warm — fills w/ white */
  --accent-soft: color-mix(in oklch, var(--accent) 14%, transparent);
  --alert:   oklch(0.50 0.18 28);
  --on-primary: oklch(0.99 0 0);
  --glass-chrome:   oklch(0.985 0.002 60 / 0.9);
  --glass-surface:  oklch(1 0 0);
  --glass-elevated: oklch(1 0 0);
  --glass-solid:    oklch(0.99 0.002 60);
  --theme-bg: none;
  --scrim-top: transparent; --scrim-mid: transparent; --scrim-bot: transparent;
}

/* ───────── 3. Reset & base ───────── */
*,*::before,*::after{ box-sizing:border-box; }
html{ -webkit-text-size-adjust:100%; }
body{
  margin:0; min-height:100vh; overflow-x:hidden;
  background:var(--bg); color:var(--fg);
  font-family:var(--font-body); font-size:var(--fs-body); line-height:1.55;
  text-rendering:optimizeLegibility; -webkit-font-smoothing:antialiased;
}
img,svg{ display:block; max-width:100%; }
a{ color:inherit; text-decoration:none; }
button{ font:inherit; color:inherit; background:none; border:0; cursor:pointer; }
input,textarea{ font:inherit; }
h1,h2,h3,h4{ margin:0; font-family:var(--font-display); text-wrap:balance; }
p{ margin:0; text-wrap:pretty; }
::selection{ background:var(--accent-soft); color:var(--fg); }

:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; border-radius:6px; }
@media (prefers-reduced-motion:reduce){ *{ animation:none!important; transition:none!important; } }

/* ───────── 4. Atmosphere (z0 bg + z1 scrim) ───────── */
.app-bg{
  position:fixed; inset:0; z-index:var(--z-bg);
  background:var(--theme-bg) center/cover no-repeat fixed;
}
.app-atmosphere{
  position:fixed; inset:0; z-index:var(--z-atmo); pointer-events:none;
  background:linear-gradient(180deg,var(--scrim-top) 0%,var(--scrim-mid) 42%,var(--scrim-bot) 100%);
  -webkit-backdrop-filter:blur(18px) saturate(115%);
  backdrop-filter:blur(18px) saturate(115%);
}
.app-atmosphere::after{
  content:""; position:absolute; inset:0;
  background:radial-gradient(120% 80% at 50% 0%, transparent 40%, oklch(0.06 0.01 60 / 0.32) 100%);
}
[data-theme="noir"] .app-bg, [data-theme="light"] .app-bg,
[data-theme="noir"] .app-atmosphere, [data-theme="light"] .app-atmosphere{ display:none; }

body:not(.session-ready) .nav-group[data-group="admin"],
body:not(.session-ready) .nav-group[data-group="superadmin"],
body:not(.can-admin) .nav-group[data-group="admin"],
body:not(.can-superadmin) .nav-group[data-group="superadmin"]{ display:none; }
body:not(.can-admin) .cmdk-item[data-access="admin"],
body:not(.can-superadmin) .cmdk-item[data-access="superadmin"]{ display:none; }
.live-boot .main{ visibility:hidden; }

/* ───────── 5. App shell + topbar (z10/z30, glass chrome) ───────── */
.app-shell{ position:relative; z-index:var(--z-shell); min-height:100vh; display:flex; flex-direction:column; }
.topbar{
  position:sticky; top:0; z-index:var(--z-topbar);
  background:var(--glass-chrome); border-bottom:1px solid var(--border);
  -webkit-backdrop-filter:blur(24px) saturate(130%); backdrop-filter:blur(24px) saturate(130%);
}
.topbar-inner{ height:var(--topbar-h); padding-inline:var(--gap-md); display:flex; align-items:center; gap:var(--gap-md); }
.brand{ display:flex; align-items:center; gap:10px; font-weight:700; letter-spacing:-0.02em; font-size:16px; white-space:nowrap; }
.brand-mark{
  width:28px; height:28px; border-radius:8px;
  background:var(--glass-elevated); border:1px solid var(--border-2);
  display:grid; place-items:center; font-family:var(--font-mono); font-weight:500; color:var(--fg);
}
.topbar-search{
  flex:1; max-width:440px; margin-inline:auto; display:flex; align-items:center; gap:10px;
  height:40px; padding-inline:12px; border-radius:var(--radius-pill);
  background:color-mix(in oklch, var(--surface) 50%, transparent);
  border:1px solid var(--border); color:var(--muted);
}
.topbar-search:focus-within{ border-color:var(--border-2); background:color-mix(in oklch, var(--surface) 64%, transparent); }
.topbar-search input{ flex:1; background:none; border:0; color:var(--fg); font-size:14px; min-width:0; }
.topbar-search input::placeholder{ color:var(--muted-2); }
.topbar-search input:focus{ outline:none; }
.kbd{ font-family:var(--font-mono); font-size:11px; padding:2px 7px; border:1px solid var(--border); border-radius:6px; color:var(--muted); }
.topbar-actions{ display:flex; align-items:center; gap:6px; }
.icon-btn{
  width:40px; height:40px; border-radius:10px; border:1px solid transparent;
  display:grid; place-items:center; color:var(--muted); position:relative;
  transition:background .15s, color .15s, border-color .15s;
}
.icon-btn:hover{ background:color-mix(in oklch, var(--fg) 6%, transparent); color:var(--fg); }
.icon-btn svg{ width:19px; height:19px; }
.dot-alert{
  position:absolute; top:9px; right:9px; width:8px; height:8px; border-radius:50%;
  background:var(--alert); border:2px solid color-mix(in oklch, var(--surface) 80%, transparent);
}
.account-chip{
  display:flex; align-items:center; gap:10px; padding:5px 10px 5px 5px;
  border-radius:var(--radius-pill); border:1px solid transparent; transition:background .15s, border-color .15s;
}
.account-chip:hover{ background:color-mix(in oklch, var(--fg) 6%, transparent); border-color:var(--border); }
.avatar{
  width:30px; height:30px; border-radius:50%; flex-shrink:0;
  background:var(--glass-elevated); border:1px solid var(--border-2);
  display:grid; place-items:center; font-family:var(--font-mono); font-size:11px; color:var(--fg);
}
.account-meta{ display:flex; flex-direction:column; line-height:1.25; }
.account-name{ font-size:13px; font-weight:600; }
.account-role{ font-size:11px; color:var(--muted-2); font-family:var(--font-mono); }
.menu-toggle, .search-icon-btn{ display:none; }

/* ───────── 6. Body grid: sidebar + main ───────── */
.app-body{ flex:1; display:grid; grid-template-columns:var(--sidebar-w) minmax(0,1fr); }

/* ───────── Sidebar (z20, glass chrome, enclosed rail) ───────── */
.sidebar{
  position:sticky; top:var(--topbar-h); align-self:start;
  height:calc(100vh - var(--topbar-h)); width:var(--sidebar-w);
  background:var(--glass-chrome); border-right:1px solid var(--border);
  -webkit-backdrop-filter:blur(24px) saturate(130%); backdrop-filter:blur(24px) saturate(130%);
  display:flex; flex-direction:column; overflow-y:auto; z-index:var(--z-sidebar);
}
.sidebar::-webkit-scrollbar{ width:8px; }
.sidebar::-webkit-scrollbar-thumb{ background:var(--border-2); border-radius:8px; }
.sidebar-nav{ flex:1; padding:var(--gap-md) var(--gap-sm); display:flex; flex-direction:column; gap:var(--gap-lg); }
.nav-group{ display:flex; flex-direction:column; gap:2px; }
.nav-group-label{ margin:0 0 4px 10px; font-family:var(--font-mono); font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted-2); }
.nav-item{
  display:flex; align-items:center; gap:11px; padding:8px 10px; border-radius:9px;
  font-size:14px; font-weight:450; color:var(--muted); position:relative;
  transition:background .14s, color .14s; min-height:38px;
}
.nav-item svg{ width:18px; height:18px; flex-shrink:0; opacity:.85; }
.nav-item:hover{ background:color-mix(in oklch, var(--fg) 5%, transparent); color:var(--fg); }
.nav-item:hover svg{ opacity:1; }
.nav-item.active{ color:var(--accent); background:var(--accent-soft); }
.nav-item.active svg{ opacity:1; }
.nav-item.active::before{ content:""; position:absolute; left:0; top:8px; bottom:8px; width:3px; border-radius:3px; background:var(--accent); }
.nav-item .dot-alert{ position:static; width:7px; height:7px; border:0; margin-left:auto; }
.nav-item .count{ margin-left:auto; font-family:var(--font-mono); font-size:11px; color:var(--muted); background:color-mix(in oklch, var(--fg) 8%, transparent); padding:1px 7px; border-radius:999px; }
.sidebar-foot{ padding:var(--gap-sm); border-top:1px solid var(--border); }
.sidebar-head-mobile{ display:none; align-items:center; justify-content:space-between; padding:14px 16px 6px; }
.sidebar-head-mobile .brand{ font-size:15px; }
.sidebar-scrim{ position:fixed; inset:0; z-index:var(--z-drawer); display:block; background:oklch(0.05 0.01 60 / 0.6); -webkit-backdrop-filter:blur(2px); backdrop-filter:blur(2px); border:0; }
.sidebar-scrim[hidden]{ display:none; }
.drawer-close{ display:none; }

/* ───────── Main content area (universal) ───────── */
.main{ position:relative; min-width:0; padding:var(--gap-lg) var(--gap-xl) calc(var(--gap-xl) + 72px); }

/* ───────── 7. Buttons ───────── */
.btn{
  display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:9px 18px; border-radius:10px; border:1px solid transparent;
  font-size:14px; font-weight:600; letter-spacing:0.01em; min-height:38px;
  transition:transform .05s, background .15s, border-color .15s, color .15s;
}
.btn:active{ transform:translateY(1px); }
.btn-primary{ background:color-mix(in oklch, var(--fg) 94%, transparent); color:var(--on-primary); border-color:var(--fg); }
.btn-primary:hover{ background:var(--fg); }
.btn-primary:disabled{ background:color-mix(in oklch, var(--fg) 14%, transparent); color:var(--muted-2); border-color:transparent; cursor:not-allowed; transform:none; }
.btn-secondary{ background:color-mix(in oklch, var(--fg) 7%, transparent); color:var(--fg); border-color:var(--border-2); }
.btn-secondary:hover{ background:color-mix(in oklch, var(--fg) 12%, transparent); }
.btn-ghost{ background:transparent; color:var(--muted); padding-inline:10px; }
.btn-ghost:hover{ color:var(--fg); background:color-mix(in oklch, var(--fg) 5%, transparent); }
.btn-danger{ background:var(--alert); color:oklch(0.99 0 0); border-color:var(--alert); }
.btn-danger:hover{ background:color-mix(in oklch, var(--alert) 88%, black); }
.btn-arrow::after{ content:"→"; transition:transform .15s; }
.btn-arrow:hover::after{ transform:translateX(2px); }

/* ───────── 8. Pills, tags, cards, forms, tables, utilities ───────── */
.pill{ display:inline-flex; align-items:center; gap:5px; padding:3px 9px; border-radius:var(--radius-pill); font-family:var(--font-mono); font-size:11px; letter-spacing:.02em; }
.pill svg{ width:13px; height:13px; }
.pill-accent{ background:var(--accent-fill); color:oklch(0.99 0 0); }
.pill-fg{ background:color-mix(in oklch, var(--fg) 9%, transparent); color:var(--fg); border:1px solid var(--border-2); }
.pill-muted{ background:var(--glass-elevated); color:var(--muted); border:1px solid var(--border); }
.tag{ display:inline-flex; align-items:center; padding:4px 10px; background:transparent; color:var(--muted); border:1px solid var(--border); border-radius:999px; font-size:12px; }

.card{ background:var(--glass-surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--gap-md); -webkit-backdrop-filter:blur(16px) saturate(120%); backdrop-filter:blur(16px) saturate(120%); }
.card-elevated{ background:var(--glass-elevated); -webkit-backdrop-filter:blur(22px) saturate(125%); backdrop-filter:blur(22px) saturate(125%); }

.field{ display:flex; flex-direction:column; gap:6px; }
.field label{ font-size:13px; color:var(--muted); }
.input, .textarea{ width:100%; padding:11px 14px; border:1px solid var(--border); border-radius:var(--radius); background:var(--glass-elevated); color:var(--fg); font-size:15px; }
.input::placeholder, .textarea::placeholder{ color:var(--muted-2); }
.input:focus, .textarea:focus{ outline:2px solid var(--accent-soft); border-color:var(--accent); }
.textarea{ min-height:96px; resize:vertical; line-height:1.55; }

.ds-table{ width:100%; border-collapse:collapse; font-size:14px; }
.ds-table th, .ds-table td{ padding:12px 14px; text-align:left; border-bottom:1px solid var(--border); }
.ds-table th{ color:var(--muted); font-weight:500; font-family:var(--font-mono); font-size:12px; letter-spacing:.04em; text-transform:uppercase; }
.ds-table tbody tr:hover{ background:color-mix(in oklch, var(--fg) 5%, transparent); }
.ds-table .num-col{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; text-align:right; }

.rule{ border:0; border-top:1px solid var(--border); margin:0; }
.rule-strong{ border:0; border-top:1px solid var(--border-2); margin:0; }
.stack{ display:flex; flex-direction:column; }
.stack > * + *{ margin-top:var(--gap-md); }
.row{ display:flex; align-items:center; gap:var(--gap-md); }
.row-between{ display:flex; align-items:center; justify-content:space-between; gap:var(--gap-md); }
.meta{ font-family:var(--font-mono); font-size:var(--fs-meta); color:var(--muted); }
.num{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; }

/* ───────── 9. Content components: post + reactions + replies ───────── */
.post{
  background:var(--glass-surface); border:1px solid var(--border); border-radius:var(--radius-lg);
  padding:var(--gap-md); -webkit-backdrop-filter:blur(16px) saturate(120%); backdrop-filter:blur(16px) saturate(120%);
  transition:border-color .15s;
}
.post:hover{ border-color:var(--border-2); }
.post-pinned{ border-color:var(--border-2); }
.post-head{ display:flex; align-items:center; gap:10px; margin-bottom:8px; flex-wrap:wrap; }
.post-tag{ font-family:var(--font-mono); font-size:11px; letter-spacing:.06em; text-transform:uppercase; color:var(--muted); padding:3px 8px; border:1px solid var(--border); border-radius:6px; }
.post-meta{ font-family:var(--font-mono); font-size:12px; color:var(--muted-2); }
.post-meta strong{ color:var(--muted); font-weight:600; }
.post-more{ margin-left:auto; }
.post-title{ font-size:var(--fs-h2); font-weight:600; line-height:1.3; letter-spacing:-0.01em; margin:2px 0 6px; }
.post-body{ color:var(--muted); font-size:14.5px; line-height:1.6; }
.post-body strong{ color:var(--fg); font-weight:600; }
.post-foot{ display:flex; align-items:center; gap:4px; margin-top:12px; padding-top:12px; border-top:1px solid var(--border); flex-wrap:wrap; }
.react-btn{ display:inline-flex; align-items:center; gap:7px; padding:6px 11px; border-radius:9px; font-size:13px; color:var(--muted); transition:background .14s, color .14s; min-height:34px; }
.react-btn svg{ width:16px; height:16px; }
.react-btn:hover{ background:color-mix(in oklch, var(--fg) 6%, transparent); color:var(--fg); }
.react-btn.active{ color:var(--fg); font-weight:600; }
.react-btn.active .react-count{ color:var(--fg); }
.react-count{ font-family:var(--font-mono); font-variant-numeric:tabular-nums; }
.react-spacer{ margin-left:auto; }

.replies{ margin:8px 0 4px; padding:10px 0 2px; border-top:1px solid var(--border); display:flex; flex-direction:column; gap:8px; }
.reply{ display:flex; gap:10px; align-items:flex-start; }
.reply .avatar{ width:26px; height:26px; font-size:10px; }
.reply-body{ font-size:14px; line-height:1.5; color:var(--muted); }
.reply-body strong{ color:var(--fg); font-weight:600; }
.reply-meta{ font-family:var(--font-mono); font-size:11px; color:var(--muted-2); margin-top:2px; }

/* ─── post media (honest pending card) + source card + song row ─── */
.post-media{ margin:10px 0 4px; }
.media-pending{ border:1px dashed var(--border-2); border-radius:12px; padding:var(--gap-lg); background:color-mix(in oklch, var(--surface) 50%, transparent); display:flex; flex-direction:column; gap:10px; }
.media-pending-row{ display:flex; align-items:center; gap:12px; }
.media-pending .media-icon{ width:42px; height:42px; border-radius:10px; border:1px solid var(--border-2); background:var(--glass-elevated); display:grid; place-items:center; color:var(--muted); flex-shrink:0; }
.media-pending .media-icon svg{ width:20px; height:20px; }
.media-label{ font-family:var(--font-mono); font-size:13px; color:var(--fg); }
.media-sub{ font-family:var(--font-mono); font-size:12px; color:var(--muted-2); }

.source-card{ margin:10px 0 4px; display:flex; align-items:center; gap:12px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:color-mix(in oklch, var(--surface) 50%, transparent); transition:border-color .14s, background .14s; text-decoration:none; }
.source-card:hover{ border-color:var(--border-2); background:color-mix(in oklch, var(--surface) 62%, transparent); }
.source-card .src-icon{ width:36px; height:36px; border-radius:8px; background:var(--glass-elevated); border:1px solid var(--border-2); display:grid; place-items:center; color:var(--muted); flex-shrink:0; }
.source-card .src-icon svg{ width:17px; height:17px; }
.source-card .src-body{ min-width:0; flex:1; }
.source-title{ font-size:14px; font-weight:500; color:var(--fg); }
.source-url{ display:block; font-family:var(--font-mono); font-size:12px; color:var(--muted-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.source-card .src-arrow{ color:var(--muted); }
.source-card .src-arrow svg{ width:16px; height:16px; }

.play-row{ margin:10px 0 4px; display:flex; align-items:center; gap:14px; padding:12px 14px; border:1px solid var(--border); border-radius:12px; background:color-mix(in oklch, var(--surface) 56%, transparent); }
.play-btn{ width:42px; height:42px; border-radius:50%; background:color-mix(in oklch, var(--fg) 92%, transparent); color:var(--on-primary); display:grid; place-items:center; flex-shrink:0; transition:background .14s; }
.play-btn:hover{ background:var(--fg); }
.play-btn svg{ width:18px; height:18px; margin-left:2px; }
.play-meta{ min-width:0; flex:1; }
.play-title{ font-size:14px; font-weight:600; color:var(--fg); }
.play-sub{ display:block; font-family:var(--font-mono); font-size:12px; color:var(--muted-2); }
.play-track{ flex:1.4; height:4px; border-radius:4px; background:color-mix(in oklch, var(--fg) 10%, transparent); overflow:hidden; }
.play-fill{ display:block; width:31%; height:100%; background:var(--fg); border-radius:4px; }
.play-time{ font-family:var(--font-mono); font-size:12px; color:var(--muted-2); }

/* ───────── 10. Composer ───────── */
.composer{ background:var(--glass-elevated); border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--gap-md); -webkit-backdrop-filter:blur(22px) saturate(125%); backdrop-filter:blur(22px) saturate(125%); }
.composer-row{ display:flex; gap:var(--gap-sm); align-items:flex-start; }
.composer textarea{ flex:1; resize:none; min-height:48px; max-height:200px; background:none; border:0; color:var(--fg); font-size:15px; line-height:1.5; padding:7px 0; }
.composer textarea::placeholder{ color:var(--muted-2); }
.composer textarea:focus{ outline:none; }
.composer-foot{ display:flex; align-items:center; justify-content:space-between; gap:var(--gap-md); margin-top:var(--gap-sm); padding-top:var(--gap-sm); border-top:1px solid var(--border); }
.composer-tools{ display:flex; align-items:center; gap:2px; }
.composer-tools .icon-btn{ width:36px; height:36px; }
.composer-tools .icon-btn svg{ width:17px; height:17px; }
.composer-right{ display:flex; align-items:center; gap:var(--gap-sm); margin-left:auto; }
.feed-empty{ text-align:center; padding:var(--gap-xl) var(--gap-md); border:1px dashed var(--border-2); border-radius:var(--radius-lg); color:var(--muted); }
.feed-empty .feed-empty-title{ font-size:15px; font-weight:600; color:var(--fg); margin-bottom:4px; }
.feed-empty .feed-empty-sub{ font-size:13px; color:var(--muted-2); }
.verified-toggle{ display:inline-flex; align-items:center; gap:6px; margin-left:6px; padding:5px 11px; border-radius:var(--radius-pill); border:1px solid var(--border); font-size:12px; color:var(--muted-2); font-family:var(--font-mono); transition:all .14s; }
.verified-toggle:hover{ color:var(--fg); border-color:var(--border-2); }
.verified-toggle.active{ color:var(--fg); background:color-mix(in oklch, var(--fg) 9%, transparent); border-color:var(--border-2); }
.verified-toggle svg{ width:14px; height:14px; }
.char-count{ font-family:var(--font-mono); font-size:12px; color:var(--muted-2); }
.char-count.over{ color:var(--alert); }

/* ───────── 11. Right rail (reusable on feed/discovery/profile) ───────── */
.rail{ display:flex; flex-direction:column; gap:var(--gap-md); position:sticky; top:calc(var(--topbar-h) + var(--gap-lg)); align-self:start; }
.rail-card{ background:var(--glass-surface); border:1px solid var(--border); border-radius:var(--radius-lg); padding:var(--gap-md); -webkit-backdrop-filter:blur(16px) saturate(120%); backdrop-filter:blur(16px) saturate(120%); }
.rail-card h3{ font-size:13px; font-weight:600; letter-spacing:0.01em; margin-bottom:10px; color:var(--fg); display:flex; align-items:center; gap:8px; }
.rail-card h3 svg{ width:15px; height:15px; color:var(--muted); }
.rail-about p{ font-size:13px; color:var(--muted); line-height:1.55; }
.rail-about .link-arrow{ margin-top:10px; display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--fg); font-weight:500; }
.rail-about .link-arrow svg{ width:15px; height:15px; transition:transform .15s; }
.rail-about .link-arrow:hover svg{ transform:translateX(2px); }
.trend-list, .contrib-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:2px; }
.trend-item{ display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:8px; transition:background .14s; }
.trend-item:hover{ background:color-mix(in oklch, var(--fg) 5%, transparent); }
.trend-item a{ display:flex; align-items:center; gap:10px; width:100%; }
.trend-tag{ font-family:var(--font-mono); font-size:13px; color:var(--fg); }
.trend-sub{ font-size:12px; color:var(--muted-2); }
.trend-meta{ margin-left:auto; font-family:var(--font-mono); font-size:11px; color:var(--muted-2); }
.contrib-item{ display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:8px; }
.contrib-item .avatar{ width:34px; height:34px; font-size:12px; }
.contrib-meta{ min-width:0; flex:1; }
.contrib-name{ font-size:13px; font-weight:500; color:var(--fg); display:flex; align-items:center; gap:5px; }
.contrib-name svg{ width:13px; height:13px; color:var(--muted); }
.contrib-role{ font-family:var(--font-mono); font-size:11px; color:var(--muted-2); }
.follow-btn{ padding:5px 11px; border-radius:8px; border:1px solid var(--border-2); font-size:12px; font-weight:600; color:var(--fg); transition:all .14s; }
.follow-btn:hover{ background:color-mix(in oklch, var(--fg) 7%, transparent); }
.follow-btn.following{ color:var(--muted); border-color:var(--border); }
.rail-foot p{ font-size:11px; color:var(--muted-2); font-family:var(--font-mono); margin-bottom:8px; }
.foot-links{ display:flex; flex-wrap:wrap; gap:10px 14px; font-size:12px; }
.foot-links a{ color:var(--muted); }
.foot-links a:hover{ color:var(--fg); }

/* ───────── 12. Bottom nav (mobile) ───────── */
.bottom-nav{ display:none; }

/* ───────── 13. Responsive ───────── */
@media (max-width:1079px){
  :root{ --sidebar-w:72px; }
  .nav-item{ justify-content:center; padding:10px 0; }
  .nav-item .label, .nav-group-label, .nav-item .count, .nav-item .dot-alert.nav-dot{ display:none; }
  .nav-item.active::before{ top:6px; bottom:6px; }
  .sidebar-foot .account-meta{ display:none; }
  .sidebar-foot .account{ padding:6px; justify-content:center; }
}
@media (max-width:860px){
  .topbar-search{ display:none; }
}
@media (max-width:767px){
  :root{ --topbar-h:56px; }
  .topbar-inner{ padding-inline:var(--gap-sm); gap:10px; }
  .menu-toggle{ display:grid; }
  .search-icon-btn{ display:grid; }
  .account-meta{ display:none; }
  .account-chip{ padding:0; }
  .app-body{ grid-template-columns:1fr; }
  .main{ padding:var(--gap-md) var(--gap-sm) calc(var(--gap-xl) + 84px); }
  .sidebar{
    position:fixed; top:0; left:0; bottom:0; height:100vh; width:284px; z-index:var(--z-drawer);
    transform:translateX(-100%); transition:transform .26s ease; border-right:1px solid var(--border-2);
  }
  .sidebar.open{ transform:translateX(0); }
  .nav-item{ justify-content:flex-start; padding:10px 12px; }
  .nav-item .label{ display:inline; }
  .nav-group-label{ display:block; }
  .nav-item .count{ display:inline-flex; }
  .nav-item .dot-alert.nav-dot{ display:inline-block; position:static; }
  .sidebar-foot .account-meta{ display:flex; }
  .sidebar-foot .account{ padding:7px 10px 7px 7px; justify-content:flex-start; }
  .sidebar-head-mobile{ display:flex; }
  .drawer-close{ display:grid; }
  .bottom-nav{
    display:flex; position:fixed; bottom:0; left:0; right:0; z-index:var(--z-sticky);
    height:64px; padding-bottom:env(safe-area-inset-bottom);
    background:var(--glass-chrome); border-top:1px solid var(--border);
    -webkit-backdrop-filter:blur(24px) saturate(130%); backdrop-filter:blur(24px) saturate(130%);
  }
  .bottom-nav a{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; color:var(--muted); font-size:10px; font-family:var(--font-mono); min-height:44px; }
  .bottom-nav a svg{ width:22px; height:22px; }
  .bottom-nav a.active{ color:var(--fg); }
  .bottom-nav .compose-fab{ width:44px; height:44px; border-radius:50%; background:color-mix(in oklch, var(--fg) 94%, transparent); color:var(--on-primary); display:grid; place-items:center; margin-top:-14px; border:3px solid var(--bg); }
  .bottom-nav .compose-fab svg{ width:22px; height:22px; }
  /* touch targets ≥44px + collapsed composer on mobile */
  .icon-btn{ width:44px; height:44px; border-radius:12px; }
  .composer-tools .icon-btn{ width:44px; height:44px; }
  .nav-item{ min-height:44px; }
  .tab{ min-height:44px; padding-block:11px; }
  .react-btn{ min-height:44px; }
  .btn{ min-height:44px; }
  .composer{ padding:10px 14px; }
  .composer:not(.composer-focused) .composer-foot{ display:none; }
  .composer:not(.composer-focused) .composer-row textarea{ min-height:24px; max-height:24px; }
  .composer:not(.composer-focused){ padding:8px 14px; }
}
@media (max-width:430px){
  .post-title{ font-size:18px; }
  .post{ padding:14px; }
  .post-foot .react-spacer{ display:none; }
  .play-track{ display:none; }
}
