/* Mesh: Instagram-style sidebar, accounts, pages and admin portal. Loaded after app.css, so these rules win. */
.hm-app { --hm-line: rgba(255,255,255,.12); --hm-mute: #8fa0b8; --hm-card: rgba(255,255,255,.05); --hm-ink: #fff; --hm-glass: rgba(255,255,255,.07); }
.hm-app .hv-rail, .hm-app .hv-tabbar { display: none !important; }
.hm-rail { display: none; }
.hm-tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; background: rgba(5,10,20,.96); border-top: 1px solid var(--hm-line); padding: 6px 0 max(8px, env(safe-area-inset-bottom)); backdrop-filter: blur(12px); }
.hm-tabs a { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 48px; color: #cfd8e6; text-decoration: none; }
.hm-tabs a.on { color: #fff; }
.hm-badge { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box; border-radius: 9px; background: #ff3040; color: #fff; font: 700 11px/18px "Sora", system-ui, sans-serif; font-style: normal; text-align: center; }
.hm-badge[hidden] { display: none; }
.hm-topm .hm-tl { position: relative; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: #fff; cursor: pointer; text-decoration: none; }
.hm-topm .hm-tl .hm-badge { top: 4px; left: 24px; }
.hm-app .hv-body { padding-bottom: 96px; }

/* avatars */
.hm-av { --a: #00D9FF; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; flex: none; background: var(--a); color: #021018; font-weight: 800; font-size: 1.05rem; }
.hm-av.h1 { --a: #FF0A7A; color: #fff; } .hm-av.h2 { --a: #ffb703; } .hm-av.h3 { --a: #8ecae6; } .hm-av.h4 { --a: #b388ff; } .hm-av.h5 { --a: #5eead4; }
.hm-av.xs { width: 26px; height: 26px; font-size: .75rem; } .hm-av.sm { width: 34px; height: 34px; font-size: .9rem; } .hm-av.xl { width: 92px; height: 92px; font-size: 2.2rem; }

/* desktop sidebar */
@media (min-width: 760px) {
  .hm-app .hm-topm, .hm-tabs { display: none; }
  .hm-rail { display: flex; flex-direction: column; gap: 4px; width: 76px; flex: none; position: sticky; top: 0; height: 100vh; box-sizing: border-box; padding: 18px 12px 20px; border-right: 1px solid var(--hm-line); z-index: 30; }
  .hm-logo { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 12px; text-decoration: none; margin-bottom: 14px; }
  .hm-logo b { display: none; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
  .hm-nav { display: flex; flex-direction: column; gap: 2px; }
  .hm-nl { position: relative; display: flex; align-items: center; gap: 16px; min-height: 52px; padding: 0 12px; border-radius: 12px; color: #e9eef6; text-decoration: none; background: none; border: 0; font: inherit; font-size: 1rem; cursor: pointer; width: 100%; box-sizing: border-box; }
  .hm-nl:hover { background: var(--hm-glass); } .hm-nl.on { font-weight: 800; }
  .hm-nl .hm-nt { display: none; white-space: nowrap; }
  .hm-nl .hm-badge { top: 8px; left: 30px; }
  .hm-more-w { margin-top: auto; position: relative; }
  .hm-app .hv-body { padding-bottom: 60px; }
}
@media (min-width: 1160px) {
  .hm-rail { width: 244px; padding: 18px 14px 20px; }
  .hm-logo b, .hm-nl .hm-nt { display: inline; }
  .hm-nl .hm-badge { position: static; margin-left: auto; }
}

/* More menu */
.hm-menu-w { position: fixed; inset: 0; z-index: 90; pointer-events: none; }
.hm-menu-w:empty { display: none; }
.hm-menu-bg { position: absolute; inset: 0; pointer-events: auto; }
.hm-menu { pointer-events: auto; position: absolute; left: 12px; bottom: 72px; width: min(300px, calc(100vw - 24px)); background: #262a31; color: #fff; border-radius: 18px; padding: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
@media (min-width: 760px) { .hm-menu { left: 12px; bottom: 76px; } }
@media (max-width: 759px) { .hm-menu { left: auto; right: 12px; top: 56px; bottom: auto; } }
.hm-mi { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 50px; padding: 0 12px; box-sizing: border-box; border-radius: 10px; color: #fff; background: none; border: 0; font: inherit; font-size: .98rem; text-decoration: none; cursor: pointer; text-align: left; }
.hm-mi:hover { background: rgba(255,255,255,.07); } .hm-mi.plain { min-height: 46px; } .hm-mi.dim { color: #8fa0b8; }
.hm-sep { display: block; height: 6px; margin: 6px -8px; background: rgba(0,0,0,.28); } .hm-sep.thin { height: 1px; margin: 4px 0; background: rgba(255,255,255,.12); }

/* generic pages */
.hm-wrap { max-width: 640px; margin: 0 auto; width: 100%; padding-top: 18px; display: flex; flex-direction: column; gap: 14px; } .hm-wrap.wide { max-width: 920px; }
.mx-h { margin: 0; font-size: 1.5rem; font-weight: 800; } .hm-h3 { margin: 14px 0 0; font-size: 1.02rem; font-weight: 700; } .mx-sub { margin: 0; color: var(--hm-mute); font-size: .92rem; }
.hm-gate { max-width: 420px; margin: 12vh auto 0; text-align: center; display: flex; flex-direction: column; gap: 18px; }
.hm-search, .hm-form input, .hm-form textarea, .hm-send input { width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--hm-line); background: var(--hm-glass); color: inherit; font: inherit; }
.hm-form textarea { padding: 12px 16px; resize: vertical; } .hm-form input:disabled { opacity: .55; }
.hm-form { display: flex; flex-direction: column; gap: 12px; } .hm-form.card { padding: 18px; border: 1px solid var(--hm-line); border-radius: 16px; background: var(--hm-card); }
.hm-form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; color: var(--hm-mute); }
.hm-form .err, .hm-form p.err { color: #ff6b81; margin: 0; min-height: 1em; font-size: .88rem; }
.mx-row { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-radius: 12px; text-decoration: none; color: inherit; } .mx-row:hover { background: var(--hm-glass); }
.mx-row b { display: block; font-weight: 700; } .mx-row small { display: block; color: var(--hm-mute); margin-top: 2px; font-size: .82rem; } .mx-row em { font-style: normal; color: var(--hm-mute); }
.mx-row.unread { background: rgba(0,217,255,.07); } .mx-row.done { opacity: .5; } .hm-grow { flex: 1; min-width: 0; } .hm-grow b { overflow-wrap: anywhere; }
.hm-ic { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--hm-line); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.hm-th { width: 64px; height: 84px; border-radius: 10px; overflow: hidden; flex: none; background: #000; display: block; position: relative; } .hm-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hv-c); margin-left: auto; }
.hm-pill { display: inline-block; font-size: .68rem; padding: 2px 8px; border-radius: 8px; background: var(--hv-c); color: #021018; font-weight: 700; vertical-align: middle; } .hm-pill.bad { background: #ff3040; color: #fff; }
.hv-tag.against { background: var(--hv-c); color: #021018; }

/* log in */
.hm-auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.hm-card { width: 100%; max-width: 380px; padding: 28px 24px; border: 1px solid var(--hm-line); border-radius: 22px; background: var(--hm-card); display: flex; flex-direction: column; gap: 14px; }
.hm-alt { margin: 0; text-align: center; color: var(--hm-mute); font-size: .92rem; } .hm-lnk { background: none; border: 0; color: var(--hv-c); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }
.hm-known { display: flex; flex-wrap: wrap; gap: 8px; } .hm-chipu { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--hm-line); background: var(--hm-glass); color: inherit; font: inherit; cursor: pointer; }
.hm-auth ~ .hm-tabs, .hm-app:has(.hm-auth) .hm-rail, .hm-app:has(.hm-auth) .hm-tabs { display: none; }

/* profile */
.hm-prof { max-width: 760px; margin: 0 auto; padding-top: 24px; } .hm-ph { display: flex; gap: 28px; align-items: flex-start; padding-bottom: 22px; border-bottom: 1px solid var(--hm-line); margin-bottom: 4px; }
.hm-pi { display: flex; flex-direction: column; gap: 12px; min-width: 0; } .hm-pn { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; } .hm-pn h1 { margin: 0 6px 0 0; font-size: 1.25rem; font-weight: 700; }
.hm-ps { display: flex; gap: 22px; flex-wrap: wrap; } .hm-pd { margin: 0; line-height: 1.45; overflow-wrap: anywhere; }
@media (max-width: 520px) { .hm-ph { gap: 16px; } .hm-av.xl { width: 72px; height: 72px; font-size: 1.8rem; } }
.hm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin-top: 4px; }
.hm-gi { position: relative; aspect-ratio: 3 / 4; background: #000; overflow: hidden; display: block; } .hm-gi img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-gi .hv-tag { position: absolute; left: 6px; top: 6px; } .hm-gv { position: absolute; left: 6px; bottom: 6px; display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; text-shadow: 0 1px 4px #000; }

/* messages */
.hm-chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 640px; margin: 0 auto; width: 100%; }
.hm-chath { display: flex; align-items: center; gap: 6px; padding: 10px 8px; border-bottom: 1px solid var(--hm-line); } .hm-chath .hm-tl { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: inherit; }
.hm-who { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.hm-msgs { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 6px; }
.hm-m { max-width: 78%; padding: 9px 14px; border-radius: 18px; line-height: 1.35; overflow-wrap: anywhere; white-space: pre-wrap; } .hm-m.me { align-self: flex-end; background: #3b5bfd; color: #fff; } .hm-m.them { align-self: flex-start; background: rgba(255,255,255,.1); }
.hm-send { display: flex; gap: 8px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); border-top: 1px solid var(--hm-line); }
@media (max-width: 759px) { .hm-app:has(.hm-chat) .hm-tabs { display: none; } }

/* dashboard + admin */
.hm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.hm-tile { padding: 16px; border: 1px solid var(--hm-line); border-radius: 16px; background: var(--hm-card); display: flex; flex-direction: column; gap: 4px; } .hm-tile b { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; } .hm-tile span { color: var(--hm-mute); font-size: .85rem; }
.hm-bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 8px 4px 0; border-bottom: 1px solid var(--hm-line); }
.hm-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; } .hm-bar i { display: block; width: 100%; border-radius: 6px 6px 0 0; background: var(--hv-c); } .hm-bar small { color: var(--hm-mute); font-size: .68rem; margin-bottom: -18px; }
.hm-bars { margin-bottom: 22px; }
.hm-table { display: flex; flex-direction: column; }
.hm-nums { display: flex; gap: 14px; margin-left: auto; text-align: center; } .hm-nums span { display: flex; flex-direction: column; min-width: 44px; } .hm-nums b { font-size: 1rem; } .hm-nums small { margin: 0; }
@media (max-width: 640px) { .hm-nums { display: none; } }
.hm-tabsb { display: flex; gap: 6px; flex-wrap: wrap; } .hm-tabsb button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--hm-line); background: none; color: inherit; font: inherit; cursor: pointer; } .hm-tabsb button.on { background: var(--hv-c); color: #021018; border-color: transparent; font-weight: 700; }
.hm-sched { flex-direction: column; gap: 8px; } .hm-sched span { display: flex; align-items: center; gap: 8px; color: inherit; }
.hm-savebtn.on { color: var(--hv-c); }
.hv-btn.glass { background: var(--hm-glass); border: 1px solid var(--hm-line); color: inherit; }

/* reels */
.hm-app:has(.hm-reels) .hv-body { padding: 0; max-width: none; }
.hm-reels { height: 100vh; height: 100dvh; max-width: 480px; margin: 0 auto; overflow-y: scroll; scroll-snap-type: y mandatory; scrollbar-width: none; background: #000; }
.hm-reels::-webkit-scrollbar { display: none; }
.hm-reel { position: relative; height: 100vh; height: 100dvh; scroll-snap-align: start; scroll-snap-stop: always; background: #000; overflow: hidden; }
.hm-reel video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hm-reel .hv-tag { position: absolute; left: 14px; top: 16px; z-index: 2; font-size: .75rem; padding: 5px 11px; }
.hm-rcap { position: absolute; left: 0; right: 70px; bottom: 0; padding: 60px 16px max(78px, calc(env(safe-area-inset-bottom) + 68px)); background: linear-gradient(transparent, rgba(0,0,0,.78)); display: flex; flex-direction: column; gap: 4px; color: #fff; }
@media (min-width: 760px) { .hm-rcap { padding-bottom: 30px; } }
.hm-rq { font-size: .78rem; color: #cfd8e6; text-decoration: none; } .hm-rcap b { font-size: 1.05rem; line-height: 1.3; } .hm-rby { font-size: .85rem; color: #fff; text-decoration: none; opacity: .85; }
.hm-ract { position: absolute; right: 8px; bottom: max(110px, calc(env(safe-area-inset-bottom) + 100px)); display: flex; flex-direction: column; gap: 16px; z-index: 3; }
@media (min-width: 760px) { .hm-ract { bottom: 60px; } }
.hm-ract button, .hm-sound { background: rgba(0,0,0,.35); border: 0; color: #fff; width: 52px; min-height: 52px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer; font: inherit; } .hm-ract button.on { color: var(--hv-c); } .hm-ract small { font-size: .72rem; }
.hm-sound { position: absolute; right: 8px; top: 12px; width: 40px; min-height: 40px; border-radius: 20px; z-index: 3; }

/* light mode (Switch appearance) */
body.mesh-light .hm-app, body.mesh-light .hv-app { --hv-bg: #ffffff; --hv-card: #f3f4f6; --hv-line: rgba(0,0,0,.12); --hv-mute: #5b6676; --hm-line: rgba(0,0,0,.12); --hm-mute: #5b6676; --hm-card: #f6f7f9; --hm-glass: rgba(0,0,0,.05); background: #fff; color: #0f1419; }
body.mesh-light .hv-app:has(.hv-home) { background: #fff; }
body.mesh-light .hm-tabs { background: rgba(255,255,255,.97); } body.mesh-light .hm-tabs a, body.mesh-light .hm-nl, body.mesh-light .hm-topm .hm-tl { color: #0f1419; }
body.mesh-light .hv-stick { background: rgba(255,255,255,.88); border-bottom-color: rgba(0,0,0,.1); } body.mesh-light .hv-cats button { color: #5b6676; } body.mesh-light .hv-cats button.on { color: #0f1419; }
body.mesh-light .hv-gc { border-bottom-color: rgba(0,0,0,.1); } body.mesh-light .hv-home { border-color: rgba(0,0,0,.1); }
body.mesh-light .hm-m.them { background: rgba(0,0,0,.07); } body.mesh-light .hm-menu { background: #fff; color: #0f1419; box-shadow: 0 10px 40px rgba(0,0,0,.25); } body.mesh-light .hm-mi { color: #0f1419; } body.mesh-light .hm-mi:hover { background: rgba(0,0,0,.05); } body.mesh-light .hm-sep { background: rgba(0,0,0,.06); }
body.mesh-light .hv-btn.glass, body.mesh-light .hv-search, body.mesh-light .hv-title, body.mesh-light .hv-body, body.mesh-light .hv-meta { color: #0f1419; }
body.mesh-light .hv-sheet { background: #fff; color: #0f1419; }

.hm-bell { position: relative; width: 44px; height: 44px; display: none; align-items: center; justify-content: center; color: inherit; flex: none; } .hm-bell .hm-badge { top: 4px; left: 24px; }
@media (max-width: 759px) { .hm-bell { display: flex; } }
.hm-bar { max-width: 56px; }
body.mesh-light .hm-bell { color: #0f1419; }
body.mesh-light .hv-pos, body.mesh-light .hv-vb, body.mesh-light .hv-srcb, body.mesh-light .hv-sw, body.mesh-light .hv-pills button, body.mesh-light .hv-chh, body.mesh-light .hv-fch, body.mesh-light .hv-link, body.mesh-light .hv-tabs2 button, body.mesh-light .hv-form input, body.mesh-light .hv-form select, body.mesh-light .hv-search input, body.mesh-light .hv-gtx, body.mesh-light .hv-gtx b, body.mesh-light .hv-pinfo, body.mesh-light .hv-pinfo b { color: #0f1419; }
body.mesh-light .hv-pos.on, body.mesh-light .hv-vb.on, body.mesh-light .hv-tabs2 button.on { color: #021018; }
body.mesh-light .hv-vs, body.mesh-light .hv-gl, body.mesh-light .hv-gl *, body.mesh-light .hm-rcap, body.mesh-light .hm-rcap *, body.mesh-light .hv-time, body.mesh-light .hv-tag, body.mesh-light .hv-screen .hv-pill, body.mesh-light .hm-ract button, body.mesh-light .hm-sound { color: #fff; }
body.mesh-light .hv-tag.against, body.mesh-light .hv-gh.against .hv-tag, body.mesh-light .hv-pill.against, body.mesh-light .hv-pos.on, body.mesh-light .hv-btn.c { color: #021018; }
body.mesh-light .hv-gimg .hv-vs { color: #fff; } body.mesh-light .hv-search { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.1); } body.mesh-light .hv-btn.glass { background: rgba(0,0,0,.05); border-color: rgba(0,0,0,.14); box-shadow: none; }
body.mesh-light .hv-pane, body.mesh-light .hv-pinfo { color: #0f1419; } body.mesh-light .hv-gm small, body.mesh-light .hv-meta { color: #5b6676; }
body.mesh-light .hv-cats button { border-color: transparent; background: none; }
body.mesh-light .drop.mesh-drop { background: #f3f4f6; border-color: rgba(0,0,0,.25); color: #0f1419; } body.mesh-light .drop.mesh-drop b { color: #0f1419; } body.mesh-light .drop.mesh-drop .muted { color: #5b6676; }

.hm-menu { max-height: calc(100vh - 100px); overflow-y: auto; }
.hm-who { display: flex; flex-direction: column; padding: 8px 12px 10px; border-bottom: 1px solid rgba(255,255,255,.1); margin-bottom: 4px; } .hm-who b { font-size: 1rem; } .hm-who span { color: #8fa0b8; font-size: .85rem; }
body.mesh-light .hm-who { border-bottom-color: rgba(0,0,0,.1); }
.hm-who { text-align: left; align-items: flex-start; }

/* Watch page: the two clips sit together, side by side, and fit on one screen */
@media (min-width: 900px) {
  .hv-split { justify-content: center; align-items: flex-start; gap: 20px; }
  .hv-split .hv-pane { flex: 0 1 auto; margin: 0; width: min(340px, calc((100vh - 360px) * 0.5625 + 8px)); min-width: 220px; }
}

/* Clip card details: tidy, aligned, same sizes on both sides */
.hv-pinfo { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 10px 10px; align-content: start; }
.hv-pinfo > b { grid-column: 1 / -1; font-size: 1.02rem; line-height: 1.3; overflow-wrap: anywhere; }
.hv-pinfo > small { grid-column: 1 / -1; font-size: .8rem; line-height: 1.45; padding-bottom: 6px; border-bottom: 1px solid var(--hv-line); margin-bottom: 2px; }
.hv-pinfo > .hv-vote { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hv-pinfo .hv-vb { min-height: 40px; padding: 0 8px; gap: 5px; font-size: .78rem; white-space: nowrap; border-radius: 12px; }
.hv-pinfo .hv-vb svg { flex: none; width: 16px; height: 16px; }
.hv-pinfo .hv-vb b { margin-left: 2px; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(255,255,255,.1); font-size: .75rem; text-align: center; }
.hv-pinfo .hv-vb.on b { background: rgba(0,0,0,.2); }
.hv-pinfo .hv-srcb { min-height: 40px; padding: 0 10px; gap: 6px; border-radius: 12px; font-size: .8rem; font-weight: 600; min-width: 0; justify-content: center; }
.hv-pinfo .hv-srcb svg { flex: none; }
.hv-pinfo .hv-srcb:last-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.mesh-light .hv-pinfo .hv-vb b { background: rgba(0,0,0,.08); }
.hv-pinfo, .hv-pinfo > .hv-vote { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hv-pinfo .hv-vb { min-width: 0; padding: 0 6px; overflow: hidden; } .hv-pinfo .hv-vb svg { display: none; }

/* Instagram clips on the pair page */
.hv-screen.hv-embed { aspect-ratio: 9 / 16; background: #000; }
.hv-screen.hv-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.hv-screen.hv-embed .hv-pill { z-index: 3; pointer-events: none; }
a.hv-srcb { text-decoration: none; }

/* ===== Phone-only fixes (desktop layout is not touched) ===== */
@media (max-width: 760px) {
  .hm-ps { gap: 14px; font-size: .9rem; flex-wrap: nowrap; } .hm-ps > * { white-space: nowrap; }
  .hm-pn .hv-btn, .hm-pn button, .hm-pn a { white-space: nowrap; }
  .hv-posbar:not(:has(.hv-pos)) { display: block; line-height: 1.55; } .hv-posbar:not(:has(.hv-pos)) a { display: inline; padding: 6px 2px; }
  .hv-search input { text-overflow: ellipsis; }
  .hv-flagrow button, .hv-flagrow a { min-height: 40px; }
  .mx-row { min-height: 52px; }
  .hm-reel .hm-ract button { min-width: 44px; min-height: 44px; }
}
