/* Home: approved mock composition mapped to real BTH data. Other routes opt out. */
.bth-home { --bth-rail: 0px; --bth-gutter: 20px; position: relative; isolation: isolate; min-height: 100dvh; margin-left: var(--bth-rail); background: var(--bth-paper); font-size: 15px; }
.bth-home-header { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: calc(66px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) max(var(--bth-gutter), env(safe-area-inset-right, 0px)) 0 max(var(--bth-gutter), env(safe-area-inset-left, 0px)); }
.bth-kit-icon { width: 20px; height: 20px; flex: none; }
.bth-kit-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; color: var(--bth-ink); font-family: var(--bth-font-display); font-weight: 600; font-size: 22px; letter-spacing: -.045em; line-height: 1.1; }
.bth-kit-brand > svg { width: 33px; height: 39px; flex: 0 0 33px; }
.bth-kit-brand-name { white-space: nowrap; }
.bth-home-mobile-brand { display: inline-flex; align-items: center; min-height: 48px; text-decoration: none; }
.bth-home-header .bth-icon-button { padding: 4px; border: 1px solid var(--bth-line); border-radius: 50%; }
.bth-home-breadcrumb { display: none; }
.bth-home-content { position: relative; z-index: 1; width: 100%; max-width: 1376px; margin: auto; padding: 16px max(var(--bth-gutter), env(safe-area-inset-right, 0px)) calc(110px + env(safe-area-inset-bottom, 0px)) max(var(--bth-gutter), env(safe-area-inset-left, 0px)); }
.bth-home-intro { margin-bottom: 18px; text-align: left; }
.bth-home-intro > :is(p, h1) { text-align: left; }
.bth-home-intro .bth-eyebrow { margin: 0 0 10px; color: var(--bth-clay); overflow-wrap: anywhere; text-transform: none; letter-spacing: normal; font-size: 14px; }
.bth-home-intro h1 { margin: 0; font-size: 29px; line-height: 1.16; letter-spacing: -.035em; }
.bth-child-strip { display: flex; align-items: center; flex-wrap: nowrap; gap: 9px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; margin: 0 calc(-1 * var(--bth-gutter)) 20px; padding: 6px var(--bth-gutter); }
.bth-child-strip::-webkit-scrollbar { display: none; }
.bth-child-chip { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; min-height: 48px; max-width: 220px; padding: 5px 13px 5px 6px; border: 1px solid var(--bth-line); border-radius: 28px; background: var(--bth-surface); color: var(--bth-ink); font-size: 14px; font-weight: 550; }
.bth-child-chip > span:not(.bth-kit-avatar) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bth-kit-avatar { display: inline-flex; width: 34px; height: 34px; flex: 0 0 34px; overflow: hidden; border-radius: 50%; }
.bth-kit-avatar img { display: block; width: 100%; height: 100%; }
.bth-child-manage { cursor: pointer; color: var(--bth-muted); }
.bth-child-manage-icon { display: inline-flex; justify-content: center; align-items: center; width: 34px; height: 34px; }
.bth-children-error { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: -10px 0 20px; color: var(--bth-muted); font-size: 14px; }
.bth-children-error p { margin: 0; }
.bth-home-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 27px; align-items: start; }
.bth-home-main, .bth-home-aside { min-width: 0; }
.bth-home-featured { margin: 0; }
.bth-story-card { display: block; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 13px; background: transparent; color: var(--bth-ink); text-align: left; cursor: pointer; }
.bth-story-cover { aspect-ratio: 1.16; border-radius: 13px; background: var(--bth-paper-deep); }
.bth-story-fallback { background: var(--bth-paper-deep); }
.bth-home .bth-story-cover-art { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 0; }
.bth-story-copy { display: block; padding: 10px 1px 0; }
.bth-story-format { display: block; margin-bottom: 6px; color: var(--bth-clay); font-size: 10.5px; line-height: 1.5; letter-spacing: .055em; text-transform: uppercase; }
.bth-story-title { display: block; font-family: var(--bth-font-display); font-weight: 550; font-size: 19px; line-height: 1.24; letter-spacing: -.015em; overflow-wrap: anywhere; }
.bth-story-chapter { display: inline-flex; align-self: flex-start; width: fit-content; margin-top: 9px; padding: 4px 10px; border-radius: 999px; background: var(--bth-plum-soft); color: var(--bth-plum); font: 600 12px/1.5 var(--bth-font-body); }
.bth-story-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 8px; margin-top: 7px; color: var(--bth-muted); font-size: 12px; line-height: 1.5; }
.bth-story-meta > span { display: inline-flex; align-items: center; gap: 5px; overflow-wrap: anywhere; min-width: 0; }
.bth-story-meta svg { width: 15px; height: 15px; flex: none; }
.bth-story-card-featured { display: flex; flex-direction: column; overflow: hidden; border-radius: 17px; background: var(--bth-leaf-soft); }
.bth-story-card-featured .bth-story-cover { width: 100%; height: 175px; flex: none; aspect-ratio: auto; border-radius: 0; }
.bth-story-card-featured .bth-story-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; padding: 20px; }
.bth-story-copy .bth-eyebrow { display: block; font-size: 11px; letter-spacing: .09em; }
.bth-story-card-featured .bth-story-title { font-size: 26px; line-height: 1.15; letter-spacing: -.035em; }
.bth-story-card-featured .bth-story-meta { font-size: 13px; margin: 3px 0; gap: 6px 12px; }
.bth-story-read { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 48px; margin-top: 7px; padding: 11px 18px; border-radius: 10px; background: var(--bth-plum); color: var(--bth-on-plum); font-size: 14px; font-weight: 650; }
.bth-story-read svg { width: 20px; height: 20px; }
.bth-home-create { display: flex; align-items: center; gap: 12px; min-height: 76px; margin: 7px 0 3px; padding: 15px 3px; border-bottom: 1px solid var(--bth-line); color: var(--bth-ink); text-decoration: none; }
.bth-home-create > span:nth-child(2) { flex: 1; min-width: 0; }
.bth-home-create strong { display: block; font-size: 15px; font-weight: 650; line-height: 1.4; }
.bth-home-create small { display: block; font-size: 13px; line-height: 1.5; color: var(--bth-muted); margin-top: 3px; }
.bth-home-create > svg { width: 19px; height: 19px; }
.bth-home-create-icon { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; flex: none; background: var(--bth-plum-soft); color: var(--bth-plum); border-radius: 13px; }
.bth-story-shelf { margin-top: 26px; }
.bth-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.bth-section-heading h2 { margin: 0; font-size: 23px; line-height: 1.2; }
.bth-text-button { display: inline-flex; align-items: center; justify-content: center; flex: none; gap: 7px; min-height: 48px; padding: 7px 3px; background: transparent; border: 0; color: var(--bth-plum); font-size: 13px; font-weight: 650; cursor: pointer; text-decoration: none; }
.bth-text-button svg { width: 18px; height: 18px; }
.bth-story-shelf-scroll { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 23px 14px; }
.bth-shelf-empty { margin: 0; padding: 20px; background: var(--bth-surface); color: var(--bth-muted); border: 1px dashed var(--bth-line-strong); border-radius: 13px; font-size: 14px; }
.bth-notice { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 22px; margin: 12px 0 22px; border: 1px solid var(--bth-line-strong); border-radius: 16px; background: var(--bth-surface); }
.bth-notice p { margin: 0; }
.bth-notice > svg { width: 32px; height: 32px; color: var(--bth-plum); }
.bth-shelf-loading { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.bth-skeleton { height: 220px; border-radius: 13px; background: var(--bth-surface-soft); }
.bth-home-aside { display: flex; flex-direction: column; gap: 24px; }
.bth-home-aside h2 { margin: 0 0 12px; font-size: 23px; line-height: 1.2; }
.bth-family-overview { padding-bottom: 20px; border-bottom: 1px solid var(--bth-line); }
.bth-family-overview > p { margin: 0; font-size: 14px; }
.bth-family-overview .bth-family-empty { margin-top: 15px; color: var(--bth-muted); }
.bth-family-people { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 16px; margin: 18px 0 8px; }
.bth-family-person { min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.bth-family-person .bth-kit-avatar { width: 48px; height: 48px; flex-basis: 48px; margin-bottom: 3px; }
.bth-family-person strong { font-size: 13px; font-weight: 550; overflow-wrap: anywhere; width: 100%; }
.bth-family-person small { font-size: 12px; color: var(--bth-muted); }
.bth-home .bth-home-streak { display: flex; align-items: flex-start; gap: 7px; margin: 12px 0 0; font-size: 12px; color: var(--bth-muted); }
.bth-home-streak svg { width: 16px; height: 16px; margin-top: 2px; color: var(--bth-clay); }
.bth-home-discover { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bth-home-discover button { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 10px; min-width: 0; min-height: 112px; padding: 15px 13px; border: 1px solid var(--bth-line); border-radius: 13px; background: var(--bth-surface); color: var(--bth-ink); text-align: left; font-size: 13px; line-height: 1.5; cursor: pointer; touch-action: manipulation; }
.bth-home-discover svg { width: 28px; height: 28px; color: var(--bth-plum); }
.bth-home-discover strong { display: block; font-size: 14px; font-weight: 650; overflow-wrap: anywhere; }
.bth-home-discover small { display: block; margin-top: 4px; color: var(--bth-muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.bth-motion-toggle { display: flex; align-items: center; gap: 6px; min-height: 48px; margin: 5px 0 8px auto; padding: 10px 0 10px 10px; background: transparent; border: 0; color: var(--bth-muted); font-size: 12px; cursor: pointer; }
.bth-motion-toggle svg { width: 14px; height: 14px; }
.bth-home .bth-motion-toggle { margin: -12px 0 0; align-self: flex-start; padding-left: 0; }

/* One navigation element changes composition; auth and non-Home routes stay in BottomNav. */
.bth-home-navigation { position: fixed; inset: auto 0 0; z-index: 45; padding: 5px max(7px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(7px, env(safe-area-inset-left, 0px)); background: var(--bth-surface); border-top: 1px solid var(--bth-line); }
.bth-home-rail-brand { display: none; min-height: 48px; text-decoration: none; }
.bth-home-nav-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bth-home-nav-links a { display: grid; grid-template-rows: 42px 16px; place-items: center; align-content: center; gap: 3px; min-width: 0; min-height: 64px; padding: 0; border-radius: 9px; color: var(--bth-muted); font-size: 11.5px; line-height: 1.2; text-decoration: none; }
.bth-home-nav-links a > span { max-width: 100%; white-space: nowrap; }
.bth-home-nav-links svg { width: 23px; height: 23px; }
.bth-home-nav-links [aria-current="page"] { color: var(--bth-ink); font-weight: 700; }
.bth-home-nav-links [aria-current="page"] svg { stroke-width: 2.15; }
.bth-home-nav-links .bth-home-nav-create svg { width: 44px; height: 44px; padding: 11px; border-radius: 50%; background: var(--bth-plum); color: var(--bth-on-plum); stroke-width: 1.9; }

/* Decorative layer never captures touches or enters the accessibility tree. */
.bth-ambient-stars { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; color: var(--bth-clay); }
.bth-ambient-star { position: absolute; width: 13px; height: 13px; animation: bth-star-drift 14s ease-in-out infinite; }
.bth-ambient-star svg { display: block; width: 100%; height: 100%; opacity: .24; animation: bth-star-pulse 8s ease-in-out infinite; }
.bth-ambient-star:nth-child(1) { top: 15%; left: 4%; }
.bth-ambient-star:nth-child(2) { top: 6%; right: 24%; width: 10px; animation-delay: -4s; }
.bth-ambient-star:nth-child(3) { top: 41%; right: 3%; width: 16px; animation-delay: -7s; }
.bth-ambient-star:nth-child(4) { bottom: 29%; left: 2%; width: 9px; animation-delay: -9s; }
.bth-ambient-star:nth-child(5) { bottom: 17%; right: 7%; animation-delay: -2s; }
.bth-ambient-star:nth-child(6) { top: 31%; left: 42%; width: 8px; animation-delay: -11s; }
.bth-ambient-star:nth-child(even) svg { animation-delay: -4s; color: var(--bth-plum); }
.bth-ambient-stars.is-paused .bth-ambient-star, .bth-ambient-stars.is-paused svg { animation-play-state: paused; }
@keyframes bth-star-drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(3px, -6px); } }
@keyframes bth-star-pulse { 0%, 100% { opacity: .12; } 50% { opacity: .4; } }

/* Exact nine-star mock composition on Home only; Creator keeps its existing six. */
.bth-home .bth-ambient-stars { opacity: .48; color: #e8b656; }
.bth-home .bth-ambient-star { left: var(--x); top: var(--y); right: auto; bottom: auto; width: var(--size); height: var(--size); animation: bth-home-drift var(--drift, 12s) ease-in-out var(--delay, 0s) infinite; }
.bth-home .bth-ambient-star svg { color: inherit; animation: bth-home-breathe var(--pulse, 7s) ease-in-out var(--delay, 0s) infinite; }
.bth-home .bth-ambient-star:nth-child(3n) { color: #c7b2d3; }
.bth-home .bth-ambient-star:nth-child(1) { --x: 82%; --y: 4%; --size: 16px; --delay: -3s; --drift: 13s; }
.bth-home .bth-ambient-star:nth-child(2) { --x: 94%; --y: 21%; --size: 14px; --delay: -7s; --pulse: 8s; }
.bth-home .bth-ambient-star:nth-child(3) { --x: 3%; --y: 37%; --size: 11px; --delay: -5s; --drift: 15s; }
.bth-home .bth-ambient-star:nth-child(4) { --x: 74%; --y: 36%; --size: 17px; --delay: -9s; --pulse: 9s; }
.bth-home .bth-ambient-star:nth-child(5) { --x: 95%; --y: 68%; --size: 12px; --delay: -2s; --drift: 14s; }
.bth-home .bth-ambient-star:nth-child(6) { --x: 8%; --y: 78%; --size: 15px; --delay: -11s; --pulse: 8s; }
.bth-home .bth-ambient-star:nth-child(7) { --x: 46%; --y: 17%; --size: 12px; --delay: -6s; --drift: 16s; }
.bth-home .bth-ambient-star:nth-child(8) { --x: 64%; --y: 73%; --size: 18px; --delay: -4s; --pulse: 9s; }
.bth-home .bth-ambient-star:nth-child(9) { --x: 29%; --y: 52%; --size: 10px; --delay: -10s; --drift: 14s; }
.bth-home .bth-ambient-stars.is-paused .bth-ambient-star, .bth-home .bth-ambient-stars.is-paused svg { animation-play-state: paused; }
.bth-home:has(input:focus, textarea:focus, select:focus, [role="dialog"]) .bth-ambient-stars { visibility: hidden; }
.bth-home:has(input:focus, textarea:focus, select:focus, [role="dialog"]) .bth-ambient-star, .bth-home:has(input:focus, textarea:focus, select:focus, [role="dialog"]) .bth-ambient-star svg { animation-play-state: paused; }
@keyframes bth-home-drift { 0%, 100% { transform: translate3d(0, 0, 0) rotate(-7deg); } 50% { transform: translate3d(3px, -6px, 0) rotate(5deg); } }
@keyframes bth-home-breathe { 0%, 100% { opacity: .55; transform: scale(.88); } 50% { opacity: 1; transform: scale(1); } }

@media (min-width: 761px) and (pointer: fine), (min-width: 1025px) {
    .bth-home { --bth-rail: 236px; --bth-gutter: 48px; }
    .bth-home-header { min-height: calc(80px + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--bth-line); }
    .bth-home-mobile-brand { display: none; }
    .bth-home-breadcrumb { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--bth-muted); font-size: 13px; }
    .bth-home-breadcrumb > span:last-child { color: var(--bth-line-strong); }
    .bth-home-content { padding-top: 38px; padding-bottom: 64px; }
    .bth-home-intro h1 { font-size: clamp(32px, 3.5vw, 44px); }
    .bth-home-layout { grid-template-columns: minmax(0, 1fr); max-width: 920px; gap: 32px; }
    .bth-home-navigation { inset: 0 auto 0 0; display: flex; flex-direction: column; width: 236px; padding: max(34px, env(safe-area-inset-top, 0px)) 22px 25px; border-top: 0; border-right: 1px solid var(--bth-line); overflow-y: auto; }
    .bth-home-rail-brand { display: block; }
    .bth-home-rail-brand .bth-kit-brand { gap: 10px; font-size: 19px; letter-spacing: -.7px; }
    .bth-home-rail-brand .bth-kit-brand > svg { width: 40px; height: 46px; flex-basis: 40px; }
    .bth-home-rail-brand small { display: block; margin-top: 4px; color: var(--bth-muted); font-family: var(--bth-font-body); font-size: 10px; font-weight: 500; letter-spacing: 1.2px; text-transform: uppercase; }
    .bth-home-nav-links { display: flex; flex-direction: column; gap: 7px; margin-top: 54px; }
    .bth-home-nav-links a { display: flex; align-items: center; justify-content: flex-start; gap: 13px; min-height: 48px; padding: 12px 14px; text-align: left; font-size: 14px; font-weight: 550; }
    .bth-home-nav-links svg, .bth-home-nav-links .bth-home-nav-create svg { width: 21px; height: 21px; padding: 0; border-radius: 0; background: transparent; color: inherit; }
    .bth-home-nav-links [aria-current="page"] { background: var(--bth-plum-soft); color: var(--bth-plum); font-weight: 700; }
    .bth-home-nav-links [aria-current="page"]::after { content: ""; width: 5px; height: 5px; border-radius: 50%; margin-left: auto; background: currentColor; }
    .bth-story-card-featured { display: grid; grid-template-columns: 1fr .94fr; min-height: 314px; border-radius: 22px; }
    .bth-story-card-featured .bth-story-cover { grid-column: 2; grid-row: 1; height: 100%; min-height: 314px; }
    .bth-story-card-featured .bth-story-copy { grid-column: 1; grid-row: 1; padding: 29px 20px 30px 30px; gap: 15px; }
    .bth-story-card-featured .bth-story-title { font-size: clamp(27px, 2.4vw, 36px); line-height: 1.13; }
    .bth-story-read { width: auto; margin-top: auto; }
    .bth-story-shelf-scroll, .bth-shelf-loading { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px 19px; }
    .bth-story-cover { aspect-ratio: 1.32; border-radius: 16px; }
    .bth-story-copy { padding-top: 13px; }
    .bth-story-title { font-size: 20px; line-height: 1.22; }
    .bth-section-heading h2 { font-size: 25px; }
    .bth-home-aside h2 { font-size: 23px; }
}
@media (min-width: 761px) and (max-width: 1100px) and (pointer: fine), (min-width: 1025px) and (max-width: 1100px) {
    .bth-home { --bth-gutter: 32px; }
    .bth-home-layout { grid-template-columns: minmax(0, 1fr); }
    .bth-home .bth-motion-toggle { grid-column: 1 / -1; }
}
@media (min-width: 761px) and (max-width: 900px) and (pointer: fine) {
    .bth-home { --bth-rail: 88px; --bth-gutter: 26px; }
    .bth-home-navigation { width: 88px; padding: 26px 12px; }
    .bth-home-rail-brand .bth-kit-brand-name, .bth-home-rail-brand small { display: none; }
    .bth-home-rail-brand .bth-kit-brand { display: flex; justify-content: center; }
    .bth-home-nav-links a { flex-direction: column; gap: 7px; padding: 10px 0; font-size: 10px; }
    .bth-home-nav-links [aria-current="page"]::after { display: none; }
}
@media (max-width: 760px), (max-width: 1024px) and (pointer: coarse) {
    .bth-home .bth-ambient-star:nth-child(n+7) { display: none; }
}
@media (min-width: 640px) and (max-width: 760px), (min-width: 640px) and (max-width: 1024px) and (pointer: coarse) {
    .bth-story-shelf-scroll, .bth-shelf-loading { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-height: 520px) and (orientation: landscape) and (pointer: coarse) {
    .bth-home-nav-links a { min-height: 50px; grid-template-rows: 30px 14px; gap: 2px; font-size: 10.5px; }
    .bth-home-nav-links .bth-home-nav-create svg { width: 32px; height: 32px; padding: 6px; }
    .bth-story-card-featured .bth-story-cover { height: 150px; }
}
@media (max-width: 380px) { .bth-home { --bth-gutter: 16px; } .bth-section-heading { flex-wrap: wrap; gap: 4px 12px; } }
@media (hover: hover) {
    .bth-home-nav-links a:hover, .bth-home-discover button:hover, .bth-child-manage:hover { background: var(--bth-surface-soft); }
    .bth-text-button:hover { text-decoration: underline; text-underline-offset: 5px; }
    .bth-story-card:hover .bth-story-title { color: var(--bth-plum); }
}
@media (prefers-reduced-motion: reduce) {
    .bth-ambient-star, .bth-ambient-star svg, .bth-home .bth-ambient-star, .bth-home .bth-ambient-star svg { animation: none; transform: none; }
    .bth-home .bth-ambient-star svg { opacity: .8; }
    .bth-home .bth-motion-toggle { display: none; }
    .bth-home .bth-story-cover .animate-pulse { animation: none; }
    .bth-home .bth-story-cover img { transition: none; }
}
html:has(.bth-home), body:has(.bth-home) { scrollbar-width: none; }
html:has(.bth-home)::-webkit-scrollbar, body:has(.bth-home)::-webkit-scrollbar { display: none; }
