body.tool {
  max-width: 58rem;
  padding: 0.65rem 1.15rem 2.4rem;
}

body.tool[data-page="ranking"] {
  max-width: 72rem;
}

body.tool header {
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem 1.4rem;
}

body.tool .header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

body.tool .header-toggles {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  align-self: flex-start;
  flex: 0 0 auto;
  max-width: none;
  gap: 0.35rem;
}

body.tool .theme-toggle {
  margin-top: 0;
}

body.tool .premium-benefits {
  flex: 1 1 100%;
  max-width: none;
  text-align: left;
}

body.tool footer a:not(.donate-button) {
  font-size: 0.78rem;
}

body.tool footer .footer-privacy {
  margin-left: auto;
}

body.tool #error-log-panel {
  flex: 1 1 100%;
  width: 100%;
}

[hidden] {
  display: none !important;
}

.crumb {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
}

.crumb a {
  color: var(--muted);
  text-decoration: none;
}

.crumb a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.panel {
  margin-top: 0.85rem;
  padding: 0.75rem 0.85rem 0.85rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 1px 0 var(--lift);
}

.panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.15rem;
}

.panel label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin: 0 0 0.75rem;
  color: var(--text);
  font-size: 0.92rem;
}

.panel input[type="text"],
.panel input[type="number"],
.panel select {
  width: 100%;
  padding: 0.45rem 0.6rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.panel input:focus-visible,
.panel select:focus-visible,
.panel button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.row {
  display: grid;
  gap: 0.75rem;
}

.panel > label[for="cap"] {
  display: block;
  margin: 0 0 0.35rem;
}

.count-ticks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 1.1rem;
  margin: 0.35rem 0 0.65rem;
}

.count-ticks .check.is-locked {
  color: var(--muted);
}

.ranking-account {
  margin: 0 0 0.85rem;
  padding: 0 0 0.7rem;
  border-bottom: 1px solid var(--line);
}

.follow-list-actions {
  align-items: center;
  margin: 0.1rem 0 0.15rem;
  gap: 0.5rem 0.85rem;
}

.follow-list-actions #get-following {
  flex: 0 0 auto;
}

.loaded-summary {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0;
  color: var(--text);
  font-size: 0.86rem;
  flex: 1 1 12rem;
}

.loaded-user {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.basic-note {
  margin: 0.15rem 0 0.65rem;
}

.select-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.1rem;
  margin: 0.15rem 0 0.5rem;
  font-size: 0.9rem;
}

.select-row .check {
  margin: 0;
}

.select-count {
  color: var(--muted);
  margin-left: 0;
}

.panel button.link-button {
  padding: 0;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 0.92rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.panel button.link-button:hover {
  color: var(--muted);
}

.search-line {
  margin: 0.06rem 0 0;
}

.search-line:first-of-type {
  margin-top: 0.3rem;
}

.token-line {
  display: block;
}

.results-more {
  margin: 0.6rem 0 0;
  color: var(--text);
  font-size: 0.9rem;
}

.easter-egg {
  margin: 2rem 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.easter-egg p {
  margin: 0;
}

.easter-egg ul {
  margin: 0.4rem 0 0;
  padding-left: 1.2rem;
}

.easter-egg li {
  margin: 0.25rem 0 0;
}

img.poster-pending {
  background: var(--thumb);
  animation: poster-pulse 1.1s ease-in-out infinite;
}

.film-cell img.poster-pending {
  min-height: 3.4rem;
}

.random-card img.poster-pending {
  min-height: 11.2rem;
}

@keyframes poster-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

.tool-group {
  margin-top: 1.5rem;
  padding: 1.05rem 1.05rem 1.15rem;
  background: var(--card);
  border: 2px solid var(--line-hover);
  border-radius: 16px;
  box-shadow: 0 1px 0 var(--lift);
}

.tool-group-head {
  margin: 0 0 0.35rem;
}

.tool-group-head h2 {
  margin: 0 0 0.4rem;
  font-size: 1.2rem;
}

.tool-group-head p {
  margin: 0.3rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.tool-group-head a {
  color: var(--ink);
}

.tool-group-head code {
  font-size: 0.88em;
}

.tool-group .tool-card {
  margin-top: 0.85rem;
  background: var(--bg);
  border-width: 1.5px;
}

.tool-group .panel {
  margin-top: 0.85rem;
}

.tool-card {
  padding: 0;
}

.tool-card summary {
  position: relative;
  padding-right: 2.2rem;
  cursor: pointer;
  list-style: none;
}

.tool-card summary {
  padding: 1rem 2.2rem 1.1rem 1.05rem;
}

.tool-card summary::-webkit-details-marker,
.tool-card summary::marker {
  display: none;
  content: "";
}

.tool-card summary::after {
  content: "";
  position: absolute;
  right: 1.05rem;
  top: 1.2rem;
  width: 0.42rem;
  height: 0.42rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

details.tool-card[open] > summary::after {
  top: 1.35rem;
  transform: rotate(-135deg);
}

.tool-card summary h2 {
  margin: 0;
}

.tool-card.is-soon summary h2 {
  color: var(--ink);
}

.tool-card.is-soon summary p {
  font-style: italic;
}

.tool-body {
  padding: 0.65rem 0.75rem 0.8rem;
  border-top: 1px solid var(--line);
}

.preview {
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 0.88rem;
}

.tool-note,
.hint {
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.hint {
  margin-top: -0.25rem;
}

.follower-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 0.75rem;
  align-content: start;
  max-height: 16rem;
  overflow: auto;
  margin: 0.35rem 0 0;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
}

.follower-list label {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin: 0.08rem 0;
  font-size: 0.9rem;
}

@media (max-width: 639px) {
  .follower-list {
    grid-template-columns: 1fr;
  }

  .manual-row {
    flex-wrap: wrap;
  }
}

.follower-note {
  flex: 1 0 100%;
  margin: 0 0 0.4rem 1.9rem;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.follower-avatar,
.user-avatar,
.user-chip-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--thumb);
  flex: 0 0 auto;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  vertical-align: middle;
}

.user-chip-avatar {
  width: 1.15rem;
  height: 1.15rem;
}

.follower-list .user-chip-avatar,
.loaded-user .user-chip-avatar {
  width: 1.75rem;
  height: 1.75rem;
}

.user-chip-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.user-chip-link:hover .user-chip-name {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.included {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.manual-note {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.panel .manual-row input[type="text"] {
  width: 13.5rem;
  max-width: 100%;
  margin: 0;
  flex: 0 0 13.5rem;
}

.panel button.danger {
  border-color: var(--line-hover);
}

.star-select {
  width: auto;
  min-width: 6.5rem;
}

.sort-row label,
.ranking-row label,
.random-row label {
  margin-bottom: 0;
}

.manual-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
  margin: 0.4rem 0 0.15rem;
}

.manual-heading {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.4rem;
  white-space: nowrap;
  flex: 0 1 auto;
  color: var(--text);
  font-size: 0.92rem;
}

.following-more {
  align-items: center;
  margin-top: 0.5rem;
}

@media (min-width: 640px) {
  .row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
    gap: 0.75rem 1rem;
  }

  .random-row,
  .sort-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .ranking-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 880px) {
  .ranking-row {
    grid-template-columns: auto auto auto;
    justify-content: start;
  }

  /* One check lives here now (the unrated control became From = 0), so the old two-column
     split would leave the longer label wrapped into half the row. */
  .ranking-checks {
    grid-template-columns: minmax(0, 1fr);
  }

  .random-row {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
}

.check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
}

.check input {
  width: auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.35rem;
}

.panel button {
  padding: 0.45rem 0.85rem;
  color: var(--bg);
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 999px;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.panel button.secondary,
.panel button.sort {
  color: var(--ink);
  background: var(--card);
  border-color: var(--line);
}

.panel button:hover {
  border-color: var(--line-hover);
}

.panel button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  margin: 0.7rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status a {
  color: inherit;
  text-decoration: underline;
}

progress {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  height: 0.45rem;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th,
td {
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th button.sort {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
}

.film-cell {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.film-cell img {
  width: 2.4rem;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--thumb);
  border-radius: 4px;
}

.results-filter {
  display: block;
  margin: 0.85rem 0 0.4rem;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: end;
  margin: 0.65rem 0 0.45rem;
}

.results-toolbar .sort-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
}

.results-toolbar .sort-field select {
  font: inherit;
  padding: 0.25rem 0.45rem;
  min-width: 12rem;
}

#error-log-panel {
  width: min(22rem, 100%);
  text-align: left;
}

.error-log-out {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.65rem;
  max-height: 14rem;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.78rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

@media (min-width: 720px) {
  .results-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 960px) {
  body.tool[data-page="ranking"] .results-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

.film-card {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  padding: 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  cursor: pointer;
  text-align: left;
}

.film-card:hover {
  border-color: var(--line-hover);
}

.film-card.is-open {
  cursor: default;
  border-color: #00e054;
}

.film-card-head {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.film-card-head img {
  width: 4.4rem;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--thumb);
  border-radius: 6px;
}

.film-card-head img.poster-pending {
  min-height: 6.6rem;
}

.film-card-head a {
  color: inherit;
  text-decoration: none;
}

.film-card-head a:hover {
  text-decoration: underline;
}

.film-card-meta {
  color: var(--text);
  font-size: 0.82rem;
  margin: 0.12rem 0 0;
  line-height: 1.3;
}

.film-card-counts {
  margin: 0.08rem 0 0;
}

.film-card-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.film-card-title {
  min-width: 0;
}

.film-card-spinner {
  width: 0.85rem;
  height: 0.85rem;
  flex: 0 0 auto;
  border: 2px solid var(--line);
  border-top-color: #00e054;
  border-radius: 50%;
  animation: film-card-spin 0.7s linear infinite;
}

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

.film-card-who {
  margin: 0.15rem 0 0;
  padding: 0;
  color: var(--text);
  font-size: 0.85rem;
  list-style: none;
}

.film-card-who li {
  margin: 0.12rem 0 0;
}

.film-card-who a {
  color: inherit;
  font-weight: 650;
}

.row-note {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 400;
}

.meter {
  align-self: center;
  color: var(--muted);
  font-size: 0.85rem;
}

.saved-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
}

.saved-head h2 {
  margin: 0;
}

.ranking-actions {
  align-items: center;
  margin-top: 0.9rem;
}

/* Sits beside the Search button, so drop the stacked .hint margins. */
.ranking-go-hint {
  margin: 0;
}

.ranking-actions button.danger {
  max-width: 100%;
  text-align: left;
  white-space: normal;
}

.random-card {
  display: grid;
  width: 100%;
  gap: 0.9rem;
  margin-top: 1rem;
  padding: 0.7rem;
  color: inherit;
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.random-card:hover {
  border-color: var(--line-hover);
}

.random-card img {
  width: 7.5rem;
  max-width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  background: var(--thumb);
  border-radius: 8px;
}

.random-card h3 {
  margin: 0;
  font-size: 1.15rem;
}

.random-card #random-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.review-text {
  margin: 0.55rem 0 0;
  color: var(--text);
  white-space: pre-wrap;
}

@media (min-width: 640px) {
  .random-card {
    grid-template-columns: 7.5rem minmax(0, 1fr);
    align-items: start;
  }
}

.random-card-copy {
  min-width: 0;
}

.turnstile-slot {
  margin: 0;
  min-height: 0;
}

.turnstile-slot:not(:empty) {
  margin: 0.4rem 0 0.7rem;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.85rem 0 0;
}

.saved-footer {
  color: var(--text);
  font-size: 0.92rem;
}

.saved-footer h3 {
  margin: 1rem 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 650;
}

.saved-footer h3:first-child {
  margin-top: 0;
}

.saved-footer h4 {
  margin: 0.65rem 0 0.2rem;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
}

.saved-footer h4.saved-user {
  margin: 0.65rem 0 0.2rem;
  color: var(--ink);
}

.saved-footer p {
  margin: 0.35rem 0 0;
}

body.tool .premium-benefits {
  max-width: 16.5rem;
  text-align: right;
}

body.tool #error-log-panel {
  margin-top: 2rem;
  padding: 1rem 1.05rem 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.progress-block {
  margin-top: 0.55rem;
}

.progress-label {
  margin: 0.35rem 0 0;
}

.check.is-locked {
  opacity: 0.55;
  pointer-events: none;
}

.polarising-box {
  margin: 0.75rem 0 0;
  padding: 0.55rem 0.7rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}

.polarising-box h3 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.polarising-box .polarising-check {
  margin: 0;
}

.polarising-hint {
  margin: 0.25rem 0 0;
}

.ranking-checks {
  margin-top: 0.35rem;
}

.min-match-hint {
  margin: 0.2rem 0 0.55rem;
  color: #00b34a;
  font-size: 0.86rem;
}

.search-history {
  margin-top: 0.85rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.search-history h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.search-history > .hint {
  margin: 0 0 0.15rem;
}

.search-history-list {
  margin: 0.1rem 0 0;
  padding-left: 1.15rem;
}

.panel button.search-history-item,
.panel button.search-history-item:hover {
  display: inline;
  width: auto;
  padding: 0;
  margin: 0;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-size: 0.8rem;
  line-height: 1.3;
  cursor: pointer;
}

.panel button.search-history-item:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.search-history-item strong {
  display: inline;
  margin: 0;
  font-weight: 650;
}

.search-history-item span {
  display: inline;
  color: var(--muted);
  font-size: inherit;
}

.search-history-empty {
  list-style: none;
  margin-left: -1.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.results-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  align-items: end;
  justify-content: flex-start;
  margin: 0.55rem 0 0.3rem;
}

.results-toolbar label {
  width: auto;
  margin: 0;
  flex: 0 0 auto;
}

.results-toolbar select {
  width: auto;
}

.ranking-row .wide-field,
.ranking-row .wide-field select {
  width: auto;
}

.star-field.is-locked,
.check.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.sort-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sort-btn {
  padding: 0.35rem 0.65rem;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
}

.sort-btn:hover {
  border-color: var(--line-hover);
}

.sort-btn.is-active {
  border-color: #00e054;
}

.sort-arrow {
  margin-left: 0.15rem;
}

body.tool-focus .tool-card:not([open]),
body.tool-focus .tool-group-head {
  opacity: 0.42;
  transition: opacity 0.15s ease;
}

details.tool-card[open] {
  outline: 2px solid #00e054;
  box-shadow: 0 0 0 1px #00e054;
}

details.tool-card[open] summary h2 {
  color: #ff8000;
}

.film-card-who .review-snippet {
  display: inline;
  margin-left: 0.2rem;
  color: #1a7f37;
  text-decoration: underline;
  text-underline-offset: 0.12em;
  cursor: pointer;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
}

.film-card-who .review-snippet:hover {
  color: #00b34a;
}

.film-card-who .review-missing {
  margin-left: 0.25rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.review-dialog {
  max-width: 32rem;
  padding: 1.1rem 1.2rem 1.2rem;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.review-dialog::backdrop {
  background: rgba(20, 24, 28, 0.62);
}

.review-dialog-body {
  margin: 0.7rem 0 1rem;
  white-space: pre-wrap;
}

.lb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 1rem;
}

.lb-header h1 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.15;
}

.lb-home-title {
  color: inherit;
  text-decoration: none;
}

.lb-home-title:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.lb-chip {
  text-decoration: none;
  text-align: center;
}

.lb-chip.is-on,
.lb-chip.is-current,
.lb-nav-link.is-current {
  border-color: #00e054;
  background: #00e054;
  color: #141311;
}

/* Clear All Data. Two classes so it wins over .theme-toggle regardless of stylesheet
   order (styles.css sets that base colour). */
.theme-toggle.lb-chip-danger {
  color: #fff;
  background: #c62828;
  border-color: #c62828;
  font-weight: 600;
}

.theme-toggle.lb-chip-danger:hover {
  color: #fff;
  background: #b02020;
  border-color: #b02020;
}

.theme-toggle.lb-chip-danger:disabled {
  opacity: 0.7;
  cursor: default;
}

.lb-nav {
  margin: 0.35rem 0 0;
}

.lb-nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 1.15rem;
  margin: 0;
  font-size: 0.84rem;
}

.lb-nav-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.45rem;
}

.lb-nav-label {
  color: var(--muted);
  margin-right: 0.1rem;
}

.lb-nav-link {
  padding: 0.18rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: var(--card);
}

.lb-nav-link:hover {
  border-color: var(--line-hover);
}

.ext-banner {
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.7rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.ext-banner h2 {
  margin: 0;
  font-size: 0.95rem;
}

.ext-banner p {
  margin: 0.25rem 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.catalog-group {
  margin: 0.55rem 0 0;
}

.catalog-group h2 {
  margin: 0 0 0.45rem;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.catalog-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

@media (max-width: 640px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

.catalog-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 6.4rem;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem 0.75rem;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-decoration: none;
  box-shadow: 0 1px 0 var(--lift);
}

.catalog-card:hover {
  border-color: var(--line-hover);
}

.catalog-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
  background: var(--thumb);
}

.tool-kicker {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.catalog-card h3,
.tool-page-title {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.25;
}

.tool-lede,
.catalog-card p {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.tool-page-head {
  margin: 0.4rem 0 0;
}

.tool-page-head .tool-kicker {
  font-size: 1.35rem;
}

.game-user-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.55rem;
  margin: 0;
}

.game-user-row label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
  flex: 0 1 auto;
  font-size: 0.88rem;
}

.game-user-row input[type="text"] {
  width: 9.2rem;
}

.game-user-row .meter {
  align-self: center;
  font-size: 0.8rem;
}

.offscreen-preload {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.guess-review {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.7rem 0.8rem;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  white-space: pre-wrap;
  font: inherit;
  font-size: 0.95rem;
  text-align: left;
  /* Always clickable: the dialog can fetch the full review even when the listing only
     gave us a short body. */
  cursor: pointer;
}

.guess-review:hover {
  border-color: var(--line-hover);
}

.guess-hints {
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.55rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.guess-hints h3 {
  margin: 0 0 0.3rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.guess-hints h3 .hint-note {
  margin-left: 0.4rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 0.78rem;
}

.guess-hints .hint-row {
  gap: 0.28rem;
}

.guess-hints .hint-row button {
  padding: 0.22rem 0.48rem;
  font-size: 0.8rem;
}

.guess-type {
  position: relative;
  margin: 0.55rem 0 0;
}

.guess-type label {
  margin-bottom: 0;
}

.guess-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% - 0.15rem);
  z-index: 5;
  margin: 0;
  padding: 0.2rem 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  max-height: 12rem;
  overflow: auto;
}

.guess-suggest button {
  display: block;
  width: 100%;
  padding: 0.35rem 0.6rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.guess-suggest button:hover {
  background: var(--card);
}

.guess-answer-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.5rem 0 0;
}

.guess-answer-row img {
  width: 3.2rem;
  height: auto;
  border-radius: 4px;
  background: var(--thumb);
}

a.guess-answer {
  font-weight: 700;
  color: inherit;
  text-decoration: none;
}

a.guess-answer[href]:hover {
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.hint-row,
.guess-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.55rem 0 0;
}

.hint-out {
  margin: 0.45rem 0 0;
  color: var(--text);
  font-size: 0.9rem;
}

.guess-poster-wrap {
  margin: 0;
  flex: 0 0 auto;
}

.guess-poster-wrap img {
  display: block;
  width: 7.5rem;
  height: auto;
  border-radius: 6px;
}

.guess-poster-wrap.is-blurred img {
  filter: blur(10px);
}

.guess-hint-body {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin: 0.45rem 0 0;
}

.hint-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text);
  font-size: 0.9rem;
  flex: 1 1 auto;
}

.hl-panel {
  margin-top: 0.2rem;
  padding-top: 0.55rem;
}

.hl-title-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 0.5rem 0.75rem;
  margin: 0.35rem 0 0;
}

.hl-title-row .hl-score-line {
  grid-column: 1;
  margin: 0;
  justify-self: start;
  text-align: left;
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hl-direction {
  grid-column: 2;
  margin: 0;
  text-align: center;
  font-size: 1.38rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.hl-title-row .hl-hist {
  grid-column: 3;
  justify-self: end;
}

.hl-board {
  margin: 0.25rem 0 0;
}

.hl-posters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.22rem;
}

.hl-poster-wrap {
  overflow: hidden;
  border-radius: 8px;
  background: var(--thumb);
  border: 3px solid transparent;
  min-width: 0;
}

.hl-poster-wrap.is-pick {
  cursor: pointer;
}

.hl-poster-wrap.is-pick:focus-visible {
  outline: 2px solid #00e054;
  outline-offset: 2px;
}

.hl-poster-wrap.is-win {
  border-color: #00e054;
}

.hl-poster-wrap.is-lose {
  border-color: #c62828;
}

.hl-poster-wrap img {
  display: block;
  width: 100%;
  height: auto;
  max-height: calc(100vh - 15.5rem);
  aspect-ratio: 2 / 3;
  object-fit: contain;
  margin: 0 auto;
  background: var(--thumb);
  transition: transform 0.18s ease, filter 0.28s ease;
}

.hl-poster-wrap.is-pick:hover img {
  transform: scale(1.03);
}

.hl-poster-wrap.is-win-fade img {
  filter: blur(7px) drop-shadow(0 0 14px #00e054);
}

.hl-poster-wrap.is-lose-fade img {
  filter: blur(7px) drop-shadow(0 0 14px #c62828);
}

.hl-under {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 0.2rem 0.4rem;
  align-items: start;
  margin: 0.12rem 0 0;
}

.hl-copy {
  min-width: 0;
  text-align: center;
  padding: 0.05rem 0.15rem 0.1rem;
}

.hl-copy h3 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.25;
}

.hl-copy .hl-from {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.28rem;
  margin: 0.08rem 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.hl-same-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 8.4rem;
  max-width: 11.5rem;
  z-index: 2;
}

.panel .hl-same-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.08rem;
  width: 100%;
  min-height: 0;
  padding: 0.38rem 0.65rem;
  border: 3px solid transparent;
  border-radius: 12px;
  background: #1d7af5;
  color: #fff;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
}

.panel .hl-same-btn:hover:not(:disabled) {
  filter: brightness(1.06);
  border-color: transparent;
}

.panel .hl-same-btn:disabled {
  opacity: 0.85;
  cursor: default;
}

.panel .hl-same-btn.is-same-miss {
  border-color: #c62828;
}

.panel .hl-same-btn.is-lost {
  background: #c62828;
  border-color: #c62828;
  opacity: 1;
}

.hl-same-title {
  font-weight: 800;
  font-size: 1.05rem;
}

.hl-same-health {
  font-weight: 700;
  font-size: 0.82rem;
}

.hl-same-lost {
  display: flex;
  flex-direction: column;
  font-weight: 650;
  font-size: 0.78rem;
  line-height: 1.25;
}

.hl-same-explain {
  margin: 0.28rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: left;
  align-self: stretch;
}

.hl-same-explain li + li {
  margin-top: 0.12rem;
}

.hl-stars {
  margin: 0.08rem 0 0;
  min-height: 1.2rem;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
  color: #00e054;
}

.hl-hist {
  display: flex;
  align-items: flex-end;
  gap: 0.35rem;
}

.hl-hist-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 2.85rem;
  width: 8.4rem;
  border-bottom: 1px solid rgba(123, 136, 150, 0.45);
}

.hl-hist-bar {
  flex: 1 1 0;
  min-width: 0;
  background: #7b8896;
  border-radius: 2px 2px 0 0;
  height: 0;
  transition: height 0.35s ease;
}

html[data-theme="dark"] .hl-hist-bar {
  background: #8b98a6;
}

.hl-hist-star,
.hl-hist-stars {
  color: #00e054;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  padding-bottom: 0.04rem;
}

.hl-swap {
  min-height: 100%;
  transition: opacity 0.28s ease;
}

.hl-swap.is-fading {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 720px) {
  .hl-title-row {
    grid-template-columns: 1fr;
  }

  .hl-direction,
  .hl-title-row .hl-hist,
  .hl-title-row .hl-score-line {
    grid-column: 1;
    justify-self: center;
  }

  .hl-title-row .hl-score-line {
    justify-self: start;
  }

  .hl-under {
    grid-template-columns: 1fr;
  }

  .hl-same-slot {
    order: 3;
    max-width: none;
    width: 100%;
  }
}

.guess-extra {
  margin: 0.55rem 0 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}

.guess-extra h3 {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 650;
}

.guess-extra-body {
  margin: 0;
  white-space: pre-wrap;
}

.guess-extra-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
  margin: 0 0 0.55rem;
}

.hl-skip {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}
