/* Logged-in Stella app shell (Browse). Tokens come from hero-section-v4.css. */

body[data-page="app"] {
  --sh-surface: var(--hs4-bg);
  --hs4-header-pad-top: max(clamp(14px, 1.8vw, 22px), env(safe-area-inset-top, 0px));
  --hs4-header-pad-bottom: clamp(10px, 1.2vw, 14px);
  --sh-header-bg: var(--hs4-surface);
  --sh-header-deep: var(--hs4-ink);
  --sh-on-header: var(--hs4-text);
  --sh-on-header-muted: color-mix(in srgb, var(--hs4-text) 65%, transparent);
  --sh-header-active: var(--hs4-selected);
  --sh-on-header-active: var(--hs4-on-selected);
  --sh-accent: var(--hs4-text);
  --sh-accent-bright: var(--hs4-green);
  --sh-on-surface: var(--hs4-text);
  --sh-on-muted: color-mix(in srgb, var(--hs4-text) 72%, var(--hs4-bg));
  --sh-on-subtle: color-mix(in srgb, var(--hs4-text) 58%, var(--hs4-bg));
  --sh-card-fill: var(--hs4-surface);
  --sh-card-border: color-mix(in srgb, var(--hs4-text) 18%, transparent);
  --sh-card-soft: color-mix(in srgb, var(--hs4-green) 14%, var(--hs4-bg));
  --sh-pick-card-fill: color-mix(in srgb, var(--hs4-ink) 12%, var(--hs4-surface));
  --sh-on-card: var(--hs4-text);
  --sh-chip-fill: color-mix(in srgb, var(--hs4-yellow) 12%, var(--hs4-surface));
  --sh-chip-border: color-mix(in srgb, var(--hs4-text) 28%, transparent);
  --sh-primary: var(--hs4-action);
  --sh-on-primary: var(--hs4-on-action);
  --sh-primary-hover: var(--hs4-action-hover);
  --sh-focus: var(--hs4-focus);
  --sh-search-fill: var(--hs4-surface);
  --sh-on-search: var(--hs4-text);
  --sh-border: var(--sh-card-border);
  --sh-font-ui: var(--hs4-font-inter);
  --sh-font-body: var(--hs4-font-inter);
  --sh-font-display: var(--hs4-font-serif);
  --site-radius-point: 0px;
  --site-radius-pill: 999px;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--hs4-bg);
  color: var(--hs4-text);
  font-family: var(--hs4-font-inter);
}

html[data-theme="dark"] body[data-page="app"] {
  /* --sh-primary also colours text and edges; on charcoal those need the
     brighter step. Filled buttons read --hs4-action directly. */
  --sh-primary: var(--hs4-orange-text);
  --sh-card-fill: color-mix(in srgb, var(--hs4-surface) 92%, var(--hs4-white));
  --sh-card-soft: color-mix(in srgb, var(--hs4-green) 16%, var(--hs4-surface));
  --sh-chip-fill: color-mix(in srgb, var(--hs4-yellow) 10%, var(--hs4-surface));
  --sh-search-fill: var(--hs4-surface);
  --sh-on-search: var(--hs4-text);
  --sh-pick-card-fill: color-mix(in srgb, var(--hs4-white) 8%, var(--hs4-surface));
}

.stella-app-root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.stella-app-header {
  --app-header-h: 56px;
  position: sticky;
  top: 0;
  z-index: 110;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  min-height: var(--app-header-h);
  gap: 12px 18px;
  padding-top: var(--hs4-header-pad-top, 14px);
  padding-bottom: var(--hs4-header-pad-bottom, 12px);
  padding-inline: var(--hs4-header-pad-x, clamp(16px, 4vw, 48px));
  border-bottom: 1px solid color-mix(in srgb, var(--hs4-text) 12%, transparent);
  background: var(--hs4-surface);
}

.stella-app-wordmark {
  display: inline-flex;
  align-items: center;
  height: var(--hs4-header-control-h, 48px);
  text-decoration: none;
}

/* Same size as the home page's wordmark (.hs4-logo img). */
.stella-app-wordmark img {
  display: block;
  height: 100%;
  max-height: var(--hs4-header-control-h, 48px);
  width: auto;
}

@media (max-width: 420px) {
  .stella-app-wordmark img {
    max-height: calc(var(--hs4-header-control-h, 48px) - 10px);
  }
}

/* Desktop nav (phones use the tab bar, .stella-app-tabs). The items are set
   like the page titles, not like a control, so they never read as one more
   filter pill: the current page is ink with a small orange star in front,
   the other one is grey. No fill and no green, which stays for "chosen".
   Every item keeps the star's slot, filled only on the current page, so the
   words stay where they are when the page changes. */
.stella-app-nav {
  --stella-nav-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0C12.8 7.5 16.5 11.2 24 12 16.5 12.8 12.8 16.5 12 24 11.2 16.5 7.5 12.8 0 12 7.5 11.2 11.2 7.5 12 0Z'/%3E%3C/svg%3E");
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}

.stella-app-nav-link {
  display: inline-flex;
  align-items: center;
  height: var(--hs4-header-control-h, 48px);
  padding: 0 4px;
  border-radius: 6px;
  color: var(--hs4-muted-text);
  font: 400 25px / 1 var(--hs4-font-serif);
  letter-spacing: -0.005em;
  text-decoration: none;
}

.stella-app-nav-link:hover,
.stella-app-nav-link[aria-current="page"] {
  color: var(--hs4-text);
}

.stella-app-nav-link::before {
  content: "";
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  margin-right: 8px;
  background: transparent;
  -webkit-mask: var(--stella-nav-star) center / contain no-repeat;
  mask: var(--stella-nav-star) center / contain no-repeat;
}

.stella-app-nav-link[aria-current="page"]::before {
  background: var(--hs4-orange);
}

/* Forced colours drop the star's fill and paint both links alike. */
@media (forced-colors: active) {
  .stella-app-nav-link[aria-current="page"] {
    text-decoration: underline;
  }

  .stella-app-nav-link::before {
    display: none;
  }
}

.stella-app-header-end {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.stella-app-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stella-app-avatar,
.stella-app-avatar-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  background: color-mix(in srgb, var(--hs4-green) 28%, var(--hs4-surface));
  color: var(--hs4-text);
  font: 700 12px / 32px var(--hs4-font-inter);
  text-align: center;
}

.stella-app-user-name {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font: 500 14px / 1.2 var(--hs4-font-inter);
}

.stella-app-signout,
.stella-app-retry,
.stella-app-home {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font: 500 14px / 1 var(--hs4-font-inter);
  text-decoration: none;
  color: inherit;
}

.stella-app-signout,
.stella-app-home {
  background: transparent;
  color: var(--hs4-login-ink);
}

.stella-app-signout:hover,
.stella-app-home:hover {
  color: var(--hs4-login-ink-hover);
}

.stella-app-retry {
  background: var(--hs4-action);
  color: var(--hs4-on-action);
  font-weight: 600;
}

.stella-app-retry:hover {
  background: var(--hs4-action-hover);
  color: var(--hs4-on-action);
  box-shadow: inset 0 0 0 1.5px var(--hs4-action-ring);
}

.stella-app-retry:active {
  background: var(--hs4-action-press);
  box-shadow: inset 0 0 0 1.5px var(--hs4-action-ring);
}

.stella-app-retry:disabled {
  opacity: 0.6;
  cursor: wait;
}

.stella-app-header .sh-theme-toggle {
  flex: 0 0 auto;
}

/* Signed in, the account menu has the theme switch (app.js hides this one). */
.stella-app-header .sh-theme-toggle[hidden] {
  display: none;
}

.stella-app-main {
  flex: 1 1 auto;
  width: min(100% - 32px, var(--app-main-max, 960px));
  --app-gutter: 16px;
  margin: 0 auto;
  padding: 20px 0 64px;
}

.stella-app-main:focus {
  outline: none;
}

.stella-browse-title {
  margin: 0 0 6px;
  font: var(--hs4-header-md);
  font-size: clamp(1.5rem, 2.2vw, 1.85rem);
  color: var(--hs4-text);
}

.stella-browse-lead {
  margin: 0 0 16px;
  max-width: 46ch;
  color: var(--sh-on-muted);
  font-size: 14px;
  line-height: 1.5;
}

.stella-browse-search .sh-search-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 16px;
  border: 2px solid var(--hs4-search-edge);
  border-radius: 999px;
  background: var(--hs4-surface);
}

/* Focused text fields: the edge itself turns the focus blue (one line, no
   second ring around the green edge). */
.stella-browse-search .sh-search-form:focus-within {
  border-color: var(--hs4-focus);
  box-shadow: 0 0 0 1px var(--hs4-focus);
  outline: none;
}

.stella-browse-search .sh-search-form-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--hs4-muted-text);
}

.stella-browse-search .sh-search-form-icon svg {
  width: 20px;
  height: 20px;
}

.stella-browse-search .sh-search-input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--hs4-text);
  font: 400 16px / 1.3 var(--hs4-font-inter);
}

.stella-browse-search .sh-search-input:focus {
  outline: none;
}

.stella-browse-results {
  margin-top: 18px;
  min-height: 180px;
}

.stella-browse-hits {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stella-browse-hits .sh-search-hit + .sh-search-hit {
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 8%, transparent);
}

.stella-browse-hits .sh-search-hit {
  padding: 12px 8px;
  border-radius: 8px;
}

.stella-browse-hits .sh-search-hit--grouped {
  border-radius: 0;
}

.stella-browse-hits .sh-search-group-head {
  grid-column: 1 / -1;
  margin-bottom: 2px;
}

.stella-browse-hits .sh-search-hit:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: 2px;
}

.stella-browse-hits .sh-search-hit-poster {
  width: 40px;
  height: 60px;
  min-width: 40px;
  min-height: 60px;
  max-width: 40px;
  max-height: 60px;
}

.stella-browse-hits .sh-search-hit-title {
  font-size: 16px;
}

.stella-app-gate {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 20px 72px;
  text-align: center;
}

.stella-app-gate h1 {
  margin: 0;
  font: var(--hs4-header-md);
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}

.stella-app-gate p {
  margin: 0;
  max-width: 42ch;
  color: var(--sh-on-muted);
  font-size: 15px;
  line-height: 1.5;
}

.stella-app-gate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.stella-app-gate[aria-busy="true"] .stella-app-retry {
  pointer-events: none;
}

@media (max-width: 720px) {
  .stella-app-user-name,
  .stella-app-nav,
  .stella-app-header .sh-theme-toggle {
    display: none;
  }

  .stella-app-header {
    gap: 10px;
  }

  .stella-app-main {
    width: min(100% - 32px, var(--app-main-max, 960px));
    padding: 16px 0 calc(56px + env(safe-area-inset-bottom, 0px) + 24px);
  }

  .stella-browse-lead {
    display: none;
  }

  .stella-view-btn-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .stella-view-btn {
    width: 44px;
    padding: 0;
  }
}

.stella-app-header .hs4-login:focus-visible,
.stella-app-wordmark:focus-visible,
.stella-app-nav-link:focus-visible,
.stella-app-signout:focus-visible,
.stella-app-retry:focus-visible,
.stella-app-home:focus-visible,
.sh-theme-toggle:focus-visible,
.stella-app-account-btn:focus-visible,
.stella-view-btn:focus-visible,
.stella-track-btn:focus-visible,
.stella-row-open:focus-visible,
.stella-tile-open:focus-visible,
.stella-chip:focus-visible,
.sh-search-filter:focus-visible,
.stella-app-tab:focus-visible,
.stella-browse-clear:focus-visible,
.stella-status-option:focus-visible,
.stella-status-remove:focus-visible,
.stella-status-cancel:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: 2px;
}

.stella-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stella-app-account {
  position: relative;
}

.stella-app-account-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 8px 0 4px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 500 14px / 1 var(--hs4-font-inter);
}

.stella-app-caret {
  width: 0;
  height: 0;
  border-inline: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.7;
}

.stella-app-account-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  padding: 8px;
  border: 1px solid var(--sh-card-border);
  border-radius: 12px;
  background: var(--hs4-surface);
  box-shadow: 0 8px 24px color-mix(in srgb, var(--hs4-ink) 16%, transparent);
  z-index: 120;
}

.stella-app-account-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px 10px;
}

.stella-app-account-meta strong {
  font: 600 14px / 1.3 var(--hs4-font-inter);
}

.stella-app-account-meta span {
  color: var(--sh-on-muted);
  font-size: 12px;
}

.stella-app-account-menu button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 500 14px / 1 var(--hs4-font-inter);
}

.stella-app-account-menu .stella-app-menu-icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

/* "NSFW": the label, then a drawn switch that follows the item's
   aria-checked. The thumb's side and its check carry the state, never colour
   alone. */
.stella-app-menu-text {
  flex: 1 1 auto;
  min-width: 0;
}

.stella-app-switch {
  position: relative;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hs4-text) 8%, transparent);
  box-shadow: inset 0 0 0 1.5px var(--hs4-field-edge);
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.stella-app-switch-thumb {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--hs4-text) 60%, transparent);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

[aria-checked="true"] > .stella-app-switch {
  background: var(--hs4-selected);
  box-shadow: inset 0 0 0 1.5px var(--hs4-selected-edge);
}

[aria-checked="true"] > .stella-app-switch .stella-app-switch-thumb {
  background: var(--hs4-white);
  transform: translateX(16px);
}

[aria-checked="true"] > .stella-app-switch .stella-app-switch-thumb::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--hs4-green-strong);
  -webkit-mask: var(--hs4-check) center / contain no-repeat;
  mask: var(--hs4-check) center / contain no-repeat;
}

@media (prefers-reduced-motion: reduce) {
  .stella-app-switch,
  .stella-app-switch-thumb {
    transition: none;
  }
}

.stella-app-banner {
  display: none;
}

.stella-app-banner:not([hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  padding: 8px 16px;
  text-align: center;
  font: 500 13px / 1.4 var(--hs4-font-inter);
  background: color-mix(in srgb, var(--hs4-yellow) 18%, var(--hs4-surface));
}

.stella-app-banner[hidden],
.stella-app-banner:empty {
  display: none;
  padding: 0;
  margin: 0;
  min-height: 0;
  height: 0;
  overflow: hidden;
  background: none;
  border: 0;
  gap: 0;
}

.stella-app-banner:not([hidden]).stella-app-banner--warn {
  background: color-mix(in srgb, var(--hs4-yellow) 28%, var(--hs4-surface));
}

.stella-sync-retry,
.stella-sync-discard {
  appearance: none;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hs4-text) 12%, transparent);
  color: inherit;
  cursor: pointer;
  font: 600 13px / 1 var(--hs4-font-inter);
}

.stella-results-notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--hs4-yellow) 16%, var(--hs4-surface));
}

.stella-results-notice p {
  margin: 0;
  font: 500 13px / 1.4 var(--hs4-font-inter);
}

.stella-tile.is-sync-pending,
.stella-row.is-sync-pending,
.stella-tile.is-sync-failed,
.stella-row.is-sync-failed {
  outline: 1px dashed color-mix(in srgb, var(--hs4-text) 28%, transparent);
  outline-offset: 2px;
}

.stella-tile.is-sync-failed,
.stella-row.is-sync-failed {
  outline-color: color-mix(in srgb, var(--hs4-yellow) 70%, var(--hs4-text));
}

.stella-app-tabs {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  height: calc(56px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 12%, transparent);
  background: var(--hs4-surface);
}

.stella-app-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  color: var(--hs4-text);
  text-decoration: none;
  font: 500 11px / 1 var(--hs4-font-inter);
}

.stella-app-tab[aria-current="page"] {
  color: var(--hs4-on-selected-soft);
  font-weight: 700;
  background: var(--hs4-selected-soft);
}

.stella-app-tab-icon,
.stella-app-tab .sti-icon-mask {
  width: 18px;
  height: 18px;
}

@media (max-width: 720px) {
  /* --stella-tabs-h: the room the tab bar takes. It drops to 0 while the bar
     is hidden (scrolling down), so what floats above it follows it down. */
  html {
    --stella-tabs-h: 56px;
  }

  html.stella-nav-hidden {
    --stella-tabs-h: 0px;
  }

  .stella-app-tabs {
    display: flex;
    transition: transform 0.22s ease;
  }

  html.stella-nav-hidden .stella-app-tabs:not(:focus-within) {
    transform: translateY(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stella-app-tabs {
    transition: none;
  }
}

.stella-browse-searchbar {
  position: sticky;
  top: var(--app-header-h, 56px);
  z-index: 90;
  background: var(--hs4-bg);
  padding-bottom: 8px;
  max-width: min(100%, 640px);
}

.stella-browse-form {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  border: 2px solid var(--hs4-search-edge);
  border-radius: 999px;
  background: var(--hs4-surface);
}

.stella-browse-form:focus-within {
  border-color: var(--hs4-focus);
  box-shadow: 0 0 0 1px var(--hs4-focus);
  outline: none;
}

.stella-browse-form-icon {
  display: inline-flex;
  width: 20px;
  height: 20px;
  color: var(--hs4-muted-text);
}

.stella-browse-form-icon svg {
  width: 20px;
  height: 20px;
}

.stella-browse-input,
.stella-my-filter {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--hs4-text);
  font: 400 16px / 1.3 var(--hs4-font-inter);
}

.stella-browse-input:focus,
.stella-my-filter:focus {
  outline: none;
}

.stella-browse-clear {
  appearance: none;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--sh-on-muted);
  cursor: pointer;
  font: 500 13px / 1 var(--hs4-font-inter);
}

.stella-browse-progress {
  height: 2px;
  margin-top: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hs4-green) 70%, transparent);
  animation: stella-progress 1.1s linear infinite;
}

.stella-browse-results.is-pending {
  opacity: 0.55;
  pointer-events: none;
}

.stella-load-more {
  min-height: 28px;
  padding: 16px 8px 24px;
  text-align: center;
  font-size: 13px;
  color: color-mix(in srgb, var(--hs4-text) 62%, transparent);
  overflow-anchor: none;
}

.stella-browse-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 10px 0 8px;
  min-width: 0;
}

.stella-browse-head .stella-browse-toolbar {
  flex-wrap: nowrap;
}

.stella-browse-filters {
  flex: 1 1 auto;
  min-width: 0;
}

.stella-browse-filters-track {
  padding: 2px 0;
}

.stella-browse-filters .sh-search-filter {
  min-height: 32px;
}

.stella-filter-count {
  font-variant-numeric: tabular-nums;
  opacity: 0.72;
  font-weight: 600;
}

.stella-browse-filters .sh-search-filter.is-on .stella-filter-count {
  opacity: 0.92;
}

.stella-my-filters {
  margin: 0 0 8px;
  min-width: 0;
}

.stella-browse-toolbar-end {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stella-my-privacy {
  margin: 0;
  color: var(--sh-on-muted);
  font-size: 13px;
  white-space: nowrap;
}

.stella-my-privacy {
  margin: 0 0 14px;
  white-space: normal;
}

.stella-view-toggle {
  display: inline-flex;
  gap: 4px;
  margin-left: 0;
  padding: 4px;
  border-radius: 12px;
  background: var(--hs4-selected-soft);
}

.stella-view-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  min-height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 600 13px / 1 var(--hs4-font-inter);
}

.stella-view-icon {
  width: 16px;
  height: 16px;
}

.stella-view-btn[aria-pressed="true"] {
  background: var(--hs4-selected);
  color: var(--hs4-on-selected);
  box-shadow: inset 0 0 0 1.5px var(--hs4-selected-ring);
  font-weight: 700;
}

.stella-list,
.stella-grid {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stella-list {
  max-width: 720px;
}

.stella-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 72px;
  padding: 10px 8px;
}

.stella-row + .stella-row {
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 8%, transparent);
}

.stella-row-open,
.stella-tile-open {
  appearance: none;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.stella-row-title,
.stella-tile-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font: 600 15px / 1.3 var(--hs4-font-inter);
}

.stella-row-meta,
.stella-tile-meta {
  color: var(--sh-on-muted);
  font-size: 12px;
}

.stella-poster {
  display: block;
  width: 48px;
  height: 72px;
  object-fit: cover;
  object-position: center top;
  aspect-ratio: 2 / 3;
  border-radius: 4px;
  background: color-mix(in srgb, var(--hs4-text) 8%, transparent);
}

.stella-poster--missing {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 4px;
  border: 1px dashed color-mix(in srgb, var(--hs4-text) 28%, transparent);
  color: var(--sh-on-muted);
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
}

.stella-track-btn {
  appearance: none;
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: var(--hs4-orange-text);
  cursor: pointer;
  /* A long-press opens the status menu: no text selection or iOS callout. */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.12s ease, background-color 0.12s ease, filter 0.12s ease;
}

/* The disc is smaller than the tap target: 46px around a 38px disc. */
.stella-track-btn::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
}

/* Add is the main action on a row: orange outline, filled on hover */
.stella-track-btn:hover {
  border-color: var(--hs4-action);
  background: var(--hs4-action);
  color: var(--hs4-on-action);
}

.stella-track-btn.is-pressing {
  transform: scale(0.9);
}

.stella-track-btn svg {
  width: 20px;
  height: 20px;
}

/* A status is a state, not an action: a filled disc, and both the glyph and
   the colour say which one. Planned is blue, in progress yellow, completed
   green; paused and dropped are grey. */
.stella-track-btn.is-tracked,
.stella-quick {
  --track-bg: var(--hs4-selected);
  --track-fg: var(--hs4-on-selected);
}

.stella-track-btn.is-tracked[data-status="want"],
.stella-quick[data-status="want"] {
  --track-bg: var(--hs4-blue-strong);
  --track-fg: var(--hs4-white);
}

.stella-track-btn.is-tracked[data-status="active"],
.stella-quick[data-status="active"] {
  --track-bg: var(--hs4-yellow);
  --track-fg: var(--hs4-ink);
}

.stella-track-btn.is-tracked[data-status="paused"],
.stella-track-btn.is-tracked[data-status="dropped"],
.stella-quick[data-status="paused"],
.stella-quick[data-status="dropped"] {
  --track-bg: #6b6a66;
  --track-fg: var(--hs4-white);
}

.stella-track-btn.is-tracked,
.stella-track-btn.is-tracked:hover {
  border-color: var(--track-bg);
  background: var(--track-bg);
  color: var(--track-fg);
}

.stella-track-btn.is-tracked:hover {
  filter: brightness(0.9);
}

.stella-track-btn:disabled,
.stella-track-btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

/* The label over the button: what a click does, or which status is set. It
   shows on hover and keyboard focus, and by itself right after an add. */
.stella-track-tip {
  position: absolute;
  right: -4px;
  bottom: calc(100% + 9px);
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--hs4-ink);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--hs4-white) 16%, transparent);
  color: var(--hs4-white);
  font: 600 12px / 1.25 var(--hs4-font-inter);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0s linear 0.12s;
}

.stella-track-tip b {
  font-weight: 600;
}

.stella-track-tip-hint {
  color: color-mix(in srgb, var(--hs4-white) 72%, transparent);
  font-size: 11px;
  font-style: normal;
  font-weight: 500;
}

.stella-track-tip-hint::before {
  content: "Right-click for other statuses";
}

.stella-track-btn.is-tracked .stella-track-tip-hint::before {
  content: "Click to change";
}

@media (hover: none) {
  .stella-track-btn.is-tracked .stella-track-tip-hint::before {
    content: "Tap to change";
  }
}

@media (hover: hover) {
  .stella-track-btn:hover .stella-track-tip,
  .stella-track-btn:focus-visible .stella-track-tip {
    opacity: 1;
    visibility: visible;
    transition-delay: 0.35s;
  }
}

.stella-track-btn.is-fresh .stella-track-tip {
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}

.stella-track-btn[aria-expanded="true"] .stella-track-tip,
.stella-track-btn[aria-disabled="true"] .stella-track-tip {
  opacity: 0;
  visibility: hidden;
}

/* Columns share the row: a tile grows from --app-tile-min until one more
   column fits, then the grid adds that column and the tiles drop back to the
   minimum. A fixed tile width here leaves an empty strip at the end of every
   row (up to a whole tile wide), so there is no upper size. */
.stella-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--app-tile-min, 132px), 1fr));
  --app-grid-gap: clamp(10px, 1.4vw, 16px);
  gap: var(--app-grid-gap);
}

.stella-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.stella-tile-open {
  display: block;
  width: 100%;
}

/* A hairline just inside every poster's edge, so a dark poster does not melt
   into a dark page (or a pale one into a light page). Drawn as an overlay:
   an inset shadow on the image itself is painted under the picture and
   never shows. The line takes the text colour, so it is light on dark and
   dark on light. */
.stella-tile-open {
  position: relative;
}

.stella-tile-open::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hs4-text) 16%, transparent);
  pointer-events: none;
}

/* A stacked (series) poster is 6px narrower than its button. */
.stella-tile-open:has(.sf-poster-stack)::after {
  right: 6px;
}

.stella-tile .stella-poster {
  width: 100%;
  height: auto;
  min-height: 0;
}

.stella-tile-media {
  position: relative;
}

/* Media type, top-left on the poster: small and quiet, but always there. */
.stella-tile-type {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--hs4-ink) 62%, transparent);
  color: var(--hs4-white);
  backdrop-filter: blur(6px);
}

.stella-tile-type .sti-icon-mask {
  width: 15px;
  height: 15px;
}

/* In a series block the member's number sits under the type icon. */
.stella-tile-type--indexed {
  flex-direction: column;
  gap: 3px;
  width: auto;
  min-width: 26px;
  height: auto;
  padding: 5px 4px 4px;
  box-sizing: border-box;
}

.stella-tile-type-index {
  font: 700 11px / 1 var(--hs4-font-inter);
  font-variant-numeric: tabular-nums;
}

/* A number with no icon sits in the icon's own box: 26px square, growing
   sideways only when the number needs it. */
.stella-tile-type--number {
  flex-direction: row;
  min-width: 26px;
  height: 26px;
  padding: 0 5px;
}

/* Browse poster cards. The label above the poster (or the lines under it,
   when titles are on) carry: the title, the year, and the rating as Stella's
   star and a score out of 5. */
.stella-tile-score {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 3px;
  font-weight: 700;
}

.stella-rating-star {
  flex: none;
  width: 11px;
  height: 11px;
  fill: var(--hs4-orange);
}

.stella-tile--poster > .stella-tile-meta--year {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Display options, "Fade completed": what you have finished steps back, so
   the rest stands out. Pointing at it (or its open menu) brings it back. */
.stella-tile--poster .stella-tile-open {
  transition: opacity 0.14s ease;
}

.stella-cards--fade .stella-tile[data-status="done"] .stella-tile-open {
  opacity: 0.32;
}

.stella-cards--fade .stella-tile[data-status="done"]:hover .stella-tile-open,
.stella-cards--fade .stella-tile[data-status="done"]:has(:focus-visible) .stella-tile-open,
.stella-cards--fade .stella-tile[data-status="done"].is-menu-open .stella-tile-open {
  opacity: 1;
}

/* The title above the poster, on one line however long it is. Shown on
   hover when the viewer has "Titles under posters" off (stella-cards--tip on
   the results); touch screens have no hover and always keep the title below. */
.stella-tile-tip {
  position: absolute;
  left: 50%;
  /* The arrow below is 6px tall and its point rests on the poster's edge. */
  bottom: calc(100% + 6px);
  z-index: 7;
  /* At rest the label is no wider than its poster (the title gives way), so
     the hidden labels of long titles cannot make the page wider than the
     screen. It takes its full width when shown. */
  max-width: 100%;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--hs4-ink);
  color: var(--hs4-white);
  font: 600 13px / 1.25 var(--hs4-font-inter);
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(-50% + var(--tip-shift, 0px)));
  /* The width snaps back only once the label has faded out. */
  transition: opacity 0.12s ease, max-width 0s linear 0.12s;
  /* A faint edge around box and arrow together, for dark pages. */
  filter: drop-shadow(0 0 1px color-mix(in srgb, var(--hs4-white) 45%, transparent));
}

.stella-tile-tip-text {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Only the title gives way when the label would be wider than the page. */
.stella-tile-tip-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stella-tile-tip-year {
  flex: none;
  color: color-mix(in srgb, var(--hs4-white) 70%, transparent);
  font-weight: 500;
}

/* The arrow stays over the middle of the poster even when the label was
   nudged sideways to stay on the page. */
.stella-tile-tip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: clamp(12px, calc(50% - var(--tip-shift, 0px)), calc(100% - 12px));
  width: 0;
  height: 0;
  margin-left: -6px;
  border: 6px solid transparent;
  border-top-color: var(--hs4-ink);
  border-bottom-width: 0;
}

/* Titles off: nothing is written under the poster (the label has it on
   hover; a touch screen shows posters only). */
.stella-cards--tip .stella-tile > .stella-tile-title,
.stella-cards--tip .stella-tile > .stella-tile-meta--year {
  display: none;
}

@media (hover: hover) {
  .stella-cards--tip .stella-tile:hover .stella-tile-tip,
  .stella-cards--tip .stella-tile:has(:focus-visible) .stella-tile-tip {
    max-width: min(520px, calc(100vw - 16px));
    opacity: 1;
    transition-delay: 0s, 0s;
  }

  /* With the mouse the label waits a moment, so sweeping across the grid
     does not flash a label over every poster on the way. It leaves at once.
     Keyboard focus shows it straight away. */
  .stella-cards--tip .stella-tile:hover:not(:has(:focus-visible)) .stella-tile-tip {
    transition-delay: 0.45s, 0s;
  }

  /* Warm: a label has just been showing, so the next one does not wait. */
  .stella-cards--tip.stella-tips-warm .stella-tile:hover:not(:has(:focus-visible)) .stella-tile-tip {
    transition-delay: 0s, 0s;
  }

  /* Its menu is open: the menu is the thing to read now. */
  .stella-cards--tip .stella-tile.is-menu-open .stella-tile-tip {
    opacity: 0;
  }
}

/* No hover on a touch screen: the label is never shown, so it is not laid out. */
@media (hover: none) {
  .stella-tile-tip {
    display: none;
  }
}

/* Display options: a small button beside Sort, and its popover. */
.sbf-results-tools {
  position: relative;
}

.stella-display-btn {
  justify-content: center;
  width: 44px;
  padding: 0;
}

.stella-display-btn svg {
  width: 18px;
  height: 18px;
}

.stella-display-pop {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  width: 260px;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--hs4-surface);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--hs4-ink) 24%, transparent),
    0 0 0 1px color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

.stella-display-title {
  margin: 0 0 6px;
  color: var(--hs4-muted-text);
  font: 600 11px / 1.2 var(--hs4-font-inter);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stella-display-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  cursor: pointer;
  font: 500 15px / 1.2 var(--hs4-font-inter);
}

.stella-display-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 40px;
  height: 24px;
  margin: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hs4-text) 22%, transparent);
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.stella-display-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--hs4-white);
  transition: transform 0.14s ease;
}

.stella-display-switch:checked {
  background: var(--hs4-selected);
}

.stella-display-switch:checked::after {
  transform: translateX(16px);
}

.stella-display-switch:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: 2px;
}

.stella-display-note {
  margin: 4px 0 0;
  color: var(--hs4-muted-text);
  font: 500 12px / 1.4 var(--hs4-font-inter);
}

/* The phone layout hides the Sort button here (it lives in the floating
   bar); the display button is not Sort and stays. */
.sbf-results-tools .sbf-sort-btn.stella-display-btn {
  display: inline-flex;
}

/* Touch: a long-press anywhere on a poster opens the status menu, so the
   poster must not start a text selection, an image drag or the iOS callout. */
@media (hover: none) {
  .stella-tile--poster {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
  }

  .stella-tile--poster img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
  }

  .stella-tile--poster .stella-tile-media {
    transition: transform 0.14s ease;
  }

  .stella-tile--poster.is-pressing .stella-tile-media {
    transform: scale(0.97);
  }

  /* Display option "Button on posters" off. */
  .stella-cards--nobtn .stella-tile--poster .stella-track-btn {
    display: none;
  }
}

/* Hover row on a poster: want, completed, more. Pointer devices only; touch
   keeps the single track button (tap adds, tap again or long-press changes). */
.stella-tile-actions {
  display: none;
}

.stella-quick {
  appearance: none;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--hs4-white) 60%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--hs4-ink) 55%, transparent);
  color: var(--hs4-white);
  cursor: pointer;
  transition: background-color 0.12s ease, border-color 0.12s ease, filter 0.12s ease;
}

.stella-quick svg {
  width: 19px;
  height: 19px;
}

.stella-quick:hover {
  border-color: var(--hs4-white);
  background: color-mix(in srgb, var(--hs4-white) 22%, transparent);
}

/* Lit: this is the status that is set (same glyph and colour as elsewhere). */
.stella-quick.is-on,
.stella-quick.is-on:hover {
  border-color: var(--track-bg);
  background: var(--track-bg);
  color: var(--track-fg);
}

.stella-quick.is-on:hover {
  filter: brightness(0.9);
}

/* Just logged a rewatch: the button turns green for a moment, then settles. */
.stella-quick.is-logged {
  animation: stella-quick-logged 1.6s ease-out;
}

@keyframes stella-quick-logged {
  0%,
  55% {
    border-color: var(--hs4-selected);
    background: var(--hs4-selected);
    color: var(--hs4-on-selected);
  }
}

@media (prefers-reduced-motion: reduce) {
  .stella-quick.is-logged {
    animation-duration: 0.01s;
  }
}

.stella-quick:focus-visible {
  outline: 2px solid var(--hs4-white);
  outline-offset: 2px;
}

.stella-quick[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

@media (hover: hover) {
  .stella-tile--quick .stella-track-btn {
    display: none;
  }

  .stella-tile--quick .stella-tile-actions {
    position: absolute;
    left: 6px;
    right: 6px;
    bottom: 8px;
    display: flex;
    justify-content: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease;
  }

  /* is-menu-open: this poster's status menu is open, so it keeps its hover look.
     Keyboard focus shows it too (:focus-visible, not :focus-within: a button
     clicked with the mouse keeps focus, and must not pin the panel open). */
  .stella-tile--quick:hover .stella-tile-actions,
  .stella-tile--quick:has(:focus-visible) .stella-tile-actions,
  .stella-tile--quick.is-menu-open .stella-tile-actions {
    opacity: 1;
    pointer-events: auto;
  }

}

.stella-tile .stella-track-btn {
  position: absolute;
  right: 8px;
  bottom: 8px;
  top: auto;
  margin-top: 0;
  border-color: transparent;
  background: color-mix(in srgb, var(--hs4-ink) 62%, transparent);
  color: var(--hs4-white);
  backdrop-filter: blur(6px);
}

.stella-tile .stella-track-btn:hover {
  border-color: var(--hs4-action);
  background: var(--hs4-action);
}

.stella-tile .stella-track-btn.is-tracked,
.stella-tile .stella-track-btn.is-tracked:hover {
  border-color: var(--track-bg);
  background: var(--track-bg);
  color: var(--track-fg);
  /* A thin dark edge keeps a yellow or pink disc readable on a bright poster. */
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--hs4-ink) 34%, transparent);
  backdrop-filter: none;
}

.stella-tile .stella-track-btn:focus-visible {
  box-shadow: 0 0 0 2px var(--hs4-ink);
}

/* Series block: one <li> holding a header and the members' own list, so the
   block is a real box in both views instead of decoration on each member. */
.stella-group {
  --stella-group-accent: var(--hs4-text);
  --stella-group-kind-mix: 70%;
  --stella-group-bg: color-mix(in srgb, var(--hs4-text) 5%, var(--hs4-bg));
  box-sizing: border-box;
  margin-block: 14px 18px;
}

.stella-group[data-group-domain="film"] {
  --stella-group-accent: var(--sh-domain-film);
}

.stella-group[data-group-domain="tv"] {
  --stella-group-accent: var(--sh-domain-tv);
}

.stella-group[data-group-domain="book"] {
  --stella-group-accent: var(--sh-domain-book);
}

.stella-group[data-group-domain="game"] {
  --stella-group-accent: var(--sh-domain-game);
}

.stella-group[data-group-domain="anime_manga"],
.stella-group[data-group-domain="anime"],
.stella-group[data-group-domain="manga"] {
  --stella-group-accent: var(--sh-domain-anime);
}

.stella-group[data-group-domain="music"] {
  --stella-group-accent: var(--sh-domain-music);
}

/* Game yellow at 70% is unreadable as small text on a light surface. */
html:not([data-theme="dark"]) .stella-group[data-group-domain="game"] {
  --stella-group-kind-mix: 45%;
}

html:not([data-theme="dark"]) .stella-group[data-group-domain="book"] {
  --stella-group-kind-mix: 60%;
}

html:not([data-theme="dark"]) .stella-group[data-group-domain="anime_manga"],
html:not([data-theme="dark"]) .stella-group[data-group-domain="anime"],
html:not([data-theme="dark"]) .stella-group[data-group-domain="manga"],
html:not([data-theme="dark"]) .stella-group[data-group-domain="music"] {
  --stella-group-kind-mix: 50%;
}

.stella-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  padding: 0 8px 8px;
}

.stella-group-kind {
  flex: none;
  color: color-mix(
    in srgb,
    var(--stella-group-accent) var(--stella-group-kind-mix),
    var(--hs4-text)
  );
  font: 700 11px / 1.2 var(--hs4-font-inter);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

/* Browse: the type's icon leads the label, in the label's own colour. */
.stella-group-head--compact {
  align-items: center;
}

.stella-group-head--compact .stella-group-kind {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.stella-group-kind-icon {
  width: 17px;
  height: 17px;
}

.stella-group-name {
  min-width: 0;
  /* Room for descenders, which the ellipsis clip would otherwise cut. */
  margin-block: -2px;
  padding-block: 2px;
  overflow: hidden;
  color: var(--hs4-text);
  font: 400 22px / 1.15 var(--hs4-font-serif);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stella-group-count {
  flex: none;
  margin-left: auto;
  color: var(--sh-on-muted, var(--hs4-muted));
  font: 500 12px / 1.2 var(--hs4-font-inter);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The series name is not in the Browse header at rest: it fades in while the
   pointer (or keyboard focus) is inside the block. Touch has no hover and
   shows it all the time. */
.stella-group-head--compact .stella-group-name {
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.14s ease;
}

@media (hover: hover) {
  .stella-group:hover .stella-group-head--compact .stella-group-name,
  .stella-group:has(:focus-visible) .stella-group-head--compact .stella-group-name {
    opacity: 1;
  }
}

@media (hover: none) {
  .stella-group-head--compact .stella-group-name {
    opacity: 1;
  }
}

/* A member's corner box (type icon and number) takes the series colour, so
   it reads as part of the block under that header. */
.stella-group .stella-tile-type {
  background: color-mix(in srgb, var(--hs4-ink) 80%, transparent);
  color: color-mix(in srgb, var(--stella-group-accent) 84%, var(--hs4-white));
}

.stella-group-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* List: same treatment as the search dropdown. A thin accent rail and a soft
   tint mark the members; the rail sits inside the row's own padding so
   posters, titles and add buttons stay on the list's columns. */
.stella-list > .stella-group > .stella-group-items {
  border-left: 2px solid color-mix(in srgb, var(--stella-group-accent) 60%, transparent);
  border-radius: 0 10px 10px 0;
  background: var(--stella-group-bg);
}

.stella-row--in-group {
  padding-inline: 6px 8px;
  border-radius: 0;
}

.stella-row--in-group + .stella-row--in-group {
  border-top-color: color-mix(in srgb, var(--hs4-text) 9%, transparent);
}

/* The block does not clip (focus rings must show), so the end rows round themselves. */
.stella-row--in-group:first-child {
  border-radius: 0 10px 0 0;
}

.stella-row--in-group:last-child {
  border-radius: 0 0 10px 0;
}

.stella-row--in-group:hover {
  background: color-mix(in srgb, var(--hs4-text) 9%, var(--hs4-bg));
}

/* Grid: the block spans the grid and borrows its columns, so member tiles
   are the same size and sit on the same columns as tiles outside it. It is
   an open shelf: a header, the tiles, and a rule that closes it. */
.stella-grid > .stella-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  row-gap: var(--app-grid-gap);
  margin: 4px 0 6px;
  padding: 0 0 calc(var(--app-grid-gap) + 4px);
  border-bottom: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

.stella-grid > .stella-group > .stella-group-head {
  grid-column: 1 / -1;
  padding: 0;
}

.stella-grid > .stella-group > .stella-group-items {
  display: contents;
}

@supports not (grid-template-columns: subgrid) {
  .stella-grid > .stella-group {
    display: block;
  }

  .stella-grid > .stella-group > .stella-group-head {
    padding-bottom: var(--app-grid-gap);
  }

  .stella-grid > .stella-group > .stella-group-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--app-tile-min, 132px), 1fr));
    gap: var(--app-grid-gap);
  }
}

/* Phone: a series is one row that scrolls sideways, however many members
   it has, so a long series does not push everything else down the page.
   (Where there is room, a series wraps like the rest of the grid.) Two and a
   bit posters fit, and the cut-off one at the screen edge says there is more
   that way; so does the fade over it, until the row is scrolled to its end.
   A series of one or two members just sits in the grid as before. */
@media (max-width: 720px) {
  .stella-grid > .stella-group:has(.stella-group-items > .stella-tile:nth-child(3)) {
    display: block;
  }

  .stella-grid > .stella-group:has(.stella-group-items > .stella-tile:nth-child(3)) > .stella-group-head {
    padding-bottom: var(--app-grid-gap);
  }

  .stella-grid > .stella-group > .stella-group-items:has(> .stella-tile:nth-child(3)) {
    display: flex;
    gap: var(--app-grid-gap);
    /* Out to the screen's edge, so a poster is cut off by the screen itself. */
    margin-right: calc(-1 * var(--app-gutter, 16px));
    padding-right: var(--app-gutter, 16px);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-left: 0;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .stella-grid > .stella-group > .stella-group-items:has(> .stella-tile:nth-child(3))::-webkit-scrollbar {
    display: none;
  }

  .stella-grid > .stella-group > .stella-group-items:has(> .stella-tile:nth-child(3)) > .stella-tile {
    flex: 0 0 calc((100% - var(--app-gutter, 16px) - var(--app-grid-gap)) / 2.3);
    scroll-snap-align: start;
  }

  /* The fade over the cut-off poster; is-at-end (set by the page) removes it. */
  .stella-grid > .stella-group > .stella-group-items.is-scrollable:not(.is-at-end) {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent);
  }

  /* An arrow after the count, while the row can still be scrolled. */
  .stella-group:has(.stella-group-items.is-scrollable:not(.is-at-end)) .stella-group-count::after {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 7px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: translateY(-1px) rotate(45deg);
  }
}

@media (max-width: 480px) {
  .stella-group-head {
    gap: 8px;
  }

  .stella-group-name {
    font-size: 19px;
  }
}

/* Game families (stella-family.css): chip line, counts and owned line under
   the meta. */
.stella-row-body,
.stella-tile {
  min-width: 0;
}

.stella-row-body .sf-chips {
  margin-top: 5px;
}

.stella-row-body .sf-more-text,
.stella-row-body .sf-owned {
  margin-top: 3px;
}

.stella-tile-meta--family {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The tile's 6px gap suits title and meta; family lines sit closer. */
.stella-tile > .stella-tile-meta--family,
.stella-tile > .sf-more-text,
.stella-tile > .sf-owned {
  margin-top: -3px;
}

.stella-browse-results .sf-poster-stack {
  --sf-stack-bg: var(--hs4-bg);
}

.stella-group .sf-poster-stack,
html[data-theme="dark"] .stella-group .sh-search-hit .sf-poster-stack {
  --sf-stack-bg: var(--stella-group-bg);
}

.stella-tile .stella-poster.sf-poster-stack {
  width: calc(100% - 6px);
}

.stella-browse-results > .sf-studio-block {
  margin-bottom: 14px;
}

.stella-browse-results > .sf-studio-block:has(+ .stella-list) {
  max-width: 720px;
}

.stella-app-state {
  max-width: 44ch;
  margin: 24px auto;
  padding: 24px 0;
  text-align: center;
}

.stella-app-state h2 {
  margin: 0 0 8px;
  font: 600 16px / 1.3 var(--hs4-font-inter);
}

.stella-app-state p {
  margin: 0 0 16px;
  color: var(--sh-on-muted);
  font-size: 14px;
  line-height: 1.5;
}

.stella-chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 10px;
}

.stella-chip {
  appearance: none;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--hs4-field-edge);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 600 13px / 1 var(--hs4-font-inter);
}

.stella-chip:hover {
  border-color: var(--hs4-selected-edge);
  background: var(--hs4-selected-soft);
}

.stella-chip[aria-pressed="true"],
.stella-chip[aria-checked="true"],
.stella-chip[aria-selected="true"] {
  border-color: var(--hs4-selected);
  background: var(--hs4-selected);
  color: var(--hs4-on-selected);
  font-weight: 700;
}

.stella-chip[aria-pressed="true"]::before,
.stella-chip[aria-checked="true"]::before,
.stella-chip[aria-selected="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: -2px;
  background: currentColor;
  -webkit-mask: var(--hs4-check) center / contain no-repeat;
  mask: var(--hs4-check) center / contain no-repeat;
}

.stella-my-filter {
  min-height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--hs4-field-edge);
  border-radius: 999px;
  background: var(--hs4-surface);
}

.stella-my-filter::placeholder,
.stella-browse-input::placeholder {
  color: var(--hs4-muted-text);
  opacity: 1;
}

.stella-my-filter:focus-visible {
  border-color: var(--hs4-focus);
  box-shadow: 0 0 0 1px var(--hs4-focus);
  outline: none;
}

.stella-my-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--sh-on-muted);
  font-size: 13px;
}

.stella-my-sort select {
  min-height: 44px;
  border-radius: 999px;
  border: 1.5px solid var(--hs4-field-edge);
  background: var(--hs4-surface);
  color: inherit;
  padding: 0 10px;
}

.stella-toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--stella-tabs-h, 56px) + 16px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1150;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: min(92vw, 420px);
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--hs4-ink);
  color: var(--hs4-white);
}

.stella-toast p {
  margin: 0;
  font-size: 14px;
}

.stella-toast-actions {
  display: flex;
  gap: 8px;
}

.stella-toast-actions button {
  appearance: none;
  min-height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--hs4-white) 18%, transparent);
  color: inherit;
  cursor: pointer;
  font: 600 13px / 1 var(--hs4-font-inter);
}

.stella-status-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1140;
  background: color-mix(in srgb, var(--hs4-ink) 40%, transparent);
}

.stella-status-picker {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1141;
  max-height: 70dvh;
  overflow: auto;
  padding: 12px 12px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 16px 16px 0 0;
  background: var(--hs4-surface);
}

.stella-status-picker-title {
  margin: 0 0 8px;
  padding: 4px 12px 8px;
  font: 600 14px / 1.3 var(--hs4-font-inter);
}

.stella-status-picker--anchored {
  left: auto;
  right: auto;
  bottom: auto;
  width: min(280px, calc(100% - 32px));
  max-height: min(70dvh, calc(100dvh - 32px));
  border-radius: 12px;
  box-shadow: 0 12px 32px color-mix(in srgb, var(--hs4-ink) 24%, transparent);
}

@media (min-width: 721px) {
  .stella-status-picker {
    left: auto;
    right: auto;
    bottom: auto;
    width: min(280px, calc(100% - 32px));
    max-height: min(70dvh, calc(100dvh - 32px));
    border-radius: 12px;
    box-shadow: 0 12px 32px color-mix(in srgb, var(--hs4-ink) 24%, transparent);
  }
}

@media (max-width: 720px) {
  .stella-status-picker,
  .stella-status-picker--sheet {
    left: 0;
    right: 0;
    bottom: calc(var(--stella-tabs-h, 56px) + env(safe-area-inset-bottom, 0px));
    top: auto;
    width: auto;
    max-height: min(70dvh, calc(100dvh - 72px - env(safe-area-inset-bottom, 0px)));
    padding: 12px 12px 16px;
    border-radius: 16px 16px 0 0;
  }

  /* Over the detail modal the tab bar is under the scrim: sit on the edge. */
  .stella-picker-root--over-modal .stella-status-picker {
    bottom: 0;
    max-height: min(70dvh, calc(100dvh - 16px));
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

.stella-status-option,
.stella-status-remove,
.stella-status-cancel {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 500 15px / 1 var(--hs4-font-inter);
}

/* The menu in sections: the three statuses a title moves through, then the
   quieter ones for setting it aside, then the rating. */
.stella-status-group + .stella-status-group,
.stella-rate {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

.stella-status-group-label {
  margin: 0;
  padding: 6px 14px 4px;
  color: var(--hs4-muted-text);
  font: 600 11px / 1.2 var(--hs4-font-inter);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stella-status-group--minor .stella-status-option {
  min-height: 38px;
  color: var(--hs4-muted-text);
  font-size: 14px;
}

.stella-status-group--minor .stella-status-option[aria-checked="true"] {
  color: var(--hs4-on-selected-soft);
}

/* Your rating: five of Stella's four-point stars, filled in half steps. */
.stella-rate {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 6px;
}

.stella-rate-label {
  color: var(--hs4-muted-text);
  font: 600 11px / 1.2 var(--hs4-font-inter);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stella-rate-stars {
  display: inline-flex;
  margin-left: auto;
}

.stella-rate-star {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
}

.stella-rate-star svg {
  width: 24px;
  height: 24px;
  transition: transform 0.1s ease;
}

.stella-rate-star:hover svg {
  transform: scale(1.12);
}

.stella-rate-off {
  fill: color-mix(in srgb, var(--hs4-text) 20%, transparent);
}

.stella-rate-on {
  fill: var(--hs4-orange);
  clip-path: inset(0 100% 0 0);
}

.stella-rate-star.is-half .stella-rate-on {
  clip-path: inset(0 50% 0 0);
}

.stella-rate-star.is-full .stella-rate-on {
  clip-path: none;
}

/* The pointer previews a rating in half steps (classes set by the page). */
.stella-rate-stars.is-previewing .stella-rate-star .stella-rate-on {
  clip-path: inset(0 100% 0 0);
  opacity: 0.8;
}

.stella-rate-stars.is-previewing .stella-rate-star.is-pre-half .stella-rate-on {
  clip-path: inset(0 50% 0 0);
}

.stella-rate-stars.is-previewing .stella-rate-star.is-pre-full .stella-rate-on {
  clip-path: none;
}

.stella-rate-star:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: -2px;
}

/* The diary action: Rewatched / Replayed / Reread, with a submenu of dates. */
.stella-status-repeat,
.stella-status-finished {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  margin-top: 6px;
  padding: 0 14px;
  border: 0;
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 500 15px / 1 var(--hs4-font-inter);
}

.stella-status-repeat:hover,
.stella-status-repeat[aria-expanded="true"],
.stella-status-finished:hover,
.stella-status-finished[aria-expanded="true"] {
  background: color-mix(in srgb, var(--hs4-text) 7%, transparent);
}

.stella-status-repeat svg,
.stella-status-finished svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.stella-status-repeat-count {
  color: var(--hs4-muted-text);
  font-size: 13px;
}

.stella-status-repeat-caret {
  display: inline-flex;
  margin-left: auto;
}

.stella-status-repeat-caret svg {
  width: 16px;
  height: 16px;
}

.stella-status-sub {
  position: fixed;
  z-index: 1142;
  width: 240px;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 12px;
  background: var(--hs4-surface);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--hs4-ink) 24%, transparent);
}

/* Keyboard focus inside the menu: a thin ring drawn inside the row, so it
   never spills into the gaps or changes the spacing. */
.stella-status-picker:focus {
  outline: 0;
}

.stella-status-picker .stella-status-option:focus-visible,
.stella-status-sub .stella-status-option:focus-visible,
.stella-status-picker .stella-status-repeat:focus-visible,
.stella-status-picker .stella-status-finished:focus-visible,
.stella-status-picker .stella-status-lists:focus-visible,
.stella-status-picker .stella-status-share:focus-visible,
.stella-status-picker .stella-status-cancel:focus-visible,
.stella-status-picker .stella-rate-star:focus-visible {
  outline: 1.5px solid color-mix(in srgb, var(--hs4-focus) 80%, transparent);
  outline-offset: -1.5px;
  box-shadow: none;
}

/* Beside its poster the menu is a plain context menu: the page behind is not
   dimmed (the invisible layer still closes it on a click outside). The phone
   sheet keeps its scrim. */
@media (min-width: 721px) {
  .stella-status-backdrop {
    background: transparent;
  }
}

/* The lists submenu: find and new list stay put, the names scroll. */
.stella-lists-sub {
  width: 264px;
}

.stella-lists-sub svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.stella-lists-find {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  margin-bottom: 4px;
  padding: 0 12px;
  border: 1.5px solid var(--hs4-field-edge);
  border-radius: 999px;
}

.stella-lists-find:focus-within {
  border-color: var(--hs4-focus);
}

.stella-lists-find-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: 500 14px / 1 var(--hs4-font-inter);
}

.stella-lists-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 4px 8px;
}

.stella-lists-form[hidden] {
  display: none;
}

.stella-lists-input {
  flex: 1 1 120px;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1.5px solid var(--hs4-field-edge);
  border-radius: 8px;
  background: var(--hs4-surface);
  color: inherit;
  font: 500 14px / 1 var(--hs4-font-inter);
}

.stella-lists-create {
  appearance: none;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--hs4-action);
  color: var(--hs4-on-action);
  cursor: pointer;
  font: 600 14px / 1 var(--hs4-font-inter);
}

.stella-lists-create:hover {
  background: var(--hs4-action-hover);
}

.stella-lists-create[aria-disabled="true"] {
  opacity: 0.6;
  cursor: wait;
}

.stella-lists-sep {
  height: 1px;
  margin: 6px 0;
  background: color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

.stella-lists-names {
  max-height: 228px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.stella-lists-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.stella-lists-row + .stella-lists-row {
  margin-top: 4px;
}

.stella-lists-row[hidden] {
  display: none;
}

.stella-lists-row > .stella-lists-name {
  flex: 1;
  min-width: 0;
}

/* Delete, on a list with nothing in it: red, so it is not taken for the tick. */
.stella-lists-sub {
  --stella-danger: #c9372c;
}

html[data-theme="dark"] .stella-lists-sub {
  --stella-danger: #ff8577;
}

.stella-lists-delete {
  appearance: none;
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--stella-danger);
  cursor: pointer;
}

.stella-lists-delete svg {
  opacity: 1;
}

.stella-lists-delete:hover {
  background: color-mix(in srgb, var(--stella-danger) 14%, transparent);
}

.stella-lists-delete[aria-disabled="true"] {
  opacity: 0.5;
  cursor: wait;
}

.stella-lists-delete:focus-visible {
  outline: 1.5px solid var(--stella-danger);
  outline-offset: -1.5px;
}

.stella-lists-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stella-lists-name small {
  color: var(--hs4-muted-text);
  font-size: 12px;
  font-weight: 500;
}

/* The count sits at the end; the ticked dot follows it. */
.stella-lists-name[aria-checked="true"]::after {
  margin-left: 0;
}

.stella-lists-none {
  margin: 0;
  padding: 10px 14px;
  color: var(--hs4-muted-text);
  font-size: 13px;
}

.stella-lists-input:focus-visible,
.stella-lists-create:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: -2px;
}

/* Phone sheet: a submenu is a second page of the sheet. The menu's own rows
   step aside, a Back row leads the page, and the sheet keeps its height. */
.stella-status-picker.is-sub-open > *:not(.stella-status-subpage) {
  display: none;
}

.stella-status-subpage {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.stella-status-back {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 0 8px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 600 16px / 1 var(--hs4-font-inter);
}

.stella-status-back svg {
  flex: none;
  width: 20px;
  height: 20px;
}

.stella-status-back:focus-visible {
  outline: 1.5px solid var(--hs4-focus);
  outline-offset: -1.5px;
}

.stella-status-sub.stella-status-sub--page {
  margin: 0;
  padding: 0;
  background: transparent;
}

/* The lists scroll inside the page; find and New list stay in reach above. */
.stella-status-sub--page .stella-lists-names {
  max-height: min(44dvh, 340px);
}

.stella-status-sub--page .stella-lists-find,
.stella-status-sub--page .stella-lists-form,
.stella-status-sub--page .stella-repeat-form {
  margin-left: 4px;
  margin-right: 4px;
}

/* 16px inputs: iOS zooms the page for anything smaller. */
.stella-status-sub--page input {
  font-size: 16px;
}

/* On a phone the dates open inside the sheet, under the row. */
.stella-status-sub--inline {
  position: static;
  width: auto;
  margin: 0 6px 6px;
  padding: 4px;
  background: color-mix(in srgb, var(--hs4-text) 5%, transparent);
  box-shadow: none;
}

/* The dates as a menu of their own (the poster's Rewatched button). */
.stella-status-sub--fixed {
  margin: 0;
  padding: 0;
  background: transparent;
}

.stella-status-sub--inline + * {
  margin-top: 0;
}

.stella-status-picker--sheet .stella-status-repeat[aria-expanded="true"] .stella-status-repeat-caret svg,
.stella-status-picker--sheet .stella-status-finished[aria-expanded="true"] .stella-status-repeat-caret svg {
  transform: rotate(90deg);
}

.stella-repeat-day {
  margin-left: auto;
  color: var(--hs4-muted-text);
  font-size: 13px;
  font-weight: 500;
}

.stella-repeat-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
}

.stella-repeat-form[hidden] {
  display: none;
}

.stella-repeat-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.stella-repeat-input {
  flex: 1 1 130px;
  min-width: 0;
  min-height: 38px;
  padding: 0 10px;
  border: 1.5px solid var(--hs4-field-edge);
  border-radius: 8px;
  background: var(--hs4-surface);
  color: inherit;
  font: 500 14px / 1 var(--hs4-font-inter);
  color-scheme: light dark;
}

.stella-repeat-save {
  appearance: none;
  min-height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--hs4-action);
  color: var(--hs4-on-action);
  cursor: pointer;
  font: 600 14px / 1 var(--hs4-font-inter);
}

.stella-repeat-save:hover {
  background: var(--hs4-action-hover);
}

.stella-repeat-error {
  flex: 1 0 100%;
  margin: 0;
  color: var(--hs4-orange-text);
  font-size: 13px;
}

.stella-status-repeat:focus-visible,
.stella-status-finished:focus-visible,
.stella-repeat-input:focus-visible,
.stella-repeat-save:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: -2px;
}

/* A row that opens a submenu; is-current: the title's status lives in it. */
.stella-status-parent[aria-expanded="true"] {
  background: color-mix(in srgb, var(--hs4-text) 7%, transparent);
}

.stella-status-parent.is-current {
  background: var(--hs4-selected-soft);
  color: var(--hs4-on-selected-soft);
  font-weight: 700;
}

.stella-status-picker--mini.stella-status-picker--anchored {
  width: 220px;
}

/* The action rows (diary, lists, share) are one block: each row touches the
   next, with a hairline between, so a hovered row meets its neighbours. */
.stella-status-actions {
  margin-top: 6px;
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

.stella-status-actions:empty {
  display: none;
}

/* The rating row brings its own space below; the block after it adds none,
   so the stars sit evenly between the two hairlines. */
.stella-rate + .stella-status-actions {
  margin-top: 0;
}

.stella-status-actions > .stella-status-repeat,
.stella-status-actions > .stella-status-finished,
.stella-status-actions > .stella-status-lists,
.stella-status-actions > .stella-status-share {
  margin-top: 0;
  border-top: 0;
  border-radius: 0;
}

.stella-status-actions > * + .stella-status-repeat,
.stella-status-actions > * + .stella-status-finished,
.stella-status-actions > * + .stella-status-lists,
.stella-status-actions > * + .stella-status-share {
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

.stella-status-actions > .stella-status-lists {
  gap: 8px;
}

.stella-status-lists svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.stella-status-share {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: 500 15px / 1 var(--hs4-font-inter);
}

.stella-status-share:hover {
  background: color-mix(in srgb, var(--hs4-text) 7%, transparent);
}

.stella-status-share svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.stella-status-share:focus-visible {
  outline: 2px solid var(--hs4-focus);
  outline-offset: -2px;
}

/* A little air between status rows, so a hovered row never touches the ticked one. */
.stella-status-option + .stella-status-option {
  margin-top: 4px;
}

/* Beside its poster the menu does not repeat the title; the phone sheet,
   which sits away from the poster, keeps it. A line that only held the
   title goes with it. */
.stella-status-picker--anchored .stella-status-picker-name {
  display: none;
}

.stella-status-picker--anchored .stella-status-picker-title:not(:has(.stella-status-picker-kicker)) {
  display: none;
}

.stella-status-picker--anchored .stella-status-picker-title {
  margin-bottom: 2px;
  padding-bottom: 4px;
}

/* On a wide screen, click outside or Escape closes the menu; Cancel is for the phone sheet. */
.stella-status-picker--anchored .stella-status-cancel {
  display: none;
}

.stella-status-option svg {
  flex: none;
  width: 18px;
  height: 18px;
  opacity: 0.85;
}

.stella-status-picker-kicker {
  display: block;
  margin-bottom: 2px;
  color: var(--hs4-muted-text);
  font-size: 12px;
  font-weight: 500;
}

.stella-status-option:hover,
.stella-status-cancel:hover {
  background: color-mix(in srgb, var(--hs4-text) 7%, transparent);
}

.stella-status-option[aria-checked="true"] {
  background: var(--hs4-selected-soft);
  color: var(--hs4-on-selected-soft);
  font-weight: 700;
}

/* The ticked row ends in a dot, not a second check: Completed already starts
   with one. */
.stella-status-option[aria-checked="true"]::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: auto;
  margin-right: 5px;
  border-radius: 50%;
  background: currentColor;
}

.stella-status-remove {
  color: var(--hs4-orange-text);
  border-radius: 0;
  margin-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--hs4-text) 10%, transparent);
}

html[data-theme="dark"] .stella-tile .stella-poster {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hs4-text) 12%, transparent);
}

/* The rule above would otherwise replace the stack's shadows. */
html[data-theme="dark"] .stella-tile .stella-poster.sf-poster-stack {
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--hs4-text) 12%, transparent),
    3px 3px 0 -1px var(--sf-stack-bg),
    3px 3px 0 0 var(--sf-line),
    6px 6px 0 -1px var(--sf-stack-bg),
    6px 6px 0 0 var(--sf-line);
}

@media (min-width: 600px) {
  .stella-browse-form {
    min-height: 52px;
  }

  .stella-row-open {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .stella-list .stella-poster {
    width: 56px;
    height: 84px;
  }

  .stella-grid {
    --app-tile-min: 140px;
  }

  .stella-toast {
    left: 24px;
    transform: none;
    bottom: 24px;
  }
}

@media (min-width: 900px) {
  .stella-app-main {
    --app-main-max: 960px;
    padding-top: 22px;
  }

  .stella-grid {
    --app-tile-min: 148px;
  }

  .stella-row-title {
    font-size: 16px;
  }
}

@media (min-width: 1280px) {
  .stella-app-main {
    --app-main-max: 1000px;
  }

  .stella-browse-title {
    font-size: 1.75rem;
  }
}

@media (min-width: 1440px) {
  .stella-app-main {
    --app-main-max: 1040px;
  }
}

@media (min-width: 1920px) {
  .stella-app-main {
    --app-main-max: 1040px;
  }
}

@media (pointer: coarse) {
  .stella-track-btn {
    width: 40px;
    height: 40px;
  }

  .stella-view-btn,
  .stella-chip,
  .stella-app-tab {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stella-browse-progress {
    animation: none;
  }
}

@keyframes stella-progress {
  0% { opacity: 0.35; }
  50% { opacity: 1; }
  100% { opacity: 0.35; }
}
