:root {
  --cream: #fbf8f2;
  --ink: #0a0a0a;
  --muted: #6b6b69;
  --chrome-line: #a2adba;
  --chrome-a: #f4f6fa;
  --chrome-b: #c8d2e2;
  --chrome-ink: #4e6078;
  --line: #dcdedc;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; scroll-padding-top: 24px; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: 'Inter Tight', system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
h1, h2, p, figure { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; user-select: none; -webkit-user-select: none; }
button, a { touch-action: manipulation; }
button:active, a:active { opacity: .72; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid #566b95; outline-offset: 4px; }
.site-header { height: calc(60px + env(safe-area-inset-top, 0px)); padding: env(safe-area-inset-top, 0px) 42px 0; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #d8d2c84d; }
.brand { display: inline-flex; align-items: center; min-height: 44px; font-size: 10px; letter-spacing: .11em; font-weight: 600; }
.back-link { display: flex; align-items: center; min-height: 44px; gap: 12px; font-size: 10px; }
main { max-width: 1000px; margin: auto; padding: 0 40px; }
.show-masthead { padding: 53px 0 40px; text-align: center; }
h1 { font-size: clamp(38px, 5vw, 60px); line-height: 1.05; font-weight: 500; letter-spacing: -.05em; }
.show-masthead>p { margin-top: 13px; font-size: 15px; color: var(--muted); }
.episode-room { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 38px; align-items: start; max-width: 840px; margin: auto; }
.featured-film, .episode-section, .membership-invitation { border: 1px solid var(--chrome-line); border-radius: 7px; overflow: hidden; background: var(--cream); box-shadow: inset 0 1px 0 #fff, 0 10px 30px #26344114; }
.window-bar { height: 27px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 8px; background: linear-gradient(#fcfdff, #d5ddeb); border-bottom: 1px solid #aab6c6; color: var(--chrome-ink); font-size: 9px; letter-spacing: .025em; }
.window-bar>span:first-child, .window-bar h2 { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: inherit; font-weight: 400; }
.window-glyphs { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.window-glyphs i, .window-glyphs b { display: grid; place-items: center; width: 12px; height: 11px; font-size: 9px; font-style: normal; font-weight: 400; line-height: 1; border: 1px solid #8799b1; border-radius: 2px; background: linear-gradient(#fff, #d6dfeb); }
.window-glyphs b { background: linear-gradient(#ff9b7d, #df4d29); color: white; border-color: #a26d5d; }
.hero-play { display: block; padding: 0; width: 100%; border: 0; position: relative; background: #d9dfd3; text-align: left; }
.hero-play img { display: block; width: 100%; height: auto; aspect-ratio: 9/16; object-fit: cover; }
.hero-play:after { content: ''; position: absolute; inset: 76% 0 0; background: linear-gradient(transparent, #16191570); pointer-events: none; }
.hero-play:focus-visible { outline-color: white; outline-offset: -6px; }
.play-circle { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 52px; height: 52px; border: 1px solid #ffffffaf; border-radius: 50%; background: #fbf8f2e8; color: #42536c; padding-left: 3px; font-size: 17px; }
.hero-play-label { position: absolute; bottom: 17px; left: 17px; right: 17px; z-index: 1; display: flex; justify-content: space-between; font-size: 12px; color: white; }
.featured-film figcaption { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 14px; }
.featured-film h2 { font-size: 15px; font-weight: 500; letter-spacing: -.02em; }
.featured-film figcaption>span { font-size: 8px; letter-spacing: .07em; color: var(--muted); }
.room-sidebar { min-width: 0; }
.episode-section { background: #f7f8fa; }
.library-toolbar { padding: 16px 16px 0; background: linear-gradient(#f9fafc, #edf1f7); border-bottom: 1px solid #b9c3d0; }
.filters { display: flex; gap: 3px; align-items: end; }
.filters button { min-height: 39px; border: 1px solid #b9c3d0; border-bottom: 0; border-radius: 4px 4px 0 0; padding: 10px 14px; background: linear-gradient(#f8faff, #dfe6f0); font-size: 11px; color: #58677d; position: relative; bottom: -1px; }
.filters button>span { font-size: 9px; margin-left: 5px; opacity: .65; }
.filters button[aria-pressed=true] { background: #fff; color: var(--ink); padding-top: 12px; min-height: 42px; box-shadow: inset 0 2px 0 #ccd9eb; }
.episode-grid { background: white; padding: 0 13px; }
.episode-card { border-bottom: 1px solid #e8ebef; }
.episode-card:last-child { border-bottom: 0; }
.episode-button { display: grid; grid-template-columns: 45px minmax(0, 1fr) 24px; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 3px; border: 0; background: transparent; }
.episode-poster { width: 45px; aspect-ratio: 4/5; overflow: hidden; border: 1px solid #b9c3cd; border-radius: 2px; background: #e7ecf3; }
.episode-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.episode-copy { display: block; min-width: 0; }
.episode-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 8px; line-height: 1.5; letter-spacing: .03em; color: var(--muted); }
.episode-badge { color: #526984; }
.episode-title { display: block; margin: 4px 0; font-size: 14px; font-weight: 500; line-height: 1.2; letter-spacing: -.015em; }
.episode-note { display: block; color: var(--muted); font-size: 10px; line-height: 1.4; }
.episode-action { display: grid; place-items: center; width: 24px; height: 28px; font-size: 17px; color: #586c87; }
.episode-action svg { width: 13px; height: 13px; }
.library-status { padding: 8px 12px; border-top: 1px solid #bdc7d5; box-shadow: inset 0 1px 0 white; font-size: 9px; color: var(--chrome-ink); background: #eaf0f7; }
.membership-invitation { margin: 24px 0 0; background: #f2f2ed; }
.invitation-content { padding: 21px 22px 0; }
.membership-invitation h2 { font-size: 25px; font-weight: 500; letter-spacing: -.035em; line-height: 1.1; }
#invitation-copy { margin-top: 9px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.member-perks { padding: 0; margin: 17px 0 10px; list-style: none; display: grid; gap: 10px; font-size: 12px; line-height: 1.45; }
.member-perks li { position: relative; padding-left: 19px; }
.member-perks li::before { content: ''; position: absolute; left: 0; top: .32em; width: 9px; height: 9px; border: 1px solid #a2adba; border-radius: 2px; background: linear-gradient(#fcfdff, #d5ddeb); }
.merch-link { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; font-size: 11px; color: #4e6078; text-decoration: underline; text-underline-offset: 3px; }
.merch-preview-note { margin-top: 3px; font-size: 10px; line-height: 1.5; color: var(--muted); }
.invitation-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; padding: 19px 22px 22px; }
#membership-state { font-size: 10px; line-height: 1.5; }
#membership-state small { font-size: 9px; color: var(--muted); }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 13px; min-height: 44px; padding: 12px 17px; border: 0; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 10px; letter-spacing: .045em; }
.preview-bar { max-width: 840px; margin: 30px auto 0; padding: 16px 0 30px; display: flex; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); }
.preview-bar p { font-size: 8px; line-height: 1.5; letter-spacing: .04em; }
.preview-bar p>span[aria-hidden] { margin: 0 6px; }
.preview-detail { display: block; font-size: 10px; margin-top: 5px; }
.text-button { border: 0; padding: 0; min-height: 44px; background: none; text-decoration: underline; text-underline-offset: 3px; font-size: 11px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 42px max(22px, env(safe-area-inset-bottom)); border-top: 1px solid #d8d2c84d; color: var(--muted); font-size: 10px; }
dialog { padding: 0; border: 1px solid var(--chrome-line); border-radius: 7px; color: var(--ink); background: var(--cream); box-shadow: 0 16px 44px #141e3c33; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); overscroll-behavior: contain; }
dialog::backdrop { background: #fbf8f299; backdrop-filter: blur(3px); }
.dialog-bar { height: 38px; padding-left: 12px; padding-right: 3px; position: sticky; top: 0; z-index: 2; font-size: 10px; }
.close-button { display: grid; place-items: center; width: 44px; height: 36px; padding: 0; background: none; border: 0; flex-shrink: 0; }
.close-button>span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 2px; border: 1px solid #a26d5d; color: white; background: linear-gradient(#ff9b7d, #df4d29); font-size: 15px; line-height: 1; }
.join-dialog { width: 420px; }
.join-body { padding: 26px; }
.join-thumbnail { float: right; width: 56px; height: 70px; object-fit: cover; margin-left: 14px; border: 1px solid var(--chrome-line); border-radius: 3px; }
.join-body .eyebrow { padding-top: 4px; font-size: 9px; letter-spacing: .08em; color: var(--chrome-ink); }
.join-body h2 { font-size: 29px; line-height: 1.05; font-weight: 500; letter-spacing: -.04em; margin: 16px 0; }
.join-body>p:not(.eyebrow):not(.preview-explanation):not(.merch-preview-note) { margin-bottom: 16px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.join-body .merch-preview-note { margin-bottom: 18px; }
.offer-row { padding: 14px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 15px; font-size: 12px; }
.offer-row strong { font-weight: 500; white-space: nowrap; }
.join-body .primary-button { width: 100%; margin-top: 14px; }
.preview-explanation { margin-top: 14px; font-size: 11px; line-height: 1.6; color: var(--muted); text-align: center; }
.watch-dialog { width: min(420px, calc((100dvh - 130px)*9/16)); }
.watch-dialog h2 { font-size: 11px; font-weight: 400; }
.watch-dialog video { display: block; width: 100%; aspect-ratio: 9/16; object-fit: contain; background: #111; }
.watch-note { padding: 12px; font-size: 10px; color: var(--muted); }
.watch-error { padding: 14px; font-size: 13px; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 10; background: var(--cream); padding: 16px; }
@media (hover:hover) and (pointer:fine) {
  .primary-button:hover { background: #364150; }
  .text-button:hover, .back-link:hover { color: #526984; }
  .episode-button:hover { background: #edf3fc; }
  .hero-play:hover .play-circle { background: white; }
  .filters button:not([aria-pressed=true]):hover { background: #f3f6fc; }
}
@media (max-width:850px) and (min-width:701px) {
  main { padding-left: 25px; padding-right: 25px; }
  .episode-room { grid-template-columns: minmax(0, 285px) minmax(0, 1fr); gap: 24px; }
  .episode-note { display: none; }
  .filters button { padding-left: 12px; padding-right: 12px; }
}
@media (max-width:700px) {
  .site-header { padding-left: max(22px, env(safe-area-inset-left)); padding-right: max(22px, env(safe-area-inset-right)); }
  .brand { font-size: 9px; }
  main { max-width: 450px; padding: 0 22px; }
  .show-masthead { padding: 34px 0 28px; }
  h1 { font-size: 41px; }
  .show-masthead>p { font-size: 13px; margin-top: 10px; }
  .episode-room { display: flex; flex-direction: column; gap: 24px; }
  .featured-episode { width: min(100%, 300px); margin: auto; }
  .featured-film figcaption { padding: 13px; }
  .room-sidebar { width: 100%; padding: 0; }
  .episode-button { grid-template-columns: 45px minmax(0, 1fr) 22px; gap: 11px; }
  .library-toolbar { padding-left: 12px; padding-right: 12px; }
  .filters button { padding-left: 13px; padding-right: 13px; min-height: 44px; }
  .filters button[aria-pressed=true] { min-height: 46px; }
  .membership-invitation { margin: 21px 0 0; }
  .invitation-content { padding: 20px 18px 0; }
  .invitation-action { padding: 18px; }
  .preview-bar { margin-top: 12px; padding-bottom: 25px; align-items: start; }
  .preview-detail { font-size: 9px; line-height: 1.5; max-width: 215px; }
  .preview-bar .text-button { font-size: 10px; text-align: right; min-height: 32px; }
  footer { padding-left: 22px; padding-right: 22px; }
  footer>span:first-of-type { display: none; }
  .join-body { padding: 22px; }
  .dialog-bar { height: 44px; }
  .close-button { height: 44px; }
}
@media (max-width:360px) {
  main { padding-left: 16px; padding-right: 16px; }
  h1 { font-size: 37px; }
  .episode-title { font-size: 13px; }
  .episode-note { display: none; }
  .filters button { padding-left: 11px; padding-right: 11px; }
  .join-body h2 { font-size: 26px; }
  .join-body { padding: 19px; }
}

/* Account controls share the existing window and type styles. */
.account-controls { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 17px; margin-top: 12px; font-size: 11px; color: var(--muted); }
#account-email { max-width: 100%; overflow-wrap: anywhere; }
.account-notice { margin: 12px auto 0; max-width: 520px; font-size: 12px !important; line-height: 1.5; }
#auth-form { display: grid; gap: 12px; }
#auth-form label { display: block; font-size: 12px; margin-bottom: 8px; }
#auth-form input { width: 100%; border: 1px solid #aab6c6; border-radius: 3px; padding: 12px; min-height: 46px; font: 16px 'Inter Tight', system-ui, sans-serif; color: var(--ink); background: white; }
#auth-form input:focus-visible { outline: 2px solid #566b95; outline-offset: 2px; }
.local-code-note { padding: 12px; margin-bottom: 16px; font-size: 12px; line-height: 1.6; background: #eaf0f7; border: 1px solid #bdc7d5; border-radius: 3px; }
.local-code-note strong { font-variant-numeric: tabular-nums; white-space: nowrap; }
.flow-error { font-size: 12px; line-height: 1.5; color: #9e3b2b; margin-top: 10px; }
.primary-button:disabled { opacity: .55; cursor: wait; }
