/* System fallbacks keep the entire app usable offline. */
:root {
  color-scheme: dark;
  --bg: #151714;
  --panel: #20231e;
  --ink: #f0f1e8;
  --muted: #a4aa99;
  --line: #353b2e;
  --lime: #d8f36a;
  font-family: "DM Sans", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--lime);
  outline-offset: 4px;
}
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0 32px;
}
.brand {
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -1.4px;
}
.brand span {
  color: var(--lime);
  font-size: 12px;
  vertical-align: top;
  margin: 5px;
}
.icon-button {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 23px;
}
#app,
#public-page {
  max-width: 800px;
  margin: auto;
  padding: env(safe-area-inset-top) 24px 120px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 2.3px;
  color: var(--muted);
  font-weight: 600;
}
h1 {
  font:
    500 clamp(42px, 8vw, 64px)/1.1 "Playfair Display",
    Georgia,
    serif;
  letter-spacing: -1.5px;
  margin: 12px 0;
}
h2 {
  font:
    500 30px/1.25 "Playfair Display",
    Georgia,
    serif;
}
p {
  line-height: 1.6;
}
.accent {
  color: var(--lime);
}
.muted {
  color: var(--muted);
}
.empty {
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 30px;
  padding: 35px 0;
}
.empty-number {
  font:
    500 78px/1 "Playfair Display",
    Georgia,
    serif;
  color: var(--lime);
  opacity: 0.75;
}
.empty p {
  color: var(--muted);
}
.primary {
  background: var(--lime);
  color: #191d10;
  border: 0;
  border-radius: 12px;
  padding: 16px 22px;
  min-height: 52px;
  font-weight: 700;
}
.primary span {
  margin-left: 20px;
  font-size: 20px;
}
.primary-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1a1d18f5;
  backdrop-filter: none;
  transition: none;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: center;
  padding: 10px 12px max(14px, env(safe-area-inset-bottom));
  z-index: 5;
}
.primary-nav a {
  color: var(--muted);
  text-align: center;
  padding: 14px 10px;
  flex: 1;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.primary-nav a[aria-current] {
  background: #d8f36a12;
  color: var(--lime);
}
@media (min-width: 700px) {
  #app,
  #public-page {
    padding-left: 40px;
    padding-right: 40px;
  }
  header {
    padding-top: 36px;
  }
  .empty {
    padding: 40px;
  }
}
.icon-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.primary-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 10px;
}
.heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}
.stats {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--muted);
  margin: 20px 0 28px;
}
.stats span + span {
  border-left: 1px solid var(--line);
  padding-left: 22px;
}
.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.compact {
  padding: 12px 15px;
  min-height: 46px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 1.8px;
  margin: 28px 0 12px;
}
.movie-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--ink);
  width: 100%;
  display: flex;
  text-align: left;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
}
.movie-row:hover {
  background: #ffffff04;
}
.rank {
  font:
    500 28px Georgia,
    serif;
  min-width: 32px;
}
.poster {
  aspect-ratio: 2/3;
  overflow: hidden;
  border-radius: 9px;
  background: #2a2f23;
  position: relative;
  display: grid;
  place-items: center;
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
}
.no-poster {
  padding: 15px;
  color: #c9d4b6;
  font:
    500 20px/1.3 Georgia,
    serif;
  text-align: center;
  overflow-wrap: anywhere;
}
.movie-row .poster {
  width: 56px;
  flex-shrink: 0;
  border-radius: 5px;
}
.movie-row .no-poster {
  font: 10px system-ui;
  padding: 5px;
}
.row-copy {
  flex: 1;
  min-width: 0;
}
h3 {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
  margin: 0;
  overflow-wrap: anywhere;
}
.uk {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.4;
  margin: 5px 0;
}
.year {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}
.footnote {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin: 25px 0;
}
.pending-strip {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 10px;
}
.pending-strip button {
  background: none;
  border: 0;
  color: var(--muted);
  width: 98px;
  flex-shrink: 0;
  padding: 0;
  text-align: left;
}
.pending-strip button > span {
  display: block;
  font-size: 13px;
  line-height: 1.3;
  margin-top: 8px;
}
.pending-strip .no-poster {
  font-size: 16px;
}
.matchup {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 32px;
}
.matchup article {
  min-width: 0;
}
.choice {
  display: block;
  width: 100%;
  border: 0;
  padding: 0;
  color: var(--ink);
  background: none;
  text-align: left;
  border-radius: 10px;
}
/* Saving blocks repeat picks without dimming the movie that stays in place. */
.choice:disabled {
  opacity: 1;
}
.choice .poster {
  transition:
    transform 0.16s,
    box-shadow 0.16s;
}
.choice-copy {
  padding-top: 16px;
  min-height: 106px;
}
.choice h3 {
  font-size: 18px;
}
.versus {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--bg);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--muted);
  pointer-events: none;
}
.detail-button {
  background: none;
  color: var(--muted);
  border: 1px solid var(--line);
  width: 100%;
  border-radius: 8px;
  min-height: 44px;
  font-size: 14px;
  margin: 8px 0;
}
.compare-actions {
  text-align: center;
  margin: 28px 0 14px;
}
.secondary {
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--panel);
  padding: 14px 18px;
  min-height: 48px;
  border-radius: 10px;
}
.undo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  background: none;
  color: var(--muted);
  margin: 8px auto;
  min-height: 48px;
  font-size: 14px;
}
.complete-mark {
  display: grid;
  place-items: center;
  border: 1px solid var(--lime);
  color: var(--lime);
  width: 70px;
  height: 70px;
  margin: 0 auto;
  border-radius: 50%;
}
.complete-mark svg {
  width: 35px;
  height: 35px;
}
.text-button {
  display: block;
  background: transparent;
  border: 0;
  color: var(--lime);
  font-size: 14px;
  min-height: 44px;
  padding: 10px;
  margin: 8px auto;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 15px;
  margin: 23px 0 16px;
  color: var(--muted);
}
.search-box:has(input:focus-visible) {
  border-color: var(--lime);
  outline: 1px solid var(--lime);
  outline-offset: 0;
}
.search-box input {
  border: 0;
  background: transparent;
  min-width: 0;
  flex: 1;
  min-height: 54px;
  color: var(--ink);
  outline: none;
  padding: 12px 0;
}
.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-clear {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.search-clear:hover {
  color: var(--ink);
  background: var(--line);
}
.search-box input:placeholder-shown + .search-clear {
  display: none;
}
.filters {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.filters button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  color: var(--muted);
  padding: 10px 16px;
  min-height: 44px;
  font-size: 14px;
}
.filters button.selected {
  color: var(--lime);
  background: color-mix(in srgb, var(--lime) 10%, transparent);
  border-color: color-mix(in srgb, var(--lime) 38%, transparent);
}
.badge {
  font-size: 12px;
  color: var(--muted);
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 5px;
  max-width: 88px;
}
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 8px;
  font-size: 14px;
  min-height: 44px;
}
.small-button.filled {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--bg);
  font-weight: 600;
}
[hidden] {
  display: none !important;
}
dialog {
  width: min(640px, 100%);
  max-height: calc(90dvh - var(--keyboard-inset, 0px));
  margin: auto auto var(--keyboard-inset, 0px);
  border: 1px solid var(--line);
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  color: var(--ink);
  padding: 0;
  overscroll-behavior: contain;
}
dialog::backdrop {
  background: #000a;
  backdrop-filter: blur(4px);
}
.dialog-inner {
  padding: 20px 24px max(32px, env(safe-area-inset-bottom));
  position: relative;
}
.dialog-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  z-index: 2;
}
.dialog-heading {
  flex: 1;
  min-width: 0;
}
.dialog-header h2 {
  font-size: 24px;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}
.dialog-header .back-menu {
  display: block;
  min-height: 44px;
  padding: 0;
  font-size: 13px;
}
.dialog-header .eyebrow {
  margin-bottom: 8px;
}
.dialog-label {
  font-size: 16px;
  font-weight: 600;
}
.dialog-close {
  flex-shrink: 0;
  margin: 0;
}
.data-settings summary {
  min-height: 44px;
  padding: 10px 0;
  cursor: pointer;
  font-size: 18px;
  font-weight: 600;
}
.setting-section {
  border-top: 1px solid var(--line);
  padding: 24px 0 10px;
  margin-top: 24px;
}
.setting-section h3 {
  font-size: 18px;
}
.setting-section p {
  font-size: 15px;
}
.setting-section .footnote {
  font-size: 13px;
}
.setting-section label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin: 14px 0 8px;
}
.setting-section input {
  width: 100%;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  margin: 0 0 14px;
}
.button-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.button-stack button {
  width: 100%;
  margin: 0;
}
.text-link {
  display: inline-block;
  color: var(--lime);
  font-size: 14px;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 4px;
  padding: 15px 0;
}
.notice {
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--lime) 32%, transparent);
  background: color-mix(in srgb, var(--lime) 6%, transparent);
  border-radius: 10px;
  line-height: 1.6;
  font-size: 14px;
  margin: 15px 0;
}
.notice .text-button {
  margin: 10px 0 0;
  padding-left: 0;
}
.error {
  color: #ffc0b6;
  border-color: #a9594544;
  background: #a959450b;
}
.credits {
  border-top: 1px solid var(--line);
  margin-top: 24px;
  padding-top: 24px;
  color: var(--muted);
  font-size: 12px;
}
.search-submit {
  width: 100%;
}
.search-result {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 15px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.search-result .poster {
  align-self: start;
  border-radius: 5px;
}
.search-result .no-poster {
  font-size: 13px;
  padding: 8px;
}
.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.added {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--lime);
  min-height: 44px;
}
.search-hint {
  text-align: center;
  margin: 30px 0;
}
.backdrop {
  width: calc(100% + 48px);
  margin: -20px -24px 20px;
  aspect-ratio: 16/9;
  object-fit: cover;
  max-height: 260px;
}
.detail-heading {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  clear: both;
}
.detail-heading > .poster,
.detail-heading > .detail-poster {
  width: 100px;
  flex-shrink: 0;
}
.detail-heading h2 {
  font-size: 27px;
  margin: 10px 0;
}
.detail-heading p {
  margin: 8px 0;
  font-size: 14px;
}
.genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 25px 0;
}
.genres span {
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 6px 10px;
  color: var(--muted);
}
.overview {
  font-size: 16px;
  line-height: 1.7;
  color: #cbd0c1;
}
.stills {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 4px;
}
.image-open {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--panel);
  color: var(--ink);
  cursor: zoom-in;
}
.image-expand {
  position: absolute;
  right: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #080d13cc;
  color: white;
  pointer-events: none;
}
.image-expand svg {
  width: 16px;
  height: 16px;
}
.detail-backdrop {
  width: calc(100% + 48px);
  aspect-ratio: 16/9;
  max-height: 260px;
  margin: -20px -24px 20px;
  border-radius: 0;
  overflow: hidden;
}
.detail-backdrop .backdrop {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  margin: 0;
}
.detail-poster .poster {
  width: 100%;
}
.stills .image-open {
  flex: 0 0 clamp(96px, 28vw, 128px);
  aspect-ratio: 16/9;
  overflow: hidden;
}
.stills img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 9px;
}
.image-viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  border: 0;
  border-radius: 0;
  background: #080d13;
  color: #f1f5fa;
  overflow: hidden;
}
.image-viewer-header {
  display: flex;
  align-items: center;
  gap: 16px;
}
.image-viewer-header h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font:
    600 16px/1.4 system-ui,
    sans-serif;
  overflow-wrap: anywhere;
}
.image-viewer .icon-button,
.image-viewer .secondary {
  flex-shrink: 0;
  border-color: #ffffff55;
  background: #17222e;
  color: #f1f5fa;
}
.image-viewer-stage {
  position: relative;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}
.image-viewer-art,
.image-viewer-art img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.image-viewer-message {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 12px;
  text-align: center;
  pointer-events: none;
}
.image-viewer-message p {
  margin: 0;
}
.image-viewer-retry {
  pointer-events: auto;
}
.image-viewer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
.image-viewer-count {
  min-width: 110px;
  margin: 0;
  text-align: center;
  font-size: 14px;
}
.danger {
  color: #ffc0b6;
}
#toast {
  position: fixed;
  bottom: 110px;
  left: 50%;
  transform: translate(-50%, 12px);
  width: max-content;
  max-width: calc(100% - 32px);
  background: var(--lime);
  color: var(--bg);
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 14px;
  box-shadow: 0 8px 35px #0008;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.15s,
    transform 0.15s;
  z-index: 20;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
body:has(dialog[open]) {
  overflow: hidden;
}
@media (min-width: 700px) {
  dialog {
    margin: auto;
    border-radius: 22px;
    max-height: 88dvh;
  }
  .matchup {
    gap: 32px;
  }
  .choice-copy {
    min-height: 90px;
  }
  .movie-row .poster {
    width: 64px;
  }
  .choice h3 {
    font-size: 22px;
  }
  .matchup .poster {
    width: 100%;
  }
}
@media (max-width: 370px) {
  #app,
  #public-page {
    padding-left: 16px;
    padding-right: 16px;
  }
  .matchup {
    gap: 12px;
  }
  .choice h3 {
    font-size: 16px;
  }
  .badge {
    display: none;
  }
  .detail-heading {
    gap: 12px;
  }
  .detail-heading > .poster,
  .detail-heading > .detail-poster {
    width: 70px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 699px) {
  body:has([data-view="compare"]) header {
    padding-bottom: 20px;
  }
  [data-view="compare"] h1 {
    font-size: 38px;
  }
  [data-view="compare"] .matchup {
    margin-top: 24px;
  }
  [data-view="compare"] .choice-copy {
    min-height: 90px;
  }
  [data-view="compare"] .compare-actions {
    margin-top: 16px;
  }
}
.dialog-toast {
  position: fixed;
  bottom: calc(var(--keyboard-inset, 0px) + 16px);
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(592px, calc(100% - 32px));
  margin: 0;
  padding: 14px 20px;
  border-radius: 12px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 8px 35px #0008;
  pointer-events: none;
  z-index: 3;
}

.unseen-button {
  width: 100%;
  min-height: 44px;
  border: 1px solid color-mix(in srgb, var(--lime) 38%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--lime) 6%, transparent);
  color: var(--lime);
  font-size: 14px;
  padding: 8px;
  margin-top: 8px;
}
.filters {
  flex-wrap: wrap;
}
@media (max-width: 699px) {
  [data-view="compare"] h1 {
    font-size: 34px;
  }
  [data-view="compare"] .matchup {
    margin-top: 16px;
  }
  [data-view="compare"] .choice-copy {
    min-height: 75px;
    padding-top: 12px;
  }
  [data-view="compare"] .detail-button {
    margin-top: 4px;
    min-height: 40px;
  }
  [data-view="compare"] .compare-actions {
    margin-top: 10px;
  }
  body:has([data-view="compare"]) header {
    padding-top: 18px;
    padding-bottom: 14px;
  }
}

/* Appearance is independent of the selected VS composition. */
:root {
  --accent-fill: #d8f36a;
  --accent-ink: #191d10;
  --poster-bg: #2a2f23;
  --danger: #ffc0b6;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f4ec;
  --panel: #ebece2;
  --ink: #20251b;
  --muted: #626b58;
  --line: #cdd2bf;
  --lime: #526c0c;
  --poster-bg: #dde2d1;
  --danger: #a43022;
}
.primary,
.small-button.filled,
#toast {
  background: var(--accent-fill);
  color: var(--accent-ink);
}
.poster {
  background: var(--poster-bg);
}
.no-poster,
.overview {
  color: var(--ink);
}
.error,
.danger {
  color: var(--danger);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#app,
#public-page {
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
#toast {
  bottom: max(24px, env(safe-area-inset-bottom));
}
/* Menu rows share one hierarchy; descriptions remain readable on phones. */
#dialog[data-menu] {
  width: min(480px, 100%);
}
#dialog[data-menu] .dialog-inner {
  padding: 20px 20px max(24px, env(safe-area-inset-bottom));
}
#dialog[data-menu] h2 {
  font-family: inherit;
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}
.menu-nav {
  clear: both;
  display: grid;
  gap: 4px;
}
.menu-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 14px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 16px;
}
.menu-row:hover,
.menu-row[aria-current] {
  background: var(--panel);
}
.menu-row[aria-current] .menu-row-label {
  color: var(--lime);
}
.menu-row > svg {
  flex-shrink: 0;
  color: var(--muted);
}
.menu-row > svg:last-child {
  width: 16px;
  height: 16px;
}
.menu-row-copy {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 5px;
}
.menu-row-label {
  font-weight: 600;
}
.menu-row-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.menu-language {
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 4px;
}
.menu-language .language-picker {
  flex-wrap: nowrap;
  gap: 8px 12px;
  margin: 10px 0;
}
.menu-language .language-picker-label {
  min-width: 0;
}
.menu-language .language-picker-control {
  flex-shrink: 0;
  max-width: 56%;
}
.menu-language .language-picker select {
  max-width: 100%;
}
.collection-description {
  margin: 4px 0 24px;
  color: var(--muted);
}
.back-menu {
  margin: 0;
  padding-left: 0;
}
.preference-group {
  border: 0;
  margin: 24px 0 0;
  padding: 0;
  min-width: 0;
}
.preference-group legend {
  font-weight: 700;
  margin-bottom: 14px;
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.theme-options label,
.layout-options label {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
}
.theme-options label {
  padding: 14px 6px;
  display: flex;
  justify-content: center;
  gap: 7px;
  font-size: 14px;
}
.preference-group input {
  accent-color: var(--lime);
  margin: 0;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.preference-group label:has(input:checked) {
  border-color: var(--lime);
  box-shadow: inset 0 0 0 1px var(--lime);
}
.preference-group label:has(input:focus-visible) {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.layout-options {
  display: grid;
  gap: 10px;
}
.layout-options label {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
}
.layout-label {
  min-width: 0;
}
.layout-label strong {
  display: block;
  font-size: 16px;
}
.layout-label small {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  margin-top: 4px;
}
.layout-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 84px;
  height: 90px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  padding: 10px 7px;
  background: var(--bg);
}
.layout-preview i {
  width: 50%;
  height: 60px;
  background: linear-gradient(145deg, #e3b777, #725039);
  transform: rotate(-7deg);
}
.layout-preview i:last-child {
  background: linear-gradient(145deg, #b4d1d1, #344558);
  transform: rotate(7deg);
}
.layout-preview b {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) rotate(-10deg);
  z-index: 1;
  color: var(--accent-fill);
  font-style: italic;
  text-shadow: 1px 1px #151714;
}
.layout-preview.double-feature {
  background: var(--panel);
  border: 1px solid var(--line);
  gap: 8px;
}
.layout-preview.double-feature i {
  transform: none;
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--line);
}
.layout-preview.double-feature b {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--lime);
  font:
    800 8px/1 "DM Sans",
    system-ui,
    sans-serif;
  transform: translate(-50%, -50%);
  text-shadow: none;
}
.layout-preview.marquee {
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent-fill);
  gap: 8px;
}
.layout-preview.marquee i {
  transform: none;
  border-radius: 3px;
  box-shadow: 0 4px 10px #0006;
}
.layout-preview.marquee b {
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font:
    800 8px/1 "DM Sans",
    system-ui,
    sans-serif;
  transform: translate(-50%, -50%);
  text-shadow: none;
}
.layout-preview.face-off i {
  border-radius: 4px;
  box-shadow: 0 0 0 1.5px
    color-mix(in srgb, var(--accent-fill) 45%, var(--line));
  transform: rotate(7deg);
}
.layout-preview.face-off i:last-child {
  transform: rotate(-7deg);
}
.layout-preview.face-off b {
  padding: 3px 5px;
  border-radius: 4px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font:
    italic 900 10px/1 system-ui,
    sans-serif;
  transform: translate(-50%, -50%) rotate(-7deg);
  text-shadow: none;
}

/* Shared matchup controls and poster-first composition. */
main[data-view="compare"] {
  max-width: 640px;
  margin: 0 auto;
}
[data-view="compare"] .matchup {
  margin: 30px 0 0;
  gap: clamp(16px, 4vw, 30px);
  align-items: start;
}
[data-view="compare"] .choice-copy {
  padding-top: 18px;
  min-height: 0;
}
[data-view="compare"] .choice h3 {
  font-size: clamp(16px, 2.6vw, 23px);
}
[data-view="compare"] .choice .uk {
  display: none;
}
[data-view="compare"] .poster {
  border-radius: 5px;
  max-height: none;
}
[data-view="compare"] .versus {
  top: 32%;
  width: auto;
  height: auto;
  background: none;
  border: 0;
  color: var(--lime);
  font:
    italic 900 clamp(40px, 9vw, 68px)/1 system-ui,
    sans-serif;
  letter-spacing: -4px;
  transform: translate(-50%, -50%) rotate(-12deg);
  text-shadow:
    3px 3px var(--bg),
    -2px -2px var(--bg);
  z-index: 2;
}
.film-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
  margin-top: 12px;
}
[data-view="compare"] .film-actions button {
  min-height: 44px;
  padding: 7px 0;
  margin: 0;
  width: auto;
  flex: 1 1 auto;
  border: 0;
  background: none;
  font-size: 12px;
}
[data-view="compare"] .film-actions .detail-button {
  color: var(--muted);
}
.duel-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 16px;
  margin-top: 20px;
}
[data-view="compare"] .duel-footer .compare-actions,
.duel-footer .undo {
  margin: 0;
}
.compare-actions .secondary {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 14px;
}
[data-vs-layout="fight-night"] .matchup article:first-child .poster {
  transform: rotate(-4deg);
}
[data-vs-layout="fight-night"] .matchup article:last-of-type .poster {
  transform: rotate(4deg);
}

[data-vs-layout] [data-view="compare"]:has(.matchup) {
  min-height: calc(
    100svh - 136px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 30px;
}
[data-vs-layout] [data-view="compare"] .matchup {
  margin-block: auto;
  padding-top: 22px;
  align-items: stretch;
}
[data-vs-layout] .matchup article,
[data-vs-layout] .matchup .choice,
[data-vs-layout] .matchup .choice-copy {
  display: flex;
  flex-direction: column;
}
[data-vs-layout] .matchup .choice,
[data-vs-layout] .matchup .choice-copy {
  flex: 1;
}
[data-vs-layout] .matchup .poster {
  width: 100%;
  flex-shrink: 0;
}
[data-vs-layout] .matchup .choice-copy {
  gap: 8px;
}
[data-vs-layout] .matchup .year {
  margin-top: auto;
}
[data-vs-layout] .duel-footer {
  margin-top: 0;
}
@media (max-width: 699px) {
  [data-vs-layout] [data-view="compare"]:has(.matchup) {
    min-height: calc(
      100svh - 100px - env(safe-area-inset-top) - env(safe-area-inset-bottom)
    );
  }
}

/* Double Feature: straight 2:3 posters in framed cards with a calm circular VS badge. */
[data-vs-layout="double-feature"] .matchup article {
  z-index: 0;
}
[data-vs-layout="double-feature"] .matchup article::before {
  content: "";
  position: absolute;
  inset: -6px -5px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--panel) 82%, var(--bg));
  border: 1px solid var(--line);
  box-shadow: 0 10px 26px -14px #0008;
  z-index: -1;
  pointer-events: none;
}
[data-vs-layout="double-feature"] .matchup .poster {
  border-radius: 8px;
  box-shadow:
    0 8px 20px -8px #0007,
    0 0 0 1px color-mix(in srgb, var(--ink) 10%, transparent);
}
[data-vs-layout="double-feature"] [data-view="compare"] .versus {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--line);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--panel) 82%, var(--bg)),
    0 4px 12px #0006;
  color: var(--lime);
  font:
    800 11px/1 "DM Sans",
    system-ui,
    sans-serif;
  letter-spacing: 0.08em;
  transform: translate(-50%, -50%);
  text-shadow: none;
}

/* Marquee: unified spotlight stage, center divider, serif titles and filled VS pill. */
[data-vs-layout="marquee"] [data-view="compare"] .matchup {
  z-index: 0;
}
[data-vs-layout="marquee"] [data-view="compare"] .matchup::before {
  content: "";
  position: absolute;
  inset: 0 -8px -8px;
  border-radius: 16px;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--panel) 88%, var(--bg)) 0%,
    color-mix(in srgb, var(--panel) 28%, var(--bg)) 100%
  );
  border: 1px solid var(--line);
  border-top: 2px solid var(--lime);
  box-shadow: 0 16px 36px -18px #0009;
  z-index: -1;
  pointer-events: none;
}
[data-vs-layout="marquee"] [data-view="compare"] .matchup::after {
  content: "";
  position: absolute;
  top: 10px;
  bottom: 4px;
  left: 50%;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent,
    var(--line) 15%,
    var(--line) 85%,
    transparent
  );
  transform: translateX(-50%);
  z-index: 1;
  pointer-events: none;
}
[data-vs-layout="marquee"] .matchup .poster {
  border-radius: 6px;
  box-shadow:
    0 12px 26px -10px #000a,
    0 0 0 1px color-mix(in srgb, var(--lime) 30%, var(--line));
}
[data-vs-layout="marquee"] .matchup .choice-copy {
  font-family: "Playfair Display", Georgia, serif;
}
[data-vs-layout="marquee"] .matchup .choice h3 {
  font-weight: 600;
  letter-spacing: -0.3px;
}
[data-vs-layout="marquee"] [data-view="compare"] .versus {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  border: 2px solid var(--bg);
  box-shadow: 0 4px 14px #0007;
  font:
    800 11px/1 "DM Sans",
    system-ui,
    sans-serif;
  letter-spacing: 0.1em;
  transform: translate(-50%, -50%);
  text-shadow: none;
}

/* Face-Off: inward-leaning 2:3 posters with framed edges and angled VS stamp. */
[data-vs-layout="face-off"] .matchup article:first-child .poster {
  transform: rotate(3deg);
}
[data-vs-layout="face-off"] .matchup article:last-of-type .poster {
  transform: rotate(-3deg);
}
[data-vs-layout="face-off"] .matchup .poster {
  border-radius: 8px;
  box-shadow:
    0 14px 30px -10px #000b,
    0 0 0 2px color-mix(in srgb, var(--lime) 42%, var(--line));
}
[data-vs-layout="face-off"] [data-view="compare"] .versus {
  padding: 6px 11px;
  border-radius: 8px;
  background: var(--accent-fill);
  color: var(--accent-ink);
  border: 2px solid var(--bg);
  box-shadow: 0 8px 20px #0008;
  font:
    italic 900 clamp(20px, 4.5vw, 26px)/1 system-ui,
    sans-serif;
  letter-spacing: -1.5px;
  transform: translate(-50%, -50%) rotate(-7deg);
  text-shadow: none;
}
@media (max-width: 370px) {
  .layout-options label {
    gap: 9px;
    padding: 10px;
  }
  .layout-preview {
    width: 65px;
  }
  .theme-options label {
    gap: 4px;
    font-size: 13px;
  }
}

.language-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (max-width: 370px) {
  .theme-options:not(.language-options) label {
    flex-direction: column;
    align-items: center;
    gap: 6px;
  }
}
:lang(uk) .stats {
  flex-wrap: wrap;
  gap: 8px 16px;
}

/* Color palettes, independent of light/dark appearance. */
:root[data-color="ocean"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.ocean {
  --bg: #111b24;
  --panel: #1b2b38;
  --ink: #e8f3fa;
  --muted: #a0b6c6;
  --line: #354d60;
  --lime: #85d5f5;
  --accent-fill: #85d5f5;
  --accent-ink: #102631;
  --poster-bg: #263d4e;
}
:root[data-color="ocean"][data-theme="light"],
:root[data-theme="light"] .color-swatch.ocean {
  --bg: #f0f7fa;
  --panel: #e1eef4;
  --ink: #172c3b;
  --muted: #526b7c;
  --line: #bfd3df;
  --lime: #166383;
  --accent-fill: #85d5f5;
  --accent-ink: #102631;
  --poster-bg: #cedee8;
}
:root[data-color="violet"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.violet {
  --bg: #1b1626;
  --panel: #2a2239;
  --ink: #f3edfc;
  --muted: #b5a6ca;
  --line: #493b60;
  --lime: #cbb0ff;
  --accent-fill: #cbb0ff;
  --accent-ink: #28183f;
  --poster-bg: #392e4d;
}
:root[data-color="violet"][data-theme="light"],
:root[data-theme="light"] .color-swatch.violet {
  --bg: #f7f3fc;
  --panel: #ede5f6;
  --ink: #30213f;
  --muted: #726080;
  --line: #d7c9e5;
  --lime: #70449d;
  --accent-fill: #cbb0ff;
  --accent-ink: #28183f;
  --poster-bg: #e0d3ee;
}
:root[data-color="sunset"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.sunset {
  --bg: #1f1512;
  --panel: #2e201b;
  --ink: #fdf0e6;
  --muted: #c4a693;
  --line: #523b31;
  --lime: #ffb085;
  --accent-fill: #ffb085;
  --accent-ink: #361c0e;
  --poster-bg: #402b22;
}
:root[data-color="sunset"][data-theme="light"],
:root[data-theme="light"] .color-swatch.sunset {
  --bg: #fff5ed;
  --panel: #f6e7da;
  --ink: #3c281c;
  --muted: #80634f;
  --line: #e3cdbb;
  --lime: #9c4823;
  --accent-fill: #ffb085;
  --accent-ink: #361c0e;
  --poster-bg: #ecd5c2;
}
:root[data-color="gold"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.gold {
  --bg: #161512;
  --panel: #22201b;
  --ink: #f5f0e6;
  --muted: #afa693;
  --line: #3d382e;
  --lime: #f3c663;
  --accent-fill: #f3c663;
  --accent-ink: #241b08;
  --poster-bg: #2e2a22;
}
:root[data-color="gold"][data-theme="light"],
:root[data-theme="light"] .color-swatch.gold {
  --bg: #faf6ed;
  --panel: #efe8d8;
  --ink: #262015;
  --muted: #6e634f;
  --line: #d8ccb4;
  --lime: #8a620a;
  --accent-fill: #f3c663;
  --accent-ink: #241b08;
  --poster-bg: #e4dac4;
}
:root[data-color="crimson"][data-theme="dark"],
:root[data-theme="dark"] .color-swatch.crimson {
  --bg: #191316;
  --panel: #271d22;
  --ink: #faedf1;
  --muted: #bfa3ac;
  --line: #48343d;
  --lime: #ff8fa8;
  --accent-fill: #ff8fa8;
  --accent-ink: #331019;
  --poster-bg: #36262d;
}
:root[data-color="crimson"][data-theme="light"],
:root[data-theme="light"] .color-swatch.crimson {
  --bg: #fcf3f5;
  --panel: #f4e3e8;
  --ink: #331a22;
  --muted: #785661;
  --line: #dfc5cd;
  --lime: #9e2a4b;
  --accent-fill: #ff8fa8;
  --accent-ink: #331019;
  --poster-bg: #ead3da;
}

.color-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.color-options label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  cursor: pointer;
  font-size: 14px;
}
.appearance-control {
  margin-top: 20px;
}
.appearance-control:first-of-type {
  margin-top: 0;
}
.appearance-control legend {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 10px;
}
.color-swatch {
  display: flex;
}
.color-swatch i {
  width: 12px;
  height: 22px;
  background: var(--panel);
}
.color-swatch i:first-child {
  border-radius: 6px 0 0 6px;
  background: var(--accent-fill);
}
.color-swatch i:last-child {
  border-radius: 0 6px 6px 0;
  background: var(--bg);
}
.color-swatch.lime {
  --panel: #20231e;
  --accent-fill: #d8f36a;
  --bg: #151714;
}
:root[data-theme="light"] .color-swatch.lime {
  --panel: #ebece2;
  --bg: #f6f4ec;
}

.comparison-question {
  text-align: center;
  font-size: 0.85rem;
  margin: 0 0 0.65rem;
  color: var(--muted);
}

/* Keep primary navigation at the viewport bottom at every screen size. */
:root {
  --nav-height: calc(52px + env(safe-area-inset-bottom));
}
#app,
#public-page {
  padding-bottom: calc(var(--nav-height) + 24px);
}
.primary-nav {
  background: var(--bg);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.primary-nav a {
  min-width: 44px;
  min-height: 60px;
  padding: 6px 4px;
  font-size: 0.8rem;
  line-height: 1.25;
  justify-content: center;
}
.primary-nav a[aria-current] {
  background: var(--panel);
  color: var(--lime);
  box-shadow: inset 0 3px var(--lime);
  font-weight: 800;
}
#toast {
  bottom: calc(var(--nav-height) + 12px);
}
.header-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.header-add:hover {
  border-color: var(--muted);
  background: var(--panel);
}
.header-add svg {
  flex-shrink: 0;
  width: 18px;
  color: var(--lime);
}
header [data-action="menu"] {
  position: relative;
}
header [data-action="menu"][data-filtered="true"]::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--bg);
}
.list-search {
  margin-top: 20px;
}
.movie-row[hidden] {
  display: none;
}
.search-result > div {
  min-width: 0;
}
.result-actions button {
  min-height: 44px;
}
h1:focus {
  outline: none;
}
.heading h1,
.search-result h3 {
  overflow-wrap: anywhere;
}
@media (max-width: 899px) {
  [data-vs-layout] [data-view="compare"]:has(.matchup) {
    min-height: calc(
      100svh - 100px - var(--nav-height) - env(safe-area-inset-top)
    );
    gap: 10px;
  }
  [data-vs-layout] [data-view="compare"] .matchup {
    padding-top: 10px;
  }
  [data-vs-layout] .matchup .poster {
    aspect-ratio: 2 / 3;
  }
  [data-vs-layout] .matchup .poster img {
    object-fit: contain;
  }
  [data-vs-layout] .matchup .choice-copy {
    padding-top: 12px;
    gap: 4px;
  }
  .duel-footer {
    margin-top: 8px;
  }
}

@media (min-width: 900px) {
  [data-vs-layout] [data-view="compare"]:has(.matchup) {
    gap: 12px;
  }
  [data-vs-layout] .matchup .poster img {
    object-fit: contain;
  }
}
html {
  scroll-padding-bottom: calc(var(--nav-height) + 24px);
}
@media (max-width: 899px) and (max-height: 700px) {
  [data-vs-layout] [data-view="compare"]:has(.matchup) {
    gap: 6px;
  }
}

.watch-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.watch-row .movie-row {
  flex: 1;
  min-width: 0;
}
.watch-row .movie-menu {
  flex: 0 0 44px;
}
.matchup article {
  position: relative;
}
.movie-menu {
  min-width: 44px;
  min-height: 44px;
  font-size: 1.5rem;
}

.result-actions .secondary {
  font-size: 0.8rem;
  padding: 8px 12px;
  min-height: 44px;
}
.result-actions .muted {
  flex-basis: 100%;
}
.watch-row .badge {
  max-width: 40%;
  white-space: normal;
}
[data-action="interest"][aria-busy="true"] {
  opacity: 0.5;
}

.pin-indicator {
  display: inline-flex;
  vertical-align: middle;
  margin-inline-start: 8px;
  color: var(--ink);
}
.pin-indicator svg {
  width: 16px;
  height: 16px;
}

/* Ranking feedback remains in document flow, above the comparison controls. */
.ranking-result,
.placement-progress {
  margin: 12px 0 4px;
  padding: 16px;
  border: 1px solid var(--muted);
  border-radius: 18px;
  text-align: left;
  overflow-wrap: anywhere;
}
.ranking-result {
  display: flex;
  align-items: center;
  gap: 16px;
}
.ranking-result.leader {
  border: 2px solid var(--lime);
  box-shadow: inset 0 0 0 4px color-mix(in srgb, var(--lime) 16%, transparent);
}
.ranking-result.top3,
.ranking-result.top10 {
  border-color: var(--lime);
}
.result-marker {
  position: relative;
  flex: 0 0 58px;
}
.result-marker .poster {
  width: 58px;
  height: 78px;
  border-radius: 8px;
  overflow: hidden;
}
.result-marker .no-poster {
  font-size: 10px;
}
.result-marker b {
  position: absolute;
  right: -8px;
  bottom: -6px;
  padding: 3px 7px;
  border-radius: 8px;
  background: var(--lime);
  color: var(--accent-ink);
}
.result-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.result-copy strong {
  font-size: 1.15rem;
}
.result-copy small,
.placement-progress small {
  color: var(--muted);
}
.result-copy button {
  justify-self: start;
}
.result-neighbors {
  margin: 8px 0;
  padding-left: 28px;
}
.placement-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.placement-heading > div {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 4px;
}
.placement-marker {
  color: var(--lime);
  font-size: 28px;
}
.placement-save-state {
  max-width: 90px;
}
.placement-progress .text-button {
  margin-top: 6px;
}
#live-position p {
  font-size: 0.9rem;
  margin: 8px 0;
}
.live-range {
  display: flex;
  gap: 16px;
  align-items: center;
}
.live-range > div:last-child {
  display: grid;
  gap: 6px;
}
.position-rail {
  position: relative;
  width: 10px;
  height: 110px;
  border-radius: 8px;
  background: color-mix(in srgb, var(--muted) 25%, transparent);
}
.position-rail i {
  position: absolute;
  left: 0;
  width: 100%;
  background: var(--lime);
  border-radius: 8px;
  transition:
    top 0.6s,
    height 0.6s;
}
.result-enter .result-marker {
  animation: rank-resolve 0.65s ease-out;
}
.result-enter.leader {
  animation: rank-accent 0.8s ease-out;
}
.progress-saved .placement-marker {
  animation: rank-accent 0.6s ease-out;
}
@keyframes rank-resolve {
  from {
    opacity: 0.4;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes rank-accent {
  50% {
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--lime) 25%, transparent);
  }
}
.share-top {
  margin-bottom: 16px;
}
.share-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}
.share-accessible-list {
  padding-left: 28px;
  overflow-wrap: anywhere;
}
.share-accessible-list li {
  padding: 5px 0;
}
.share-accessible-list span {
  color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .result-enter,
  .result-enter .result-marker,
  .progress-saved .placement-marker {
    animation: none;
  }
  .position-rail i {
    transition: none;
  }
  html {
    scroll-behavior: auto;
  }
}

.placement-possibilities {
  height: 5px;
  margin: 12px 0 4px;
  display: flex;
  justify-content: center;
  border-radius: 8px;
  background: var(--line);
}
.placement-possibilities i {
  display: block;
  height: 100%;
  min-width: 5px;
  border-radius: 8px;
  background: var(--lime);
}
.progress-saved .placement-possibilities i {
  animation: narrow-possibilities 0.65s ease-out;
}
@keyframes narrow-possibilities {
  from {
    width: var(--previous-width);
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress-saved .placement-possibilities i {
    animation: none;
  }
}

.result-enter.rank-up .result-marker {
  animation: rank-up 0.65s ease-out;
}
.result-enter.rank-down .result-marker {
  animation: rank-down 0.65s ease-out;
}
@keyframes rank-up {
  from {
    opacity: 0.4;
    transform: translateY(15px);
  }
}
@keyframes rank-down {
  from {
    opacity: 0.4;
    transform: translateY(-15px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .result-enter.rank-up .result-marker,
  .result-enter.rank-down .result-marker {
    animation: none;
  }
}
.ranking-result.top3 {
  border-width: 2px;
  background: color-mix(in srgb, var(--lime) 8%, var(--bg));
}
.progress-saved .position-rail i {
  animation: narrow-range 0.65s ease-out;
}
@keyframes narrow-range {
  from {
    top: var(--previous-top);
    height: var(--previous-height);
  }
}
@media (prefers-reduced-motion: reduce) {
  .progress-saved .position-rail i {
    animation: none;
  }
}

/* Keep the films, rather than controls and repeated labels, in the foreground. */
.watch-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0 8px;
}
.watch-toolbar .list-search {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0 14px;
}
.watch-toolbar input {
  min-height: 48px;
}
.watch-toolbar .icon-button,
.watch-row .movie-menu {
  border-color: transparent;
  border-radius: 10px;
}
.watch-toolbar .icon-button {
  background: var(--panel);
  color: var(--lime);
}
.watch-row {
  border-bottom: 1px solid var(--line);
}
.watch-row .movie-row {
  border: 0;
  gap: 12px;
  padding-block: 12px;
}
.watch-row .movie-row .poster {
  width: 44px;
}
#watch-next-list .section-label {
  margin: 22px 0 4px;
}
.primary-nav {
  padding: 0 8px env(safe-area-inset-bottom);
}
.primary-nav a {
  position: relative;
  flex-direction: row;
  gap: 7px;
  min-width: 0;
  min-height: 51px;
  padding: 8px 4px;
  border-radius: 0;
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}
.primary-nav svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.primary-nav a[aria-current]::before {
  content: "";
  position: absolute;
  top: 0;
  left: calc(50% - 12px);
  width: 24px;
  height: 2px;
  border-radius: 2px;
  background: var(--lime);
}
.primary-nav a[aria-current] {
  background: none;
  box-shadow: none;
  font-weight: 600;
}
@media (max-width: 899px) {
  header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 0 20px;
  }
  .header-actions {
    gap: 8px;
    margin-left: auto;
  }
  .brand {
    font-size: 24px;
  }
  #app,
  #public-page {
    padding-inline: 20px;
  }
  [data-view="watch-next"] h1,
  [data-view="top"] h1,
  [data-view="library"] h1 {
    font-size: 36px;
    margin: 4px 0;
  }
}

.heading-actions {
  display: flex;
  flex-shrink: 0;
  gap: 6px;
}
.heading-actions .icon-button {
  border-color: transparent;
}
.heading-actions .share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 44px;
  padding: 6px 14px 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
.heading-actions .share-button:hover {
  border-color: var(--muted);
  background: var(--panel);
}
.heading-actions .share-button svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  color: var(--lime);
}
[data-view="top"] > .heading {
  flex-wrap: wrap;
  row-gap: 8px;
}
[data-view="top"] .stats {
  margin: 8px 0 18px;
}

/* Keep each matchup anchored while titles, artwork and feedback change. */
[data-view="compare"] .matchup .choice h3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  block-size: 2lh;
  flex-shrink: 0;
  overflow: hidden;
}
[data-view="compare"] .matchup .no-poster {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
[data-vs-layout] [data-view="compare"] .matchup {
  margin-block: 0;
}

/* Outgoing artwork never participates in layout or accepts another pick. */
[data-vs-layout] .matchup > article > .choice.choice-outgoing {
  position: absolute;
  inset: 0 0 auto;
  pointer-events: none;
  margin: 0;
}

/* Centered stack typography, inline details metadata, and divided footer. */
.comparison-prompt {
  text-align: center;
  margin: 0;
}
.comparison-question {
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  line-height: 1.3;
  margin: 0;
  color: var(--ink);
}
.comparison-subtitle {
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  margin: 4px 0 0;
  color: var(--muted);
}
[data-vs-layout] .matchup article {
  align-items: center;
  text-align: center;
}
[data-vs-layout] .matchup .choice {
  flex: 0 0 auto;
  width: 100%;
  align-items: center;
  text-align: center;
}
[data-vs-layout] .matchup .choice-copy {
  flex: 0 0 auto;
  width: 100%;
  font-size: clamp(16px, 2.5vw, 19px);
  line-height: 1.25;
  block-size: calc(2lh + 12px);
  min-height: 0;
  padding-top: 12px;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0;
}
[data-vs-layout] .matchup .choice h3 {
  width: 100%;
  block-size: auto;
  max-block-size: 2lh;
  font-size: inherit;
  font-weight: 700;
  line-height: inherit;
  text-align: center;
}
[data-view="compare"] .choice-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px 6px;
  width: 100%;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}
[data-view="compare"] .choice-meta .year {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}
[data-view="compare"] .choice-meta .meta-sep {
  color: var(--muted);
}
[data-view="compare"] .choice-meta .detail-button {
  width: auto;
  min-height: 24px;
  margin: 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent);
  text-underline-offset: 3px;
}
[data-view="compare"] .choice-meta .detail-button:hover {
  color: var(--ink);
}
[data-vs-layout] .film-actions {
  width: 100%;
  margin-top: auto;
  padding-top: 10px;
}
[data-vs-layout] .film-actions .unseen-button {
  width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 65%, transparent);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  transition:
    border-color 0.15s,
    color 0.15s,
    background 0.15s;
}
[data-vs-layout] .film-actions .unseen-button:hover {
  border-color: var(--muted);
  color: var(--ink);
  background: var(--panel);
}
[data-vs-layout="double-feature"] .film-actions .unseen-button {
  background: color-mix(in srgb, var(--bg) 75%, transparent);
}
[data-vs-layout="double-feature"] .film-actions .unseen-button:hover {
  background: var(--bg);
}
[data-vs-layout="marquee"] .matchup .choice h3 {
  font-weight: 600;
}
[data-view="compare"] .duel-footer {
  gap: 4px 12px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--line) 55%, transparent);
}
[data-view="compare"] .duel-footer .dot-sep {
  color: var(--line);
}
[data-view="compare"] .duel-footer .compare-actions .secondary,
[data-view="compare"] .duel-footer .undo {
  min-height: 40px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 13px;
}
[data-view="compare"] .duel-footer .compare-actions .secondary:hover,
[data-view="compare"] .duel-footer .undo:hover {
  color: var(--ink);
  background: var(--panel);
}

/* Social exports keep the image and public link as explicit, separate actions. */
.share-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 20px 0;
}
.share-options label {
  flex: 1;
  min-width: 130px;
  display: grid;
  gap: 8px;
  font-size: 0.85rem;
}
.share-options select {
  width: 100%;
  padding: 12px;
  border-radius: 10px;
  background: var(--panel, #222d3b);
  color: inherit;
  border: 1px solid var(--line, #667080);
  font: inherit;
}
.public-share {
  margin: 24px 0;
  padding-top: 16px;
  border-top: 1px solid var(--line, #667080);
}
.public-share p {
  font-size: 0.85rem;
  line-height: 1.5;
}
.public-share input {
  width: 100%;
  min-width: 0;
  margin: 8px 0 16px;
  padding: 12px;
  font: inherit;
  border-radius: 8px;
}
.public-share a {
  color: inherit;
}

.feedback-categories {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.feedback-categories label {
  justify-content: flex-start;
  padding: 12px 14px;
  text-align: left;
}
.feedback-field {
  margin-top: 20px;
}
.feedback-field label {
  display: block;
  font-weight: 700;
  margin-bottom: 10px;
}
.feedback-field textarea,
.feedback-field input {
  width: 100%;
  padding: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  line-height: 1.5;
}
.feedback-field textarea {
  resize: vertical;
  min-height: 120px;
}
.feedback-diagnostics {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.feedback-diagnostics input {
  flex: 0 0 auto;
  margin-top: 4px;
}
.feedback-privacy {
  margin: 16px 0 0;
}
.feedback-privacy a {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.feedback-submit {
  width: 100%;
  margin-top: 24px;
}

/* Keep the selection list between compact, always visible controls. */
#dialog[data-share-selection] {
  width: min(760px, 100%);
  max-width: 100%;
  height: calc(96dvh - var(--keyboard-inset, 0px));
  max-height: calc(96dvh - var(--keyboard-inset, 0px));
  overflow: hidden;
}
#dialog[data-share-selection][open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
#dialog[data-share-selection] .dialog-header {
  padding: 8px 16px;
}
#dialog[data-share-selection] h2 {
  font-size: 22px;
}
#dialog[data-share-selection] .dialog-inner {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  padding: 8px 16px max(12px, env(safe-area-inset-bottom));
}
.share-genre {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}
.share-genre select {
  min-width: 0;
  flex: 1;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.share-selection-tools {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}
.share-selection-tools button {
  min-height: 44px;
  padding: 6px 0;
  font-size: 14px;
}
.share-selection {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.share-selection-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.share-selection-row:last-child {
  border-bottom: 0;
}
.share-selection-row > input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  accent-color: var(--lime);
}
.share-selection-row .poster {
  width: 36px;
  flex: 0 0 36px;
}
.share-selection-row .no-poster {
  font: 9px/1.2 system-ui;
  padding: 3px;
  overflow: hidden;
}
.share-selection-row strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.share-selection-row .rank {
  font-size: 16px;
  min-width: 24px;
}
.share-selection-row > span:last-child {
  display: grid;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.3;
}
.share-selection-row .year {
  margin: 0;
}
.share-selection-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 10px;
}
.share-selection-footer p {
  margin: 0 auto 0 0;
  font-size: 14px;
  white-space: nowrap;
}
.share-selection-footer button {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 14px;
}

.public-links {
  text-align: center;
  padding: 14px 20px 100px;
  color: var(--muted);
  font-size: 11px;
}
.public-links a {
  color: inherit;
  text-underline-offset: 3px;
}
.share-actions .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

body:has(main[data-view="compare"]) .public-links {
  display: none;
}

/* Active genre chip appears only when a comparison genre filter is applied. */
.comparison-toolbar {
  display: flex;
  justify-content: center;
  margin: 0 0 12px;
}
[data-vs-layout] .comparison-toolbar {
  /* Comparison layouts already space their children with flex gap. */
  margin-bottom: 0;
}
.comparison-genre-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 4px 8px 4px 12px;
  border: 1px solid color-mix(in srgb, var(--lime) 55%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--lime) 14%, transparent);
  color: var(--lime);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.comparison-genre-chip:disabled {
  /* Save locks briefly block genre changes without flashing the active chip. */
  opacity: 1;
}
.comparison-genre-chip:hover:not(:disabled) {
  border-color: var(--lime);
  background: color-mix(in srgb, var(--lime) 22%, transparent);
}
.comparison-genre-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--lime) 22%, transparent);
  color: var(--lime);
}
.comparison-genre-clear svg {
  width: 12px;
  height: 12px;
}
@media (min-width: 900px) {
  [data-vs-layout] [data-view="compare"]:has(.matchup) {
    min-height: calc(
      100svh - 136px - var(--nav-height) - env(safe-area-inset-top)
    );
  }
  [data-vs-layout] [data-view="compare"]:has(.matchup) .matchup .poster {
    width: min(100%, max(180px, calc((100svh - 520px) * 2 / 3)));
  }
}
.top-search-tools {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin: 23px 0 16px;
}
.top-search-tools .search-box {
  flex: 1;
  min-width: 0;
  margin: 0;
}
.top-search-tools .search-box > svg {
  flex-shrink: 0;
}
.top-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 54px;
  padding: 10px 12px;
  font-size: 14px;
}
.top-filter-toggle[aria-expanded="true"],
.top-filter-toggle[data-active="true"] {
  border-color: var(--lime);
}
.filter-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--accent-ink);
  font-size: 12px;
}
.top-filters {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  margin: 0 0 22px;
}
.top-filters label {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}
.top-filters select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--panel);
  color: var(--ink);
  font-size: 14px;
}
.top-filter-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
}
.top-filter-result .footnote {
  flex: 1 1 200px;
  margin: 0 0 12px;
}
.top-filter-result button {
  min-height: 44px;
  margin: 0 0 8px;
}
#top-no-matches {
  padding-block: 32px;
}

/* One language control for public headers, Menu and Settings. */
.language-picker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 16px 0;
  font-size: 14px;
  color: var(--ink);
}
.language-picker-label {
  font-weight: 600;
}
.language-picker-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: var(--panel);
}
.language-picker-control:focus-within {
  outline: 2px solid var(--lime);
  outline-offset: 3px;
}
.language-picker-control svg {
  flex-shrink: 0;
}
.language-picker select {
  width: auto;
  max-width: 180px;
  min-width: 0;
  min-height: 42px;
  padding: 6px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.language-picker select:focus-visible {
  outline: none;
}
.language-picker-compact {
  margin: 0;
  font-size: 13px;
}
.language-picker-compact .language-picker-control {
  background: transparent;
  border-radius: 999px;
}
.public-language {
  margin-left: auto;
}

.list-more {
  display: block;
  margin: 24px auto;
}

.backup-reminder-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.backup-reminder-actions button {
  min-height: 48px;
  margin: 0;
}
.backup-reminder-actions .text-button {
  margin: 0;
  padding: 10px 4px;
  text-align: left;
  font-size: 14px;
}
.installation-help section + section {
  margin-top: 24px;
}
.installation-help p {
  line-height: 1.6;
}
