/* ---------- Explore page ----------
   A flex column filling the whole page: the header never scrolls (there's
   nothing above/below it to scroll — see .ex-stage), and .ex-stage takes the
   remaining height as the swipeable-pager viewport. */
.explore-view {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Header: title + display-mode switch, then the scrollable tab bar. No longer
   `position: sticky` — the page itself doesn't scroll now that each panel is
   its own scroll container (see .ex-panel), so there's nothing for it to
   stick against; it's just a fixed-height flex item at the top. */
.ex-header {
  position: relative;
  z-index: 3;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--color-bg) 78%, rgba(6, 7, 10, 0.92));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--color-border);
}

.ex-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: clamp(56px, 13vw, 68px);
  padding: env(safe-area-inset-top) var(--container-padding) 0;
}

/* ---------- Tab bar ---------- */
.ex-tabbar {
  position: relative;
  overflow: hidden;
}

.ex-tabbar-track {
  position: relative;
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-inline: var(--container-padding);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  /* Stops an overscrolled drag (past the first/last tab) from chaining to the
     page — same fix already applied to `.hero-track`. Covers both the
     top-level bar and each panel's secondary tab row, since both share this
     class. */
  overscroll-behavior-x: contain;
  /* The secondary (in-panel) instance of this bar lives inside `.ex-stage`,
     which restricts native horizontal panning so the top-level swipe pager
     owns that axis — this explicitly re-permits it for the sub-tab bar's own
     genuinely-horizontal-scrolling track (the top-level bar, in `.ex-header`,
     is outside `.ex-stage` and unaffected either way, so this is harmless
     there too). */
  touch-action: pan-x pan-y;
}

.ex-tabbar-track::-webkit-scrollbar {
  display: none;
}

.ex-tab {
  flex: 0 0 auto;
  position: relative;
  padding: var(--space-3) var(--space-3) calc(var(--space-3) + 2px);
  min-height: var(--tap-min);
  font-size: var(--fs-base);
  font-weight: 600;
  white-space: nowrap;
  color: var(--color-text-tertiary);
  transition: color var(--duration-base) var(--ease-standard);
}

.ex-tab:hover,
.ex-tab:focus-visible {
  color: var(--color-text-secondary);
}

.ex-tab.is-active {
  color: var(--color-accent-strong);
}

.ex-tab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 10px rgba(215, 163, 92, 0.55);
  transition: transform var(--duration-base) var(--ease-standard),
    width var(--duration-base) var(--ease-standard);
  pointer-events: none;
}

/* ---------- Display mode switcher ---------- */
.ex-mode {
  position: relative;
  display: flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
}

.ex-mode-thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / 2);
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, rgba(215, 163, 92, 0.3), rgba(215, 163, 92, 0.14));
  box-shadow: inset 0 0 0 1px rgba(236, 194, 127, 0.3);
  transition: transform var(--duration-base) var(--ease-standard);
}

.ex-mode-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.55rem;
  height: 1.8rem;
  border-radius: var(--radius-full);
  color: var(--color-text-tertiary);
  transition: color var(--duration-base) var(--ease-standard);
}

.ex-mode-btn svg {
  width: 17px;
  height: 17px;
}

.ex-mode-btn.is-active {
  color: var(--color-accent-strong);
}

/* ---------- Panels: horizontal pager ----------
   .ex-stage is the clipping viewport; .ex-track lays every panel out
   edge-to-edge (flex-wrap: nowrap, each child pinned to 100% of the stage's
   width so the row is naturally N-panels wide) and is translated by
   explore.js's drag handling / commit(). Each .ex-panel is its own vertical
   scroll container — this is what lets two adjacent panels be visible and
   independently scrolled mid-swipe, unlike the old shared-page-scroll model
   where only one panel was ever `display: block` at a time. */
.ex-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  /* Without this, the browser's own gesture recognizer is free to contest a
     horizontal drag (edge-swipe-back navigation on Safari/Android, or just
     ambiguous tap-vs-pan disambiguation delay) before explore.js's pointer
     handlers ever see clean deltas — `pan-y` tells it up front "vertical
     panning is native, horizontal is this element's own business," so
     nothing else claims the gesture. Declaring it here isn't enough by
     itself, though: every card/row is a <button>, and reset.css gives
     buttons `touch-action: manipulation` (permits *both* axes), which is
     more specific/later-declared than an ancestor restriction for touches
     landing directly on one — see the `.ex-card`/`.ex-row` override below,
     which is what actually makes this take effect on the cards themselves. */
  touch-action: pan-y;
}

.ex-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.ex-panel {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: calc(var(--bottom-nav-clearance) + var(--space-5));
  /* Lets the browser skip layout/paint for whichever panel(s) aren't
     currently on-screen — the same virtualization technique already used on
     individual cards/rows below, just applied at the panel level too. */
  content-visibility: auto;
  contain-intrinsic-size: auto 100vh;
}

/* ---------- Sort control (Genre/Country tabs, plus Animation) ----------
   A minimal text trigger — no border, no boxed/input appearance — showing
   only the currently selected option plus a small chevron; tapping it opens
   `sortMenu.js`'s custom bottom-sheet/centered-card popup (portaled to
   <body>, styled below) instead of a native <select> popup. Only rendered
   inside panels whose source is flagged `sortable` (see tabPanel.js), so it
   never shows up on unrelated tabs and switches with the top-level tab
   automatically.

   Those same 5 tabs also put a search icon button at the row's other end
   (added 2026-08-21). `justify-content: space-between` with the search
   button first in markup and the sort trigger second is deliberately the
   *only* layout rule needed for "search on one end, sort on the other,
   mirrored under RTL" — flexbox resolves "start"/"end" from `dir` on its
   own, so the search button lands left/sort right under LTR and the reverse
   under RTL with no direction-specific CSS at all. Don't add one; if this
   ever looks wrong in RTL, the bug is almost certainly a `left`/`right`
   creeping in somewhere else in this rule (or a `flex-direction:
   row-reverse`), not a missing override here. */
.ex-sortbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--container-padding) 0;
}

.ex-sort-trigger {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--tap-min);
  padding: 0 var(--space-1);
  margin-inline-end: calc(var(--space-1) * -1);
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: var(--fs-sm);
  font-weight: 600;
}

.ex-sort-trigger:hover,
.ex-sort-trigger:focus-visible {
  color: var(--color-text);
}

.ex-sort-trigger-icon {
  display: inline-flex;
  transition: transform var(--duration-fast) var(--ease-standard);
}

.ex-sort-trigger-icon svg {
  width: 1rem;
  height: 1rem;
  display: block;
}

.ex-sort-trigger[aria-expanded="true"] .ex-sort-trigger-icon {
  transform: rotate(180deg);
}

/* ---------- Sort options popup ----------
   Portaled to <body> when open (see sortMenu.js for why — a fixed-position
   descendant of the swipe pager's transformed `.ex-track` would resolve
   against that transform instead of the viewport), so these rules can't
   collide with anything under `.explore-view`. Same scrim + sliding-panel
   shape as detail/shareSheet.js's `.sh-*` rules, kept as separate,
   Explore-only classes rather than a shared component. */
.ex-sortmenu-layer {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
}

.ex-sortmenu-layer.is-open {
  pointer-events: auto;
}

.ex-sortmenu-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 5, 7, 0.62);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.ex-sortmenu-layer.is-open .ex-sortmenu-scrim {
  opacity: 1;
}

.ex-sortmenu-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--color-bg-elevated);
  border-top: 1px solid var(--color-border-strong);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -24px 64px rgba(0, 0, 0, 0.55);
  padding: var(--space-4) var(--space-4) calc(var(--space-5) + env(safe-area-inset-bottom));
  transform: translate3d(0, 100%, 0);
  transition: transform var(--duration-base) var(--ease-standard);
}

.ex-sortmenu-layer.is-open .ex-sortmenu-panel {
  transform: translate3d(0, 0, 0);
}

.ex-sortmenu-head {
  margin-bottom: var(--space-3);
}

.ex-sortmenu-title {
  font-size: var(--fs-md);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.ex-sortmenu-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-2);
  border-radius: var(--radius-md);
  color: var(--color-text-secondary);
  text-align: start;
  font-size: var(--fs-base);
  font-weight: 600;
  transition: background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.ex-sortmenu-option:hover,
.ex-sortmenu-option:focus-visible {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.ex-sortmenu-option.is-selected {
  color: var(--color-text);
}

.ex-sortmenu-option-check {
  display: inline-flex;
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  visibility: hidden;
  color: var(--color-accent);
}

.ex-sortmenu-option-check svg {
  width: 100%;
  height: 100%;
}

.ex-sortmenu-option.is-selected .ex-sortmenu-option-check {
  visibility: visible;
}

@media (min-width: 640px) {
  .ex-sortmenu-panel {
    inset-inline-start: auto;
    bottom: auto;
    top: 50%;
    inset-inline-end: var(--container-padding);
    width: min(100%, 22rem);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border-strong);
    transform: translate3d(0, -46%, 0);
  }

  .ex-sortmenu-layer.is-open .ex-sortmenu-panel {
    transform: translate3d(0, -50%, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ex-sortmenu-panel {
    transition: transform var(--duration-fast) linear;
  }
}

/* ---------- Secondary (in-panel) tab bar ----------
   Trending's Movie/Series and the Movies/Series by Country/Genre tabs reuse
   `.ex-tabbar`'s structure/behavior as-is (same `createTabBar()` factory,
   same tablist/roving-tabindex interaction as the top-level bar) but are
   restyled here as pill labels — matching Home's `.home-tabs`/`.home-tab`
   filter-tab look exactly (gold-gradient active pill, no sliding underline)
   instead of the top-level bar's underline-indicator look, since this row is
   filtering *within* an already-selected top-level tab rather than being a
   primary navigation choice. */
.ex-subtabbar {
  padding-block: var(--space-3) var(--space-2);
}

.ex-subtabbar .ex-tabbar-track {
  gap: var(--space-2);
}

.ex-subtabbar .ex-tab-indicator {
  display: none;
}

.ex-subtabbar .ex-tab {
  min-height: var(--tap-min);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border);
  background: var(--color-bg-elevated);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  transition: background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.ex-subtabbar .ex-tab:hover,
.ex-subtabbar .ex-tab:focus-visible {
  border-color: var(--color-border-strong);
  color: var(--color-text);
}

.ex-subtabbar .ex-tab:active {
  transform: scale(0.96);
}

.ex-subtabbar .ex-tab.is-active {
  color: var(--color-accent-strong);
  background: linear-gradient(180deg, rgba(215, 163, 92, 0.28) 0%, rgba(215, 163, 92, 0.12) 100%);
  border-color: rgba(236, 194, 127, 0.55);
  box-shadow: 0 6px 18px rgba(215, 163, 92, 0.14);
}

.ex-content {
  padding: var(--space-4) var(--container-padding) 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}

.ex-content.is-swapping {
  opacity: 0;
}

/* ---------- Card grid ---------- */
.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ex-card-min), 1fr));
  gap: var(--space-4) var(--space-3);
}

.ex-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-align: start;
  /* Overrides reset.css's `button { touch-action: manipulation }` (which
     permits *both* axes) back down to vertical-only — every card is a
     <button> and fills nearly the whole swipeable surface, so without this
     the pager's `.ex-stage { touch-action: pan-y }` has no effect on the
     touches that actually matter. See the .ex-stage comment for why this
     needs to be declared here specifically, not just on an ancestor. */
  touch-action: pan-y;
  /* Lets the browser skip layout/paint for offscreen cards — native-grade
     virtualization without maintaining a windowing implementation. */
  content-visibility: auto;
  contain-intrinsic-size: auto 260px;
  transition: transform var(--duration-base) var(--ease-standard);
}

.ex-card:active {
  transform: scale(0.97);
}

.ex-card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard);
}

.ex-card:hover .ex-card-poster,
.ex-card:focus-visible .ex-card-poster {
  box-shadow: var(--shadow-card-hover);
  border-color: var(--color-border-strong);
}

.ex-card-poster img,
.ex-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.ex-card-poster img.is-loaded,
.ex-row-thumb img.is-loaded {
  opacity: 1;
}

.ex-badge {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text);
  background: rgba(8, 9, 11, 0.74);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.ex-card-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ex-card-title {
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-card-fa {
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Collections tile ----------
   Name overlaid on the poster instead of a body row underneath — same
   treatment as Home's `.card-collection`/`.card-collection-title` (no
   rating/year/type meta, since a collection isn't a single title). */
.ex-card-collection-title {
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-3);
  font-size: var(--fs-base);
  font-weight: 700;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), transparent);
}

.ex-row-collection .ex-row-title {
  white-space: normal;
}

/* ---------- Removable-tile control (Following/Watchlist) ----------
   The card/row is itself a <button>, so the remove control is a sibling
   inside a positioning wrapper rather than nested inside it. Shared by the
   Following tab's unfollow action and the Watchlist tab's remove action. */
.ex-tile-wrap {
  position: relative;
}

.ex-tile-remove-btn {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-full);
  color: var(--color-text);
  background: rgba(8, 9, 11, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--color-border);
  touch-action: pan-y;
  transition: background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.ex-tile-remove-btn svg {
  width: 1rem;
  height: 1rem;
}

.ex-tile-remove-btn:hover,
.ex-tile-remove-btn:focus-visible {
  background: rgba(229, 98, 106, 0.22);
  border-color: rgba(229, 98, 106, 0.4);
  color: var(--color-danger);
}

.ex-tile-wrap-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.ex-tile-wrap-row > .ex-row {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.ex-tile-remove-btn-row {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: var(--radius-full);
  color: var(--color-text-secondary);
  touch-action: pan-y;
  transition: background-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard);
}

.ex-tile-remove-btn-row svg {
  width: 1.1rem;
  height: 1.1rem;
}

.ex-tile-remove-btn-row:hover,
.ex-tile-remove-btn-row:focus-visible {
  background: var(--color-surface-hover);
  color: var(--color-danger);
}

.ex-card-meta,
.ex-row-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
  font-size: var(--fs-xs);
  color: var(--color-text-secondary);
}

.ex-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  color: var(--color-rating);
}

.ex-rating svg {
  width: 12px;
  height: 12px;
}

/* ---------- List view ---------- */
.ex-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ex-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: var(--tap-min);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  text-align: start;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border);
  /* Same override as .ex-card — a <button>, and list mode's rows are just as
     much of the swipeable surface as grid mode's cards. */
  touch-action: pan-y;
  content-visibility: auto;
  contain-intrinsic-size: auto 92px;
  transition: background-color var(--duration-fast) var(--ease-standard),
    transform var(--duration-fast) var(--ease-standard);
}

.ex-row:hover,
.ex-row:focus-visible {
  background: var(--color-surface-hover);
}

.ex-row:active {
  transform: scale(0.99);
}

.ex-row-thumb {
  position: relative;
  flex-shrink: 0;
  width: clamp(3rem, 13vw, 3.75rem);
  aspect-ratio: 2 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface);
}

.ex-row-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.ex-row-title {
  font-size: var(--fs-base);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-row-fa {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  text-align: start;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ex-row-type {
  padding: 1px var(--space-2);
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-strong);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-secondary);
}

.ex-row-extra {
  color: var(--color-text-tertiary);
}

/* ---------- Entry animation ---------- */
.ex-enter {
  animation: ex-fade-in var(--duration-base) var(--ease-standard) both;
  animation-delay: var(--stagger, 0ms);
}

@keyframes ex-fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- Skeletons ---------- */
.ex-skeleton {
  pointer-events: none;
}

.ex-skeleton .skeleton,
.ex-skeleton.skeleton {
  animation-delay: var(--stagger, 0ms);
}

.ex-skeleton .skeleton-line {
  height: 10px;
  border-radius: 4px;
}

.skeleton-line.w-55 {
  width: 55%;
}

.ex-card.ex-skeleton .ex-card-poster {
  border: none;
  box-shadow: none;
}

.ex-row.ex-skeleton {
  background: var(--color-bg-elevated);
}

.ex-row.ex-skeleton .ex-row-body {
  gap: var(--space-2);
}

/* ---------- Footer: more-skeletons / errors / end ---------- */
.ex-footer {
  padding-inline: var(--container-padding);
}

.ex-more {
  margin-top: var(--space-4);
}

.ex-more.ex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--ex-card-min), 1fr));
  gap: var(--space-4) var(--space-3);
}

.ex-more.ex-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.ex-end {
  padding: var(--space-6) 0 var(--space-2);
  text-align: center;
  font-size: var(--fs-sm);
  color: var(--color-text-tertiary);
}

.ex-inline-error {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(229, 98, 106, 0.35);
  background: rgba(229, 98, 106, 0.1);
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
}

.ex-inline-error svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--color-danger);
}

.ex-inline-error-text {
  flex: 1;
  min-width: 0;
}

.ex-inline-error-retry {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--color-accent-strong);
}

.ex-sentinel {
  height: 1px;
}

/* ---------- Empty / error states ---------- */
.ex-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-8) var(--space-4);
}

.ex-state-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 7rem;
  height: 7rem;
  margin-bottom: var(--space-3);
}

.ex-state-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--color-border-strong);
  background: radial-gradient(circle at 50% 35%, rgba(215, 163, 92, 0.16), transparent 68%);
}

.ex-state-ring-2 {
  inset: 1.25rem;
  border-color: var(--color-border);
  background: none;
}

.ex-state-glyph {
  position: relative;
  color: var(--color-accent-strong);
}

.ex-state-glyph svg {
  width: 30px;
  height: 30px;
}

.ex-state-title {
  font-size: var(--fs-md);
  font-weight: 700;
}

.ex-state-message {
  font-size: var(--fs-sm);
  color: var(--color-text-secondary);
  max-width: 32ch;
}

.ex-state-btn {
  margin-top: var(--space-4);
}

.ex-state-btn svg {
  width: 16px;
  height: 16px;
}

/* ---------- Pull to refresh ---------- */
.ex-pull {
  --pull: 0px;
  position: absolute;
  top: calc(var(--pull) - 2.5rem);
  left: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-left: -1.125rem;
  border-radius: 50%;
  background: var(--color-bg-elevated);
  border: 1px solid var(--color-border-strong);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transition: top var(--duration-fast) var(--ease-standard),
    opacity var(--duration-fast) var(--ease-standard);
}

.ex-pull.is-pulling {
  opacity: 1;
}

.ex-pull-icon {
  display: flex;
  color: var(--color-text-secondary);
  transition: transform var(--duration-base) var(--ease-standard),
    color var(--duration-base) var(--ease-standard);
}

.ex-pull-icon svg {
  width: 18px;
  height: 18px;
}

.ex-pull.is-ready .ex-pull-icon {
  transform: rotate(180deg);
  color: var(--color-accent-strong);
}

.ex-pull.is-refreshing {
  opacity: 1;
}

.ex-pull.is-refreshing .ex-pull-icon {
  animation: ex-spin 0.8s linear infinite;
  color: var(--color-accent-strong);
}

@keyframes ex-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ex-enter {
    animation: none;
  }

  .ex-track {
    transition: none !important;
  }
}
