/* Plans (views/plans.js): a numbered queue in the member's order, what is in
   progress above it, and "What tonight?" as the one solid action. */

.hub-main > .plans { max-width: 1320px; margin: 0 auto 80px; }
.plans-body { max-width: 920px; }
.plans-doing { margin: 0 0 32px; }
.plans-doing h2, .plans-head h2 { display: flex; align-items: baseline; gap: 10px; margin: 0; font: 600 24px/1.2 var(--font-display); letter-spacing: -0.02em; }
.plans-doing h2 small, .plans-head h2 small { color: var(--ink-3); font: 500 13px/1 var(--font-mono); }
.plans-doing-row { display: flex; flex-wrap: nowrap; align-items: start; gap: 20px; max-width: 100%; overflow-x: auto; scroll-snap-type: x proximity; margin: 14px 0 0; padding: 3px 3px 12px; list-style: none; }
.plans-doing-row:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; border-radius: 4px; }
.plans-doing-row li { flex: 0 0 320px; display: grid; grid-template-columns: 72px minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; scroll-snap-align: start; }
.plans-doing-row .plan-open { display: block; width: 100%; }
.doing-text { display: grid; justify-items: start; gap: 8px; min-width: 0; }
.plans-doing-row .plan-done { min-height: 44px; height: auto; padding: 8px 12px; border: 1px solid var(--line-2, var(--ink-3)); background: var(--glass-tray, var(--bg-2)); color: var(--ink); white-space: normal; text-align: left; }
.plans-reorder[aria-pressed='true'] { background: var(--ink); color: var(--bg); }
.plans-doing-row b { font: 600 14.5px/1.3 var(--font-display); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.doing-art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px; background: var(--glass-tray, var(--bg-2)); box-shadow: 0 18px 26px -20px rgb(var(--shade, 0 0 0) / .8); }
.doing-art[data-aspect='square'] { aspect-ratio: 1; }
.doing-art img, .plan-art img, .tonight-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.doing-art > b, .plan-art > b, .tonight-art > b { font: 600 18px/1 var(--font-display); color: var(--ink-2); }

.plans-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin: 0 0 10px; }
.plans-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.plans-kinds button { font-family: var(--font-ui); min-width: 0; }
.plans-list { margin: 0; padding: 0; list-style: none; }
.plan { display: grid; grid-template-columns: 30px auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-n { color: var(--ink-3); font: 500 14px/1 var(--font-mono); text-align: right; }
.plan-open { padding: 0; border: 0; background: none; cursor: pointer; border-radius: 4px; }
.plan-open:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
.plan-art { position: relative; display: grid; place-items: center; width: 50px; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 3px; background: var(--glass-tray, var(--bg-2)); box-shadow: 0 8px 14px -10px rgb(var(--shade, 0 0 0) / .7); }
.plan-art[data-aspect='square'] { aspect-ratio: 1; }
.plan-text { display: grid; gap: 4px; min-width: 0; }
.plan-text > b { font: 600 16px/1.3 var(--font-display); letter-spacing: -0.015em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-text > small { color: var(--ink-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plan-note { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.plan-note p { margin: 0; color: var(--ink); font-size: 14px; font-style: italic; overflow-wrap: anywhere; }
.plan-note-field { width: min(100%, 420px); min-height: 44px; }
.plan-actions { display: flex; align-items: center; gap: 2px; }
.plan-start { margin: 0 4px; }

.tonight { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: end; gap: 20px; }
.tonight-art { position: relative; display: grid; place-items: center; width: 140px; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px; background: var(--glass-tray, var(--bg-2)); box-shadow: 0 22px 30px -22px rgb(var(--shade, 0 0 0) / .8); }
.tonight-art[data-aspect='square'] { aspect-ratio: 1; }
.tonight-text h3 { margin: 0 0 6px; font: 650 26px/1.15 var(--font-display); letter-spacing: -0.025em; }
.tonight-text p { margin: 0; color: var(--ink-2); }
.tonight-text .tonight-note { margin-top: 12px; color: var(--ink); font-style: italic; }

@media (max-width: 720px) {
  .plan { grid-template-columns: 22px auto minmax(0, 1fr); grid-template-areas: 'n art text' '. . actions'; gap: 6px 10px; }
  .plan > .plan-n { grid-area: n; }
  .plan > .plan-open { grid-area: art; }
  .plan > .plan-text { grid-area: text; }
  .plan > .plan-actions { grid-area: actions; justify-content: flex-start; flex-wrap: wrap; }
  .plan-art { width: 42px; }
  .plans-doing-row { gap: 16px; }
  .plans-doing-row li { flex-basis: 285px; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; }
  .plans-tools { width: 100%; }
  .plans-kinds { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .plans-kinds button { flex: none; }
  .plans-doing-row .btn:not(.plan-done) { padding: 0 8px; font-size: 13px; gap: 4px; }
  .tonight { grid-template-columns: 100px minmax(0, 1fr); }
  .tonight-art { width: 100px; }
}

/* ---- the member's places on the home page (panels/places.js) ---- */
.places { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0 0 28px; }
.places[hidden] { display: none; }
.place-card {
  display: grid; gap: 14px; align-content: space-between; min-height: 132px; padding: 16px 18px; border-radius: var(--r-panel, 26px);
  background: var(--glass-tray, var(--bg-2)); box-shadow: inset 0 1px 0 var(--rim, transparent), inset 0 0 0 1px var(--rim-soft, var(--line)), 0 26px 50px -38px rgb(var(--shade, 0 0 0) / .7);
  color: var(--ink); text-decoration: none; transition: transform .25s var(--ease), background .25s var(--ease);
}
.place-card:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--ink) 6%, var(--glass-tray, var(--bg-2))); }
.place-card:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
.place-head { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 550; }
.place-head .i svg { width: 17px; height: 17px; }
.place-body { display: flex; align-items: end; justify-content: space-between; gap: 12px; min-width: 0; }
.place-text { display: grid; gap: 6px; min-width: 0; }
.place-text b { font: 650 34px/1 var(--font-display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.place-text small { color: var(--ink-2); font-size: 13.5px; line-height: 1.4; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.place-covers { display: flex; flex: none; }
.place-cover { position: relative; display: grid; place-items: center; width: 38px; aspect-ratio: 2 / 3; margin-left: -12px; overflow: hidden; border-radius: 3px; background: var(--bg-3, var(--bg-2)); box-shadow: 0 6px 12px -6px rgb(var(--shade, 0 0 0) / .7), 0 0 0 2px var(--bg); }
.place-cover:first-child { margin-left: 0; }
.place-cover > b { font: 600 13px/1 var(--font-display); color: var(--ink-2); }
.place-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
  /* three small tiles side by side: the place and its figure; the rest is on the place itself */
  .places { gap: 8px; }
  .place-card { min-height: 0; gap: 8px; padding: 12px; border-radius: 18px; }
  .place-head { font-size: 12.5px; gap: 6px; }
  .place-text b { font-size: 22px; }
  .place-covers { display: none; }
  .place-text small { -webkit-line-clamp: 1; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) { .place-card { transition: none; } .place-card:hover { transform: none; } }

/* a series in progress: the next episode under its name */
.doing-next { color: var(--ink-2); font: 500 12.5px/1.3 var(--font-ui); }
.doing-next[hidden] { display: none; }

/* ---- what friends recommend (panels/advice.js), above the catalogue ---- */
.advice { margin: 0 0 30px; }
.advice[hidden], .advice.is-searching { display: none; }
.advice-head h2 { margin: 0 0 12px; font: 600 24px/1.2 var(--font-display); letter-spacing: -0.02em; }
.advice-row { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; padding-bottom: 10px; -webkit-mask-image: linear-gradient(90deg, #000 92%, transparent); mask-image: linear-gradient(90deg, #000 92%, transparent); }
@media (pointer: coarse) { .advice-row { scrollbar-width: none; } .advice-row::-webkit-scrollbar { display: none; } }
.advice-title { flex: 0 0 150px; display: grid; gap: 6px; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; scroll-snap-align: start; }
.advice-title:focus-visible { outline: none; }
.advice-title:focus-visible .advice-art { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; }
.advice-art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; border-radius: 4px; background: var(--glass-tray, var(--bg-2)); box-shadow: 0 18px 26px -20px rgb(var(--shade, 0 0 0) / .8); }
.advice-art[data-aspect='square'] { aspect-ratio: 1; }
.advice-art > b { padding: 10px; font: 600 14px/1.3 var(--font-display); text-align: center; overflow-wrap: anywhere; }
.advice-art.is-loaded > b { visibility: hidden; }
.advice-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.advice-name { font: 600 14.5px/1.3 var(--font-display); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; hyphens: auto; }
.advice-title small { color: var(--ink-2); font-size: 12.5px; line-height: 1.35; }
@media (max-width: 560px) { .advice-title { flex-basis: 38vw; } }
.advice-frame { display: flex; align-items: flex-end; aspect-ratio: 2 / 3; }
.advice-words { color: var(--ink-2); font-style: italic; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }

/* ---- premieres the world is waiting for (panels/premieres.js), on Explore ---- */
.premiere-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; }
.premiere-head h2 { margin: 0; }
.premiere-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-width: 0; }
.premiere-kinds { max-width: 100%; }
.premiere-kinds[hidden], .premiere-kinds button[hidden] { display: none; }
.premiere-calendar { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--ink-2); font: 600 13.5px/1.2 var(--font-ui); text-decoration: none; text-underline-offset: 3px; }
.premiere-calendar:hover { color: var(--ink); text-decoration: underline; }
.premiere-calendar:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; border-radius: 6px; }
.premiere-calendar .i { width: 18px; height: 18px; }
/* a cover is its own container: the want toggle sits at the bottom of a cover 1.5 widths tall */
.premiere-row { container-type: inline-size; }
.premiere { position: relative; container-type: inline-size; flex: 0 0 150px; display: flex; flex-direction: column; scroll-snap-align: start; }
.premiere .advice-title { flex: none; }
.premiere .advice-frame { position: relative; }
.premiere-line { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  /* two covers and a half of the row */
  .premiere-row { gap: 12px; }
  .premiere { flex-basis: calc((100cqw - 24px) / 2.5); }
  .premiere-head h2 { flex-basis: 100%; }
  .premiere-kinds button { height: 36px; padding: 0 11px; }
}
/* the date: a small tile on the cover's corner, on a surface of its own, never text straight on the picture */
.premiere-badge, .premiere-want { background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.premiere-badge { position: absolute; top: 8px; left: 8px; z-index: 1; display: grid; justify-items: center; gap: 2px; min-width: 38px; padding: 5px 8px 4px; border: 1px solid var(--line-2); border-radius: var(--r-2); color: var(--ink); font-family: var(--font-ui); text-align: center; box-shadow: var(--shadow-1); pointer-events: none; }
.premiere-badge b { font: 700 18px/1 var(--font-ui); font-variant-numeric: tabular-nums; }
.premiere-badge i { color: var(--ink-2); font: 650 10.5px/1 var(--font-ui); font-style: normal; letter-spacing: 0.06em; text-transform: uppercase; }
.premiere-badge.is-month i, .premiere-badge.is-word, .premiere-badge.is-out { color: var(--ink); font: 700 12px/1.2 var(--font-ui); padding: 7px 9px; }
.premiere-badge.is-month i { color: var(--ink); font-size: 12px; }
.premiere-badge.is-out { color: var(--ok, var(--ink)); }
/* the want toggle: round, on the cover's bottom-right; a hit area of 36px, and a sibling of the card's button, so it never opens it */
.premiere-want { position: absolute; right: 8px; top: calc(150cqw - 44px); z-index: 1; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-1); transition: opacity 0.15s, background-color 0.15s; }
.premiere-want .i { width: 18px; height: 18px; }
.premiere-want[aria-pressed='true'] { border-color: transparent; background: var(--ink); color: var(--bg); }
.premiere-want[data-status='want'] svg { fill: currentColor; }
.premiere-want:disabled { cursor: default; }
.premiere-want:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .premiere-want { opacity: 0.7; }
  .premiere:hover .premiere-want, .premiere:focus-within .premiere-want, .premiere-want[aria-pressed='true'] { opacity: 1; }
}
/* the row's places while it waits: the final size, so nothing jumps when the covers arrive */
.premiere.is-skeleton .advice-art { width: 100%; }
.premiere-sk-badge { position: absolute; top: 8px; left: 8px; width: 40px; height: 40px; border-radius: var(--r-2); }
.premiere-sk-want { position: absolute; right: 8px; top: calc(150cqw - 44px); width: 36px; height: 36px; border-radius: 50%; }
.premiere-credit { margin: 4px 0 0; color: var(--ink-3); font-size: 12.5px; }
.premiere-credit a { color: var(--ink-2); text-underline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .premiere-want, .row-arrow { transition: none; } }

/* ---- arrows over a row that scrolls sideways (row-arrows.js): a mouse only ---- */
.row-wrap { position: relative; --card: 150px; }
@media (max-width: 560px) { .row-wrap { --card: 38vw; } }
/* the fade at the right edge says "more": only while there is */
.row-wrap:not(.has-more) > .advice-row { -webkit-mask-image: none; mask-image: none; }
.row-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .row-arrow { position: absolute; top: calc(var(--card) * 0.75 - 18px); z-index: 2; display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--ink); box-shadow: var(--shadow-2); cursor: pointer; transition: background-color 0.15s; }
  .row-arrow[hidden] { display: none; }
  .row-arrow svg { width: 18px; height: 18px; }
  .row-arrow.is-left { left: 6px; }
  .row-arrow.is-right { right: 6px; }
  .row-arrow:hover { background: var(--bg); }
  .row-arrow:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 2px; }
}

/* ---- new episodes of the series one is watching (panels/new-episodes.js) ---- */
.newep { margin: 0 0 28px; }
.newep[hidden] { display: none; }
.newep h2.newep-kicker { margin: 0 0 10px; color: var(--ink-3); font: 600 12px/1.2 var(--font-ui); letter-spacing: 0.08em; text-transform: uppercase; }
.newep-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.newep-groups { display: grid; gap: 18px; }
@media (min-width: 900px) { .newep-groups:has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.newep-group { min-width: 0; }
.newep-credit { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; color: var(--ink-3); font-size: 12.5px; }
.newep-credit a { color: var(--ink-2); text-underline-offset: 3px; }
.newep-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px; border-radius: 16px; background: var(--glass-tray, var(--bg-2)); box-shadow: inset 0 0 0 1px var(--rim-soft, var(--line)); }
.newep-open { flex: 1; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; min-width: 0; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; }
.newep-open b { font: 600 15px/1.3 var(--font-display); white-space: nowrap; }
.newep-open > span { color: var(--ink-2); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.newep-open small { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; }
/* friends waiting for the same title: a few overlapping faces */
.newep-friends { display: inline-flex; font-style: normal; }
.newep-face { position: relative; display: grid; place-items: center; width: 20px; height: 20px; overflow: hidden; border-radius: 50%; background: hsl(var(--hue, 220) 45% 62%); box-shadow: 0 0 0 2px var(--bg); color: #fff; font: 600 10px/1 var(--font-ui); font-style: normal; }
.newep-face + .newep-face { margin-left: -6px; }
.newep-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.newep-face.is-more { background: var(--fill); color: var(--ink-2); }
.newep-open:focus-visible { outline: 2px solid var(--focus, var(--ink)); outline-offset: 3px; border-radius: 8px; }
@media (max-width: 560px) { .newep-open { grid-template-columns: 1fr; gap: 2px; } }

/* A failed save stays beside the work, with explicit recovery. */
.plans-save { max-width: 920px; margin-bottom: 20px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.plans-save[hidden], .plans-save-actions [hidden] { display: none; }
.plans-save p { margin: 0 0 8px; }
.plans-save-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plans-save-actions .btn { min-height: 44px; }
.plan-note-field[aria-invalid="true"] { border-color: var(--danger, #a63e3e); }
.newep-row { transition: opacity .2s var(--ease); }
.newep-row.is-leaving { opacity: 0; }
.newep-row .btn { min-height: 44px; }
@media (prefers-reduced-motion: reduce) { .newep-row { transition: none; } }
