/* Character hub (features/hub) — one sheet for discover cards, chat header/bubbles, intro, my mates.
   Layout: narrow = one column, the card itself scrolls (app-style full 2:3 hero, sticky tabs + CTA).
   Wide (>= 960px) = two columns: the portrait fills the left column at 2:3, intro/tabs/CTA on the right. No crop, no blur. */
.hub-backdrop { align-items: center; }
.hub-card { position: relative; width: 100%; max-width: 480px; max-height: min(92vh, 860px); display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); scrollbar-width: none; }
.hub-card::-webkit-scrollbar { display: none; }
.hub-body { display: contents; }
.hub-scroll { flex: none; }
.hub-close, .hub-nav { flex: none; }
.hub-close { position: sticky; top: 10px; z-index: 4; margin: 0 0 -34px 10px; width: 34px; height: 34px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); color: #fff; backdrop-filter: blur(4px); }
.hub-close svg { width: 16px; height: 16px; display: block; }
.hub-nav { position: absolute; top: 46%; z-index: 3; width: 38px; height: 38px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .45); color: #fff; backdrop-filter: blur(4px); transition: background .15s; }
.hub-nav svg { width: 20px; height: 20px; display: block; }
.hub-nav:hover { background: rgba(0, 0, 0, .7); }
.hub-nav.prev { left: 10px; }
.hub-nav.next { right: 10px; }

/* hero */
.hub-media { position: relative; flex: none; background: var(--surface-2); touch-action: pan-y; }
.hub-img { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; object-position: top; }
.hub-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 110px; background: linear-gradient(to top, var(--surface), transparent); pointer-events: none; }
.hub-new { position: absolute; top: 14px; right: 14px; z-index: 2; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.hub-hero-actions { position: absolute; right: 12px; bottom: 12px; z-index: 2; display: flex; align-items: center; gap: 8px; }
.hub-like { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 12px 0 10px; line-height: 1; border-radius: 999px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 14px; font-weight: 600; backdrop-filter: blur(4px); transition: transform .15s; }
.hub-like:hover { transform: scale(1.05); }
.hub-share { width: 34px; height: 34px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); color: #fff; backdrop-filter: blur(4px); transition: transform .15s; }
.hub-share svg { width: 17px; height: 17px; display: block; }
.hub-share:hover { transform: scale(1.05); }
.hub-like[aria-pressed="true"] .hub-like-icon { color: var(--accent); }
.hub-like-icon { font-size: 17px; line-height: 1; display: block; transform: translateY(-1px); }
.hub-like-count { display: block; line-height: 1; }

/* tabs */
.hub-tabs { position: sticky; top: 0; z-index: 2; display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.hub-tabs { margin-top: -1px; }
.hub-tabs button { flex: 1; height: 44px; font-size: 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.hub-tabs button.active { color: var(--ink); border-bottom-color: var(--ink); }

/* intro pane */
.hub-pane { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 20px; }
.hub-head { display: flex; flex-direction: column; gap: 2px; }
.hub-name { font-family: var(--serif); font-weight: 400; font-size: 28px; line-height: 1.1; }
.hub-spec { color: var(--gold); font-size: 13px; }
.hub-episode-title { font-weight: 600; font-size: 15px; margin-top: 4px; }
.hub-stats { display: flex; gap: 18px; }
.hub-stat { display: flex; flex-direction: column; gap: 1px; }
.hub-stat b { font-size: 16px; font-weight: 600; }
.hub-stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.hub-tags .chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; font-size: 12px; }
.hub-hook { color: var(--ink-2); font-size: 14px; line-height: 1.55; }
.hub-section { display: flex; flex-direction: column; gap: 8px; }
.hub-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.hub-text { font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.hub-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.hub-cast { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.hub-cast::-webkit-scrollbar { display: none; }
.hub-cast-card { flex: 0 0 112px; display: flex; flex-direction: column; gap: 4px; padding: 0; text-align: left; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 2px solid transparent; transition: border-color .15s; }
.hub-cast-card.active { border-color: var(--ink); }
.hub-cast-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--surface-2); }
.hub-cast-name { padding: 0 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-cast-sub { padding: 0 8px 8px; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-creator { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); }
.hub-creator-link { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0; text-align: left; color: var(--ink); }
/* The detail response carries no creator image — the app shows the same initial-letter avatar. */
.hub-creator-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-size: 14px; font-weight: 700; }
.hub-creator-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-script { display: flex; flex-direction: column; gap: 8px; }
.hub-script .hub-narration { font-family: var(--serif); font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.hub-script .hub-cut { width: 100%; border-radius: 12px; object-fit: cover; max-height: 220px; }
.hub-script .hub-first { padding: 10px 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; }
.hub-disclaimer { font-size: 11px; color: var(--muted); line-height: 1.4; }
.hub-disclaimer-box { padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); }
.hub-comment-list { display: flex; flex-direction: column; gap: 10px; }
.hub-comment { display: flex; gap: 10px; align-items: flex-start; }
.hub-comment-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.hub-comment-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hub-comment-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.hub-comment-author { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hub-comment-author.mine { color: var(--accent); }
.hub-comment-badge { flex: none; padding: 1px 6px; border-radius: 6px; background: rgba(255, 77, 109, .14); color: var(--accent); font-size: 10px; font-weight: 700; }
.hub-comment-edited { flex: none; font-size: 11px; color: var(--muted); font-style: italic; }
.hub-comment-acts { margin-left: auto; display: flex; gap: 2px; flex: none; }
.hub-comment-act { padding: 2px 6px; color: var(--muted); font-size: 11px; }
.hub-comment-act:hover { color: var(--ink-2); }
.hub-comment-text { font-size: 14px; line-height: 1.45; word-break: break-word; }
.hub-comment-replies { display: flex; flex-direction: column; gap: 10px; }
.hub-comment-replies:not(:empty) { margin-top: 10px; }
.hub-comment-replyto { margin-bottom: 6px; padding: 0 4px; color: var(--accent); font-size: 12px; }
.hub-comment-form { display: flex; align-items: center; gap: 8px; }
.hub-comment-cancel { flex: none; color: var(--muted); font-size: 20px; line-height: 1; padding: 0 2px; }
.hub-comment-form input { flex: 1; min-width: 0; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 14px; outline: none; }
.hub-comment-form input:focus { border-color: var(--line-2); }
.hub-empty { color: var(--muted); font-size: 14px; }

/* gallery */
.hub-gallery-count { font-size: 13px; color: var(--muted); }
.hub-gallery-section { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.hub-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.hub-gallery-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.hub-gallery-row::-webkit-scrollbar { display: none; }
.hub-gallery-row .hub-slot { flex: 0 0 84px; }
.hub-slot { position: relative; display: block; aspect-ratio: 2 / 3; border-radius: 10px; overflow: hidden; background: var(--surface-2); padding: 0; }
.hub-slot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hub-slot.locked img { filter: blur(6px) brightness(.55); transform: scale(1.08); }
.hub-slot.locked::after { content: "🔒"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; }
.hub-slot-step { position: absolute; left: 5px; top: 5px; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .6); color: #fff; font-size: 11px; font-weight: 700; }
.hub-slot:not(.locked) .hub-slot-step { background: var(--accent); }
.hub-slot-hint { font-size: 12px; color: var(--muted); }

/* Unlocked-cut viewer — steps across unlocked slots only (a locked cut has no imageUrl at all). */
.hub-lightbox { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgba(0, 0, 0, .88); }
.hub-lightbox-img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }
.hub-lightbox .hub-close { position: absolute; top: 16px; right: 16px; left: auto; margin: 0; }
.hub-lightbox .hub-nav { top: 50%; transform: translateY(-50%); }
.hub-lightbox .hub-nav.next { right: 10px; left: auto; }

/* sticky CTA */
.hub-foot { position: sticky; bottom: 0; z-index: 2; flex: none; margin-top: auto; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.hub-cta { display: flex; width: 100%; justify-content: center; }

@media (max-width: 480px) {
  #hubSheet { padding: 0; align-items: flex-end; }
  .hub-card { max-width: none; max-height: 94vh; border-radius: var(--r-lg) var(--r-lg) 0 0; border-left: 0; border-right: 0; border-bottom: 0; }
  /* The sheet drops its padding at this width; the state cards are dialogs, not sheets. */
  .hub-state-card { margin: 20px; align-self: center; }
}

/* Wide: two columns. Portrait column width follows the card height at 2:3. */
@media (min-width: 960px) {
  .hub-card { max-width: calc(min(86vh, 800px) * 2 / 3 + 440px); height: min(86vh, 800px); max-height: none; display: grid; grid-template-columns: auto 1fr; overflow: hidden; }
  .hub-media { width: calc(min(86vh, 800px) * 2 / 3); height: 100%; }
  .hub-img { width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; object-position: center top; }
  .hub-media::after { display: none; }
  .hub-close { position: absolute; top: 10px; left: 10px; margin: 0; }
  .hub-nav { top: 50%; transform: translateY(-50%); }
  .hub-nav.next { left: calc(min(86vh, 800px) * 2 / 3 - 48px); right: auto; }
  .hub-body { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
  .hub-tabs { position: static; }
  .hub-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  .hub-foot { position: static; margin-top: 0; }
  .hub-name { font-size: 32px; }
}

/* Blocked accounts sheet */
.blocked-avatar { flex: none; width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }

/* In-sheet load states (blocked creator / unavailable) — the card is hidden while one of these shows. */
.hub-state-card { width: 100%; max-width: 380px; padding: 28px 24px 20px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.hub-state-avatar { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); font-size: 24px; font-weight: 700; }
.hub-state-name { font-size: 16px; font-weight: 700; }
.hub-state-title { font-size: 17px; font-weight: 700; }
.hub-state-body { color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.hub-state-card .btn { width: 100%; margin-top: 8px; }
.hub-state-close { color: var(--muted); font-size: 14px; padding: 6px 12px; }

/* Top creators rows (mates page) */
.creator-list { display: flex; flex-direction: column; gap: 8px; }
.creator-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); cursor: pointer; transition: border-color .15s; }
.creator-row:hover { border-color: var(--line-2); }
.creator-row.blocked { opacity: .65; cursor: default; }
.creator-rank { width: 22px; text-align: center; font-weight: 700; font-size: 14px; color: var(--muted); }
.creator-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.creator-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.creator-name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.creator-stats { font-size: 12px; color: var(--muted); }
.creator-blocked { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.creator-chev { font-size: 22px; color: var(--muted); line-height: 1; }

/* Creator channel sheet — hero header over a blurred featured portrait, featured episode, all episodes. */
.channel-card { position: relative; width: 100%; max-width: 640px; max-height: min(92vh, 860px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-2); padding: 0 0 22px; display: flex; flex-direction: column; gap: 16px; }
.channel-card .hub-close { position: absolute; top: 12px; right: 12px; left: auto; margin: 0; }
.sheet-menu-wrap { position: absolute; top: 12px; right: 56px; z-index: 5; }
.channel-menu-btn { position: static; margin: 0; font-size: 20px; line-height: 1; }
.sheet-menu { position: absolute; top: 40px; right: 0; min-width: 160px; padding: 4px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line-2); display: flex; flex-direction: column; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.sheet-menu-item { padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 14px; text-align: left; white-space: nowrap; }
.sheet-menu-item:hover { background: var(--surface-2); }
.sheet-menu-item.danger { color: var(--accent); }
.channel-hero { position: relative; overflow: hidden; padding: 22px 18px 18px; background: var(--surface-2); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.channel-backdrop { position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; object-position: top center; filter: blur(24px); }
/* Dim + fade into the card so a low-res portrait never fights the text. */
.channel-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0, 0, 0, .45), rgba(0, 0, 0, .62) 55%, var(--surface)); }
.channel-hero-body { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px; }
.channel-head { display: flex; align-items: center; gap: 14px; padding-right: 92px; }
.channel-avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 2px solid rgba(255, 255, 255, .25); flex: none; }
.channel-head-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.channel-name { font-family: var(--serif); font-weight: 400; font-size: 26px; line-height: 1.1; color: #fff; }
.channel-stats { font-size: 13px; color: rgba(255, 255, 255, .75); }
.channel-follow { width: 100%; justify-content: center; }
.channel-follow-value { font-size: 11.5px; text-align: center; color: rgba(255, 255, 255, .6); }
.channel-owner-tools { display: flex; gap: 10px; padding: 0 18px; }
.channel-owner-tools .btn { flex: 1; }
.channel-preview-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 18px; padding: 8px 12px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; color: var(--muted); }
.channel-notice { padding: 0 18px; }
.channel-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 28px 24px; text-align: center; }
.channel-section { display: flex; flex-direction: column; gap: 10px; padding: 0 18px; }
.channel-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.channel-sorts { display: flex; gap: 6px; }
.channel-sort { padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); font-size: 11.5px; font-weight: 700; }
.channel-sort.active { border-color: var(--accent); color: var(--accent); background: rgba(255, 77, 109, .14); }
.channel-item { position: relative; }
.channel-item .sheet-menu-wrap { top: 8px; right: 8px; }
.channel-card-menu { width: 28px; height: 28px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .5); color: #fff; font-size: 17px; line-height: 1; backdrop-filter: blur(4px); }
.channel-new { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 3px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .04em; }
.channel-featured { position: relative; display: block; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--surface-2); }
.channel-featured-img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.channel-featured::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 45%, rgba(0, 0, 0, .82)); }
.channel-featured-meta { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; display: flex; flex-direction: column; gap: 6px; }
.channel-featured-name { font-size: 20px; font-weight: 700; color: #fff; }
.channel-featured-sub { font-size: 13px; line-height: 1.35; color: rgba(255, 255, 255, .85); }
.channel-featured-cta { display: flex; justify-content: center; margin-top: 6px; }
.channel-item-stats { font-size: 11.5px; color: rgba(255, 255, 255, .8); }
.channel-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.channel-tile { display: block; border-radius: 14px; overflow: hidden; background: var(--surface-2); }
.channel-tile-img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top center; display: block; background: var(--surface-2); }
.channel-tile-meta { padding: 10px; display: flex; flex-direction: column; gap: 3px; }
.channel-tile-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-tile-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.channel-tile .channel-item-stats { color: var(--muted); }
@media (max-width: 480px) { .channel-card { max-width: none; max-height: 94vh; border-radius: var(--r-lg) var(--r-lg) 0 0; border-left: 0; border-right: 0; border-bottom: 0; } }

/* Profile edit sheet (owner tools → Edit profile) */
.profile-form { display: flex; flex-direction: column; gap: 16px; }
.profile-photo { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.profile-avatar { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }
.profile-avatar-empty { display: grid; place-items: center; color: var(--muted); font-size: 28px; }
.profile-photo-acts { display: flex; gap: 8px; }
.profile-field { display: flex; flex-direction: column; gap: 6px; }
.profile-label { font-size: 12px; font-weight: 600; color: var(--muted); }
.profile-input { width: 100%; padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font: inherit; font-size: 15px; outline: none; }
.profile-input:focus { border-color: var(--accent); }
.profile-textarea { resize: vertical; line-height: 1.45; }
.profile-hint { font-size: 11.5px; color: var(--muted); }

/* Following feed (mates page) */
.following-more { align-self: flex-start; margin-top: 10px; }
