/* Hub shell (preview 2026-12-04). Source: runs/2026-12-04_hub_shell/hub-shell.css
   Every card-like surface sits with the thread cards (hub-threads.css): 20px corners from 640px up, a hairline, no shadow.
   Inner controls step down a nested scale so they do not look pinched inside a 20px card:
   card 20 > inner panel, image, input, sidebar item, segmented track 12 > segment, chip 8 > buttons stay pills.
   (DS 2026 radius scale: --radius-sm 8, --radius-md 12; the card value is the prototype's thread card, forum.css section 5.)
   CSS only. It hangs off html.hbt, which the live hub-threads.js sets on hub pages outside admin, the Knowledge Base,
   Help Center topic spaces and Academy (those belong to #hub-kb-pilot), and html.bb-embed (the compose modal's frame)
   is left alone. Colours come from the --bm-* tokens that #hub-colors sets, so light and dark both follow. */

/* 1. Tokens: the hub's own cards (border border-card shadow-card sm:rounded-card) all read these. */
html.hbt.hbt:not(.bb-embed){
  --bm-shadow-card:none;
  --bm-shadow-card-hovered:none;
  --bm-radius-base:12px;
  --bm-radius-base-sm:8px;
  --bm-radius-input:12px;
  --bm-radius-popover:12px;
}
@media (min-width:640px){
  html.hbt.hbt:not(.bb-embed){--bm-radius-card:20px}
}
/* the header keeps today's radii (its look is hub-nav's business, its content is not touched) */
html.hbt.hbt:not(.bb-embed) header{--bm-radius-base:.5rem;--bm-radius-base-sm:.25rem;--bm-radius-input:.5rem}

/* 2. Surfaces that carry a shadow without the border-card class get the hairline as a 1px ring (no layout shift). */
html.hbt:not(.bb-embed) main .shadow-card:not(.border),
html.hbt:not(.bb-embed) main .shadow-sm:not(.border),
html.hbt:not(.bb-embed) main .shadow-md:not(.border){box-shadow:0 0 0 1px var(--bm-border-color-card,var(--bm-color-line,#E6E0D5))!important}
html.hbt:not(.bb-embed) main .border-card{box-shadow:none!important;border-color:var(--bm-border-color-card,var(--bm-color-line,#E6E0D5))!important}

/* 3. Banners and heroes: outer corners follow the card; layout, height and art are untouched. */
@media (min-width:640px){
  html.hbt:not(.bb-embed) main .block-space-header>div,
  html.hbt:not(.bb-embed) main .block-new-hero-banner>div{border-radius:20px!important;overflow:hidden}
  /* the right-rail profile card: its navy top band follows the card's top corners */
  html.hbt:not(.bb-embed) main .border-card>:first-child:is(.rounded-t-card,[class*="rounded-t-"]){border-top-left-radius:19px!important;border-top-right-radius:19px!important}
}

/* 4. Inner controls: the nested scale. */
/* segmented controls (Leaderboard All time / Month / Week, view switchers): 12px track, 8px segments */
html.hbt:not(.bb-embed) main .rounded-base.p-1.inline-flex>*{border-radius:8px!important}
/* bordered panels inside a post body (polls, embeds): the inner panel step */
html.hbt:not(.bb-embed) main .not-prose.border.rounded-md,
html.hbt:not(.bb-embed) main .not-prose.border:not([class*="rounded-"]){border-radius:12px}
html.hbt:not(.bb-embed) main .not-prose.border.border-line-subdued{border-radius:12px!important}
/* images and embeds inside posts and replies */
@media (min-width:640px){
  html.hbt:not(.bb-embed) main .prose figure img,
  html.hbt:not(.bb-embed) main .prose figure,
  html.hbt:not(.bb-embed) main .prose iframe{border-radius:12px}
}

/* 5. Post pages: the post and its replies read as ONE thread surface, like a Feed card and the prototype.
   Why round 1 missed these cards: on post pages Bettermode puts .block-single-post ON the post card itself
   (div.border.border-card...block-single-post), and the replies card carries no block class, so hub-threads.css's
   descendant selector "main .block-single-post .border-card" matched neither and both kept 8px + shadow-card.
   The join: the post column (the div that holds the post card, the replies stack, and the sticky composer) becomes the
   20px hairline surface; the cards inside go flat and borderless; a hairline separates the post from the replies
   (and the "Sort by" row, the pager row and the composer sit inside the same surface). overflow:clip keeps the
   composer's corners inside the radius without making a scroll container, so the composer stays sticky. */
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){
  background:var(--bm-color-surface,#fff);border:1px solid var(--bm-border-color-card,var(--bm-color-line,#E6E0D5));overflow:clip}
/* the column's own sm:py-3.5 md:py-4 lg:py-5 would sit inside the surface; move it outside as margin */
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){padding-top:0!important;padding-bottom:0!important}
@media (min-width:640px){html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){margin-top:14px;margin-bottom:14px}}
@media (min-width:768px){html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){margin-top:16px;margin-bottom:16px}}
@media (min-width:1024px){html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){margin-top:20px;margin-bottom:20px}}
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>*+*{margin-top:0!important}
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>.border-card,
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>div>.border-card{
  border:0!important;border-radius:0!important;box-shadow:none!important;background:transparent!important}
/* the replies stack: a hairline under the post's actions, no gap between the sort row and the replies */
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>.border-card.block-single-post~div:has(.border-card){
  border-top:1px solid var(--bm-border-color-card,var(--bm-color-line,#E6E0D5));row-gap:0!important}
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>.border-card.block-single-post~div:has(.border-card)>:not(.border-card){
  padding:14px 24px 0}
/* the sticky composer: same surface, its top hairline comes from hub-threads (.hbt-sticky), no card shadow */
html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>.sticky{border-radius:0!important;box-shadow:0 -1px 0 var(--bm-border-color-card,var(--bm-color-line,#E6E0D5))!important}
@media (min-width:640px){
  html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){border-radius:20px}
}
@media (max-width:639.98px){
  html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post){border-left-width:0;border-right-width:0}
  html.hbt:not(.bb-embed) main div:has(>.border-card.block-single-post)>.border-card.block-single-post~div:has(.border-card)>:not(.border-card){padding:12px 16px 0}
}
