.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  overflow: hidden;
}

.wiki-thumb {
  border-radius: 13px;
  max-width: 40%;
  float: right;
  margin-left: 1rem;
  margin-bottom: 1rem;
  background: var(--border-color);
}

.wiki-thumb--logo {
  display: block;
  max-width: 80%;
  max-height: 60px;
  width: auto;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 0.75rem;
  margin: 0.75rem auto 2rem auto;
}

.wiki-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.wiki-title {
  display: block;
  font-size: var(--font-large);
  font-weight: 600;
  color: var(--link-color);
  text-decoration: none;
  line-height: 1.1;
}

.wiki-title:hover {
  color: var(--link-hover, var(--link-color));
  text-decoration: underline;
}

.wiki-desc {
  margin-bottom: 1rem;
  font-size: var(--font-small);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.wiki-extract {
  font-size: var(--font-medium);
  color: var(--text-primary);
  display: inline;
}

.wiki-footer-link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-decoration: none;
}

.wiki-footer-link:hover {
  color: var(--link-color);
  text-decoration: underline;
}

.gh-slot-result {
  padding: 0;
  max-width: 100%;
  width: 100%;
  color: var(--text-primary);
  min-width: 0;
}

.gh-slot-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gh-slot-section {
  margin-bottom: 0;
  min-width: 0;
}

.gh-slot-heading {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.gh-slot-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.75rem;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  min-width: 0;
}

.gh-slot-grid::-webkit-scrollbar {
  display: none;
}

.gh-slot-grid::-webkit-scrollbar-track {
  background: var(--bg-hover);
  border-radius: 3px;
}

.gh-slot-grid::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  opacity: 0.4;
  border-radius: 3px;
}

.gh-slot-card {
  display: block;
  padding: 1rem;
  background: var(--bg-light);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 280px;
  transition: background 0.15s ease;
}

.results-slot-panel-body a:hover {
  text-decoration: none;
}

.gh-slot-card {
  background: var(--bg-hover);
}

.gh-slot-avatar {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-hover);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.gh-slot-avatar--user {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
}

.gh-slot-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gh-slot-avatar-placeholder {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.gh-slot-repo-head,
.gh-slot-user-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.gh-slot-repo-meta,
.gh-slot-user-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gh-slot-repo-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary, #0969da);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gh-slot-repo-lang {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.gh-slot-stars {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.gh-slot-desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gh-slot-user-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.gh-slot-user-login {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.gh-slot-user-stats {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.math-widget {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg-light);
  max-width: 652px;
  color: var(--text-primary);
}

.math-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  font-weight: 600;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.5rem;
}

.math-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.math-query {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.math-equals {
  font-size: 0.9rem;
  color: var(--text-secondary);
  opacity: 0.7;
}

.math-result {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}
.math-calc {
  font-family: system-ui, -apple-system, sans-serif;
  max-width: 652px;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.math-calc-screen {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.math-calc-expr {
  width: 100%;
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 0.6rem 0.75rem;
  border: 0;
  border-radius: 12px;
  outline: none;
}

.math-calc-result {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  min-height: 1.6rem;
  padding: 0 0.75rem;
}

.math-calc-keys {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.math-calc-row {
  display: flex;
  gap: 0.4rem;
}

.math-calc-key {
  flex: 1;
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1.05rem;
  padding: 0.7rem 0;
  cursor: pointer;
  transition: background 0.15s;
}

.math-calc-key:hover {
  background: var(--bg-hover);
}

.math-calc-fn {
  color: var(--text-secondary);
}

.math-calc-eq {
  background: var(--brand-blue);
  color: #fff;
}

.math-calc-eq:hover {
  background: var(--brand-blue);
  opacity: 0.92;
}

.imdb-result {
  padding: 0;
  max-width: 652px;
  color: var(--text-primary);
}

.imdb-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
}

.imdb-poster {
  flex-shrink: 0;
  width: 100px;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-light);
}

.imdb-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.imdb-hero-text {
  flex: 1;
  min-width: 0;
}

.imdb-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.imdb-title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.imdb-title-link {
  color: inherit;
  text-decoration: none;
}

.imdb-title-link:hover .imdb-title,
.imdb-title-link:hover .imdb-filmography-title {
  text-decoration: underline;
}

a.imdb-cast-card {
  color: inherit;
  text-decoration: none;
}

a.imdb-cast-card:hover .imdb-cast-name {
  text-decoration: underline;
}

.imdb-hero-meta {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

.imdb-hero-meta .imdb-rated + .imdb-released::before {
  content: " · ";
  color: var(--text-secondary);
}

.imdb-ratings {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-primary);
}

.imdb-plot {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.imdb-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.imdb-grid-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.8125rem;
}

.imdb-grid-label {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.imdb-grid-value {
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
}

.imdb-cast-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
}

.imdb-cast-strip {
  display: flex;
  gap: 0.5rem;
  width: max-content;
  padding: 0 0.25rem 0 0;
}

.imdb-cast-scroll {
  scrollbar-width: none;
}

.imdb-cast-scroll::-webkit-scrollbar {
  display: none;
}

.imdb-cast-card {
  flex: 0 0 auto;
  width: 5.5rem;
  padding: 0;
  background: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.imdb-cast-photo-wrap {
  width: 100%;
  aspect-ratio: 1;
  background: var(--border-light);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.imdb-cast-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.imdb-cast-initial {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-light);
}

.imdb-cast-card .imdb-cast-name {
  padding: 0.4rem 0.35rem 0.15rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.imdb-cast-character {
  padding: 0 0.35rem 0.4rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.imdb-link {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--primary, #1a73e8);
  text-decoration: none;
}

.imdb-link:hover {
  text-decoration: underline;
}

.imdb-hero--compact {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
}

.imdb-hero--compact .imdb-poster {
  width: 80px;
  height: 120px;
}

.imdb-filmography-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.imdb-section-heading {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.imdb-filmography-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem 0;
  margin: 0 0 1rem;
}


.imdb-filmography-scroll::-webkit-scrollbar {
  display: none;
}

.imdb-filmography-strip {
  display: flex;
  gap: 0.75rem;
  width: max-content;
  padding: 0 0.25rem 0 0;
}

.imdb-filmography-scroll::-webkit-scrollbar {
  height: 6px;
}

.imdb-filmography-scroll::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  opacity: 0.3;
  border-radius: 3px;
}

.imdb-movie-card {
  flex: 0 0 auto;
  width: 7rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.15s ease;
}

.imdb-movie-card:hover {
  transform: scale(1.02);
}

.imdb-movie-poster {
  width: 100%;
  aspect-ratio: 2/3;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
  margin-bottom: 0.35rem;
}

.imdb-movie-poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.imdb-movie-poster-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.imdb-movie-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.2;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.imdb-movie-year {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

@media (min-width: 480px) {
  .imdb-meta-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 640px) {
  .imdb-meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tmdb-tabs {
  position: relative;
}

.tmdb-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.tmdb-tab-bar::-webkit-scrollbar {
  display: none;
}

.tmdb-tab-btn {
  all: unset;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-bottom: -1px;
}

.tmdb-tab-btn:hover {
  color: var(--text-primary);
}

.tmdb-tab-btn--active {
  color: var(--text-primary);
  border-bottom-color: var(--primary, #1a73e8);
}

.tmdb-accordion {
  border-radius: 8px;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.tmdb-accordion .tmdb-accordion {
  border-radius: 6px;
  margin: 0.35rem 0;
}

.tmdb-accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.tmdb-accordion-summary::-webkit-details-marker {
  display: none;
}

.tmdb-accordion-summary::before {
  content: "";
  flex-shrink: 0;
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--text-secondary);
  border-bottom: 2px solid var(--text-secondary);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.tmdb-accordion[open] > .tmdb-accordion-summary::before {
  transform: rotate(45deg);
}

.tmdb-accordion-meta {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-secondary);
}

.tmdb-accordion-body {
  padding: 0 0 0.75rem;
  max-height: 20rem;
  overflow-y: auto;
  scrollbar-width: thin;
}

.tmdb-season-detail {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.tmdb-season-poster {
  flex-shrink: 0;
  width: 52px;
  border-radius: 6px;
  object-fit: cover;
}

.tmdb-season-info {
  flex: 1;
  min-width: 0;
}

.tmdb-season-overview {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-primary);
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tmdb-season-link {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary, #1a73e8);
  text-decoration: none;
}

.tmdb-season-link:hover {
  text-decoration: underline;
}

.ac-item--history {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
}

.ac-item--history .ac-item-icon--clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
}

.ac-item--history .ac-item-icon--clock svg {
  width: 20px;
  height: 20px;
}

.ac-item--history .ac-item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ac-item--history .ac-item-delete {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  opacity: 0.8;
}

.ac-item--history .ac-item-delete:hover {
  opacity: 1;
  background: var(--bg-hover);
  color: var(--danger);
}

.ac-item--history .ac-item-delete svg {
  width: 18px;
  height: 18px;
}

.search-history-result .result-favicon--clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  color: var(--text-cite);
}

.search-history-result .result-favicon--clock svg {
  width: 22px;
  height: 22px;
}

.search-history-result .history-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-left: auto;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 50%;
  text-decoration: none;
}

.search-history-result .history-delete-btn:hover {
  color: var(--danger);
  background: var(--bg-hover);
}

.search-history-result .history-delete-btn svg {
  width: 18px;
  height: 18px;
}


.define-result .define-word {
  font-size: 1.5rem;
  margin: 0 0 0.25rem 0;
}

.define-phonetic {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0 0 0.75rem 0;
}

.define-meaning {
  margin-bottom: 1rem;
}

.define-pos {
  font-style: italic;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.define-list {
  margin: 0.25rem 0 0 1rem;
  padding-left: 0.5rem;
}

.define-example {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.time-result .time-place {
  font-size: 1.25rem;
  margin: 0 0 0.25rem 0;
}

.time-time {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0.25rem 0;
}

.time-date {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.colors-command {
  width: 100%;
  max-width: none;
  padding: 0;
  overflow: hidden;
}

.colors-command.degoog-panel {
  border: none;
  box-shadow: none;
  background: transparent;
}

.colors-toolbar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1rem;
  padding-left: 0;
}

.colors-style-wrap {
  min-width: 8rem;
}

.colors-hint {
  font-size: 0.75rem;
  font-weight: 500;
  opacity: 0.85;
}

.colors-boxes.boxes {
  display: flex;
  width: 100%;
  min-height: 14rem;
  max-height: 20rem;
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
  border: 1px solid var(--border-light, rgba(128, 128, 128, 0.25));
}

.colors-command .box {
  width: 20%;
  position: relative;
  cursor: pointer;
  transition: filter 0.15s ease;
}

.colors-command .box:hover {
  filter: brightness(1.05);
}

.colors-command .colors-lock {
  display: none;
  position: absolute;
  inset: 0;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.75rem;
  pointer-events: none;
  z-index: 1;
}

.colors-command .box.locked .colors-lock {
  display: flex;
}

.colors-command .box .colors-hex {
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  bottom: 1.25rem;
  left: 50%;
  transform: translate(-50%, 0);
  position: absolute;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: pointer;
  z-index: 2;
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  transition: opacity 0.15s ease, background 0.15s ease;
}

.colors-command .box .colors-hex:hover {
  background: rgba(0, 0, 0, 0.12);
}

.colors-command .box .colors-hex.colors-hex--copied {
  opacity: 0.85;
}

html[dir="rtl"] .apps-pocket-panel {
  right: auto;
  left: 0;
}

.header-link {
  line-height: 0;
}

.apps-pocket-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-left: auto;
}

@media (min-width: 767.98px) {
  .apps-pocket-wrapper {
    position: relative;
  }
}

.apps-pocket-launcher {
  background: transparent;
  border: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  color: var(--text-secondary);
}

.apps-pocket-launcher:hover {
  color: var(--text-primary);
}

#results-header .apps-pocket-launcher {
  margin-left: auto;
}

@media (max-width: 767.98px) {
  #results-header .apps-pocket-wrapper {
    position: absolute;
    top: 1rem;
    right: 1.25rem;
    display: flex;
    margin-left: 0;
  }

  #results-header #nav-settings-results {
    position: relative;
    top: auto;
    right: auto;
  }
}

.apps-pocket-panel {
  position: absolute;
  z-index: 9999;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, calc(100vw - 16px));
  max-height: min(70vh, 480px);
  overflow: auto;
  padding: 12px;
}

@media (max-width: 767.98px) {
  .apps-pocket-panel {
    position: fixed;
    top: 56px;
    right: 8px;
    left: 8px;
    width: auto;
  }
}

.apps-pocket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.apps-pocket-title {
  font-weight: 600;
  color: var(--text-primary);
}

.apps-pocket-info-btn {
  all: unset;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
}

.apps-pocket-info-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.apps-pocket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.apps-pocket-grid::-webkit-scrollbar {
  display: none;
}

.apps-pocket-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}

.apps-pocket-tile:hover {
  background: var(--bg-hover);
}

.apps-pocket-tile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.apps-pocket-tile-img {
  width: 100%;
  object-fit: contain;
}

.apps-pocket-tile-fallback {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
  color: var(--text-primary);
  background: var(--bg);
}

.apps-pocket-tile-label {
  font-size: 12px;
  color: var(--text-primary);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apps-pocket-empty {
  grid-column: 1 / -1;
  padding: 16px 8px;
  color: var(--text-secondary);
  font-size: 13px;
  text-align: center;
}

.apps-pocket-bang {
  padding: 16px;
  background: var(--bg);
  border-radius: 8px;
  color: var(--text-primary);
}

.apps-pocket-modal {
  width: 640px;
}

.apps-pocket-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 2px;
}

.apps-pocket-rows::-webkit-scrollbar {
  display: none;
}

.apps-pocket-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
}

.apps-pocket-row-add {
  align-self: flex-start;
}

.apps-pocket-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.apps-pocket-output {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  resize: vertical;
  min-height: 160px;
}

.cp-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cp-header {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.cp-image {
  width: 72px;
  height: 96px;
  object-fit: cover;
  object-position: top center;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.cp-image--placeholder {
  background: var(--bg-hover);
}

.cp-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 2px;
}

.cp-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  word-break: break-word;
}

.cp-series {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.cp-series-tag {
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--bg-hover);
  border-radius: 3px;
  padding: 2px 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cp-desc {
  font-size: 13px;
  color: var(--text-snippet);
  line-height: 1.5;
  margin: 0;
}

.cp-link {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  color: var(--text-link);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px 9px;
  transition: background 0.15s;
}

.cp-link:hover {
  background: var(--bg-hover);
  text-decoration: none;
}

.igdb-result {
  padding: 0;
  max-width: 652px;
  color: var(--text-primary);
}

.igdb-hero {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
}

.igdb-cover {
  flex-shrink: 0;
  width: 90px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-light);
}

.igdb-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.igdb-hero-text {
  flex: 1;
  min-width: 0;
}

.igdb-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.25rem;
}

.igdb-title {
  margin: 0 0 0.25rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text-primary);
}

.igdb-title-link {
  color: inherit;
  text-decoration: none;
}

.igdb-title-link:hover .igdb-title {
  text-decoration: underline;
}

.igdb-developer {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.igdb-platforms {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.igdb-summary {
  margin: 0 0 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-primary);
}

.igdb-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.igdb-tabs {
  position: relative;
}

.igdb-tab-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 1px;
}

.igdb-tab-bar::-webkit-scrollbar {
  display: none;
}

.igdb-tab-btn {
  all: unset;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-bottom: -1px;
}

.igdb-tab-btn:hover {
  color: var(--text-primary);
}

.igdb-tab-btn--active {
  color: var(--text-primary);
  border-bottom-color: var(--primary, #1a73e8);
}

@keyframes weather-spin {
    100% { transform: rotate(360deg); }
}
@keyframes weather-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes weather-rain {
    0% { transform: translateY(-10px); opacity: 0; }
    30% { opacity: 1; }
    80%, 100% { transform: translateY(18px); opacity: 0; }
}
@keyframes weather-snow {
    0% { transform: translateY(-8px) translateX(0); opacity: 0; }
    30% { opacity: 1; }
    50% { transform: translateY(8px) translateX(4px); }
    100% { transform: translateY(22px) translateX(-2px); opacity: 0; }
}
@keyframes weather-flash {
    0%, 90%, 100% { opacity: 0.1; }
    92%, 95% { opacity: 1; }
}

.weather-ani-sun {
    display: flex;
    align-items: center;
    justify-content: center;
}
.weather-ani-float {
    animation: weather-float 4.5s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}
.weather-drop {
    position: absolute;
    width: 2px;
    background: #60a5fa;
    border-radius: 1px;
    animation: weather-rain 1.1s linear infinite;
    opacity: 0;
}
.weather-flake {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #bfdbfe;
    border-radius: 50%;
    animation: weather-snow 2.2s linear infinite;
    opacity: 0;
}
.weather-bolt {
    animation: weather-flash 3.5s ease-in-out infinite;
}

.weather-result {
    container-type: inline-size;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    font-family: var(--font-sans, sans-serif);
    color: var(--text-primary);
    position: relative;
    box-sizing: border-box;
    /* Guaranteed-visible card border. Some themes (default dark) set
       --border-light identical to --bg-light, which makes borders vanish.
       Derive from --text-primary so it is always legible. */
    --weather-border: color-mix(in srgb, var(--text-primary) 16%, transparent);
    --weather-card-bg: var(--bg-light, color-mix(in srgb, var(--text-primary) 5%, transparent));
}

.weather-header {
    margin-bottom: 10px;
}

.weather-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.weather-location {
    color: var(--text-primary);
    font-weight: 600;
    min-width: 0;
    overflow-wrap: anywhere;
}

.weather-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px 24px;
    padding: 16px 18px;
    margin-bottom: 12px;
    border: 1px solid var(--slot-inset-border, var(--weather-border));
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--text-primary) 4%, transparent), transparent 55%), var(--slot-inset-bg, var(--weather-card-bg));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
}

.weather-result[data-weather-is-day="1"] .weather-hero {
    background: radial-gradient(130% 135% at 6% -25%, color-mix(in srgb, #f59e0b 14%, transparent), transparent 56%), linear-gradient(180deg, color-mix(in srgb, var(--text-primary) 4%, transparent), transparent 55%), var(--slot-inset-bg, var(--weather-card-bg));
}

.weather-result[data-weather-is-day="0"] .weather-hero {
    background: radial-gradient(130% 135% at 6% -25%, color-mix(in srgb, #4285f4 16%, transparent), transparent 56%), linear-gradient(180deg, color-mix(in srgb, var(--text-primary) 5%, transparent), transparent 55%), var(--slot-inset-bg, var(--weather-card-bg));
}

.weather-hero-left {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    min-width: 0;
    flex: 0 1 auto;
}

.weather-hero-icon {
    width: 68px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.weather-temp-wrap {
    display: flex;
    align-items: flex-start;
    line-height: 0.9;
    flex-shrink: 0;
}

.weather-temp {
    font-size: clamp(3.2rem, 8.5cqi, 4rem);
    font-weight: 300;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.weather-deg {
    font-size: clamp(1.2rem, 3.2cqi, 1.6rem);
    font-weight: 400;
    margin-top: 5px;
    margin-left: 2px;
    opacity: 0.85;
}

.weather-hero-meta {
    display: grid;
    grid-template-columns: max-content max-content;
    column-gap: 12px;
    row-gap: 4px;
    align-content: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex: 0 0 auto;
    width: max-content;
    max-width: 100%;
}

.weather-meta-row {
    display: contents;
}

.weather-meta-row > span {
    white-space: nowrap;
}

.weather-meta-row strong {
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    justify-self: end;
    font-variant-numeric: tabular-nums;
}

.weather-hero-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 0;
    flex: 0 1 auto;
    margin-left: auto;
}

.weather-hero-eyebrow {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-secondary);
}

.weather-hero-date {
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.weather-desc {
    font-size: clamp(1.05rem, 2.8cqi, 1.25rem);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.weather-hero-hilo {
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.weather-hero-hilo strong {
    color: var(--text-primary);
    font-weight: 600;
}

.weather-hero-hilo .weather-hilo-sep {
    margin: 0 4px;
    opacity: 0.5;
}

.weather-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.weather-tabs::-webkit-scrollbar {
    display: none;
}

.weather-tab {
    padding: 7px 15px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid var(--weather-border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.weather-tab:hover {
    background: var(--bg-hover, rgba(128,128,128,0.08));
    color: var(--text-primary);
}

.weather-tab-active {
    background: var(--primary, #4285f4) !important;
    border-color: var(--primary, #4285f4) !important;
    color: #fff !important;
}

.weather-chart-wrap {
    padding: 12px 14px;
    border: 1px solid var(--weather-border);
    border-radius: 14px;
    background: var(--weather-card-bg);
    margin-bottom: 16px;
    position: relative;
}

.weather-chart-head {
    margin-bottom: 8px;
}

.weather-chart-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-chart-sub {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.weather-chart {
    height: 140px;
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}

.weather-chart-mount {
    position: relative;
    height: 100%;
    min-width: 100%;
}

.weather-chart-mount > svg {
    display: block;
    width: 100%;
    height: calc(100% - 18px);
}

.weather-chart-axis {
    position: relative;
    height: 18px;
    pointer-events: none;
}

.weather-chart-axis-tick {
    position: absolute;
    top: 0;
    transform: translateX(-50%);
    font-size: 10px;
    line-height: 1.2;
    white-space: nowrap;
    color: var(--text-secondary);
}
.weather-chart::-webkit-scrollbar {
    display: none;
}

.weather-chart-legend {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.weather-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-legend-line {
    display: inline-block;
    width: 14px;
    height: 3px;
    border-radius: 1px;
}

.weather-legend-dashed {
    border-top: 2.5px dotted var(--text-secondary);
    background: transparent !important;
}

.weather-chart-tooltip {
    position: absolute;
    display: none;
    background: var(--weather-card-bg);
    border: 1px solid var(--weather-border);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 0.78rem;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.weather-week-heading {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.weather-week-hint {
    font-size: 0.74rem;
    font-weight: 400;
    opacity: 0.75;
}

.weather-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 18px;
}

.weather-day-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 4px;
    background: var(--weather-card-bg);
    border: 1px solid var(--weather-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    min-width: 0;
}

.weather-day-card:hover {
    background: var(--bg-hover, color-mix(in srgb, var(--text-primary) 8%, transparent));
    border-color: var(--text-secondary);
}

.weather-day-card-active {
    background: var(--slot-inset-bg, var(--weather-card-bg)) !important;
    border-color: var(--primary, #4285f4) !important;
    box-shadow: 0 0 0 1px var(--primary, #4285f4);
}

.weather-day-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.weather-day-card-active .weather-day-name {
    color: var(--primary, #4285f4);
}

.weather-day-ico {
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.weather-day-temps {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
}

.weather-day-hi {
    color: var(--text-primary);
}

.weather-day-lo {
    color: var(--text-secondary);
    font-size: 0.74rem;
}

.weather-details-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.weather-now-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 18px;
}

.weather-now-item {
    background: var(--weather-card-bg);
    border: 1px solid var(--weather-border);
    border-radius: 10px;
    padding: 8px 10px;
    min-width: 0;
}

.weather-now-label {
    font-size: 0.74rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.weather-value {
    font-size: 0.94rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.weather-detail-sub {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-left: 2px;
}

.weather-astro {
    margin-bottom: 0;
}

.weather-astro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.weather-astro-col {
    background: var(--weather-card-bg);
    border: 1px solid var(--weather-border);
    border-radius: 14px;
    padding: 10px 10px 8px;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.weather-astro-col-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
}

.weather-astro-ico {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
}

.weather-astro-ico-sun {
    color: #f59e0b;
}

.weather-astro-ico-moon {
    color: var(--text-secondary, #80868b);
}

html[data-theme="dark"] .weather-astro-ico-moon {
    color: var(--text-secondary, #bdc1c6);
}

.weather-astro-phase {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-align: right;
}

.weather-astro-phase-illum {
    opacity: 0.75;
    margin-left: 2px;
}

.weather-astro-body {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 4px 8px;
    position: relative;
    padding-bottom: 0;
}

.weather-astro-endpoint {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-bottom: 2px;
}

.weather-astro-endpoint-right {
    text-align: right;
    align-items: flex-end;
}

.weather-astro-ep-label {
    font-size: 0.68rem;
    color: var(--text-secondary);
}

.weather-astro-ep-time {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-primary);
}

.weather-astro-relative {
    font-size: 0.68rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.weather-astro-track {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    height: 48px;
    justify-self: stretch;
    position: relative;
    margin: 0 2px;
    overflow: visible;
}

.weather-astro-arc {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.weather-astro-arc-bg {
    stroke: color-mix(in srgb, var(--text-secondary) 32%, transparent);
    stroke-dasharray: 3 3;
    stroke-linecap: round;
}

.weather-astro-arc-fill {
    stroke-dasharray: 200;
    stroke-dashoffset: 200;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.5s ease-out;
}

.weather-sun-arc-fill {
    stroke: color-mix(in srgb, #f59e0b 65%, transparent);
}

.weather-sun-track[data-sun-state="set"] .weather-sun-arc-fill {
    opacity: 0.42;
}

.weather-moon-arc-fill {
    stroke: color-mix(in srgb, var(--text-primary) 55%, transparent);
}

.weather-sun-dot,
.weather-moon-dot {
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    top: 0;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px currentColor;
    transition:
        left 0.5s ease-out,
        top 0.5s ease-out,
        opacity 0.2s ease-out;
    z-index: 2;
}

.weather-sun-dot[hidden],
.weather-moon-dot[hidden] {
    display: none !important;
}

.weather-sun-dot {
    background: #f59e0b;
    color: #f59e0b;
}

.weather-moon-dot {
    background: #e5e7eb;
    color: #e5e7eb;
}

.weather-astro-apex {
    position: absolute;
    left: 50%;
    top: 1px;
    transform: translate(-50%, -52%);
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 0 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--weather-card-bg) 88%, transparent);
    white-space: nowrap;
    font-size: 0.68rem;
    line-height: 1.2;
    color: var(--text-secondary);
    opacity: 0.85;
    pointer-events: none;
    z-index: 1;
}

.weather-astro-apex[hidden] {
    display: none !important;
}

.weather-astro-apex-label {
    font-weight: 400;
    color: var(--text-secondary);
}

.weather-astro-apex-time {
    font-weight: 500;
    color: var(--text-primary);
}

.weather-footer {
    display: flex;
    justify-content: center;
    gap: 8px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    border-top: 1px dashed color-mix(in srgb, var(--text-secondary) 15%, transparent);
    padding-top: 6px;
    padding-bottom: 0;
    margin-top: 6px;
    margin-bottom: 0;
}

.weather-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--primary, #4285f4);
    text-decoration: none;
}

.weather-footer a:hover {
    text-decoration: underline;
}

.weather-footer-sep {
    opacity: 0.6;
}

@container (max-width: 420px) {
    .weather-hero-meta {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@container (max-width: 580px) {
    .weather-hero {
        flex-direction: column;
        gap: 16px;
    }
    .weather-hero-right {
        text-align: left;
        align-items: flex-start;
        margin-left: 0;
        width: 100%;
    }
    .weather-hero-left {
        width: 100%;
    }
    .weather-days {
        grid-template-columns: repeat(4, 1fr);
        gap: 4px;
    }
    .weather-day-card:nth-child(n+5) {
        display: none;
    }
    .weather-now-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .weather-astro-grid {
        grid-template-columns: 1fr;
    }
}

.weather-result :where(button, input, select, a[href], [role="button"]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Unit Converter Slot ────────────────────────────────────────── */

.uxs-wrap {
    container-type: inline-size;
    position: relative;
    color: var(--text-primary, inherit);
    width: 100%;
    max-width: none;
}

.uxs-main {
    position: relative;
}

/* ── Category bar ──────────────────────────────────────────────── */

.uxs-top-bar {
    border-bottom: 1px solid var(--border-light, color-mix(in srgb, currentColor 15%, transparent));
    padding-bottom: 10px;
    background: transparent;
}

.uxs-category-select {
    width: 100%;
    padding: 8px 36px 8px 0;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: var(--text-primary, inherit);
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0;
    outline: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.uxs-category-select:hover {
    background-color: var(--bg-hover, rgba(128, 128, 128, 0.12));
}

.uxs-category-select:focus-visible {
    box-shadow: inset 0 0 0 2px var(--primary, #4285f4) !important;
}

.uxs-category-select option,
.uxs-unit-select option {
    background: var(--bg-light, var(--bg, Canvas));
    color: var(--text-primary, CanvasText);
}

/* ── Conversion rows ───────────────────────────────────────────── */

.uxs-row {
    display: flex;
    align-items: center;
    padding: 16px 0;
    gap: 16px;
    transition: background-color 0.15s ease;
}

.uxs-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

.uxs-label {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    margin-bottom: 4px;
}

/* ── Number input ──────────────────────────────────────────────── */

.degoog-input.uxs-amount {
    width: 100%;
    font-size: clamp(1.8rem, 5cqi, 2.1rem);
    font-weight: 400;
    color: var(--text-primary, inherit);
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    outline: none;
    letter-spacing: 0;
    padding: 0 0 4px;
    font-variant-numeric: tabular-nums;
    transition: border-color 0.2s ease;
    cursor: text;
}

.degoog-input.uxs-amount:hover {
    border-bottom-color: color-mix(
        in srgb,
        var(--primary, #4285f4) 45%,
        transparent
    ) !important;
}

.degoog-input.uxs-amount:focus {
    border-bottom-color: var(--primary, #4285f4) !important;
}

.uxs-amount::-webkit-inner-spin-button,
.uxs-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.uxs-amount[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* ── Result display ────────────────────────────────────────────── */

.uxs-result {
    font-size: clamp(1.8rem, 5cqi, 2.1rem);
    font-weight: 400;
    color: var(--text-primary, inherit);
    letter-spacing: 0;
    min-height: 1.3em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: break-word;
    padding-bottom: 4px;
    border-bottom: 2px solid transparent;
}

.uxs-result.updating {
    color: color-mix(
        in srgb,
        var(--text-primary, inherit) 78%,
        var(--primary, #4285f4)
    );
}

.uxs-result-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.uxs-result-line .uxs-result {
    flex: 1;
    min-width: 0;
}

.uxs-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid
        var(
            --border-light,
            var(--border, color-mix(in srgb, currentColor 30%, transparent))
        );
    border-radius: 999px;
    background: transparent;
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    cursor: pointer;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.uxs-copy svg {
    display: block;
}

.uxs-copy .uxs-copy-done {
    display: none;
}

.uxs-copy.copied .uxs-copy-icon {
    display: none;
}

.uxs-copy.copied .uxs-copy-done {
    display: block;
}

.uxs-copy:hover,
.uxs-copy:focus-visible {
    background: var(--bg-hover, rgba(128, 128, 128, 0.08));
    border-color: var(--primary, #4285f4);
    color: var(--primary, #4285f4);
    outline: none;
}

.uxs-copy.copied {
    border-color: var(--success, #34a853);
    color: var(--success, #34a853);
}

/* ── Unit select (right side) ──────────────────────────────────── */

.uxs-select-wrap {
    flex-shrink: 0;
    max-width: 55%;
}

.uxs-unit-select {
    width: 100%;
    color: var(--text-primary, inherit);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 10px 36px 10px 14px;
    border-radius: 999px;
    border: 1px solid
        var(--border, color-mix(in srgb, currentColor 30%, transparent)) !important;
    background-color: var(--bg-light, var(--bg, transparent)) !important;
    outline: none;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background-color 0.15s ease;
    text-align: left;
}

.uxs-unit-select:hover {
    border-color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 50%, transparent)
    );
    background-color: var(--bg-hover, rgba(128, 128, 128, 0.08));
}

.uxs-unit-select:focus-visible {
    border-color: var(--primary, #4285f4);
    box-shadow: 0 0 0 1px var(--primary, #4285f4);
}

/* ── Divider + swap button ─────────────────────────────────────── */

.uxs-divider {
    height: 1px;
    background: color-mix(in srgb, currentColor 15%, transparent);
    position: relative;
}

.uxs-swap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid
        var(--border, color-mix(in srgb, currentColor 30%, transparent));
    background: var(--bg-light, var(--bg, Canvas));
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
    z-index: 2;
    padding: 0;
}

.uxs-swap:hover {
    background: var(--bg-hover, rgba(128, 128, 128, 0.1));
    border-color: var(--primary, #4285f4);
    color: var(--primary, #4285f4);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

.uxs-swap:active {
    transform: translate(-50%, -50%) scale(0.93);
}

.uxs-swap-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.uxs-swap.spinning .uxs-swap-inner {
    transform: rotate(180deg);
}

/* ── Formula bar ───────────────────────────────────────────────── */

.uxs-formula-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 0 0 0;
    border-top: 1px solid var(--border-light, color-mix(in srgb, currentColor 15%, transparent));
    font-size: 0.82rem;
    color: var(
        --text-secondary,
        color-mix(in srgb, currentColor 60%, transparent)
    );
    letter-spacing: 0;
    background: transparent;
}

/* ── Mobile / narrow container ─────────────────────────────────── */

@container (max-width: 480px) {
    .uxs-amount,
    .uxs-result {
        font-size: 1.5rem;
    }

    .uxs-result-line {
        align-items: flex-start;
    }

    .uxs-row {
        padding: 14px;
        gap: 12px;
    }

    .uxs-category-select {
        padding-left: 14px;
        font-size: 0.84rem;
    }

    .uxs-unit-select {
        font-size: 0.82rem;
        padding: 8px 32px 8px 12px;
    }
}

/* ── Currency Slot – Minimal Theme ──────────────────── */

.cxs-wrap {
    container-type: inline-size;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    font-family: var(--font-sans, sans-serif);
    position: relative;
    color: var(--text-primary);
}

.cxs-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cxs-title {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.cxs-main {
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: var(--slot-inset-bg, var(--bg-light, #2f3033));
}

.cxs-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr) auto;
    grid-template-areas: "flag input button";
    align-items: end;
    padding: 16px 18px;
    gap: 14px;
}

.cxs-flag {
    grid-area: flag;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
}

.cxs-flag.changing {
    opacity: 0;
}

.cxs-flag svg {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 6px;
}

.cxs-input-wrap {
    grid-area: input;
    flex: 1;
    min-width: 0;
    position: relative;
}

.cxs-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.cxs-amount {
    width: 100%;
    font-size: clamp(1.8rem, 5vw, 2rem);
    font-weight: 400;
    color: var(--text-primary);
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-sans, sans-serif);
    letter-spacing: -0.03em;
    padding: 0 0 4px;
    border-bottom: 2px solid transparent;
    font-variant-numeric: tabular-nums;
    cursor: text;
    transition: border-color 160ms ease;
}

.cxs-amount:hover {
    border-bottom-color: color-mix(
        in srgb,
        var(--primary, #4285f4) 45%,
        transparent
    );
}

.cxs-amount:focus {
    border-bottom-color: var(--primary, #4285f4);
}

.cxs-amount::-webkit-inner-spin-button,
.cxs-amount::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.cxs-amount[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.cxs-result {
    font-size: clamp(1.8rem, 5vw, 2rem);
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    min-height: 32px;
    font-variant-numeric: tabular-nums;
}

.cxs-result-line {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.cxs-result-line .cxs-result {
    flex: 1;
    min-width: 0;
}

.cxs-copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border: 1px solid var(--border-light, var(--border));
    border-radius: 999px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.cxs-copy svg {
    display: block;
}

.cxs-copy .cxs-copy-done {
    display: none;
}

.cxs-copy.copied .cxs-copy-icon {
    display: none;
}

.cxs-copy.copied .cxs-copy-done {
    display: block;
}

.cxs-copy:hover,
.cxs-copy:focus-visible {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    border-color: var(--primary, #4285f4);
    color: var(--primary, #4285f4);
    outline: none;
}

.cxs-copy.copied {
    border-color: var(--success, #34a853);
    color: var(--success, #34a853);
}

/* Currency buttons */
.cxs-cur-btn {
    grid-area: button;
    justify-self: start;
    align-self: end;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
    font-family: var(--font-sans, sans-serif);
    margin-bottom: 2px;
}

.cxs-cur-btn:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-cur-display {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
}

.cxs-cur-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cxs-cur-name {
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cxs-divider {
    height: 1px;
    background: var(--border-light);
    position: relative;
}

.cxs-swap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg, #1a1a1a);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
    z-index: 2;
    padding: 0;
}

.cxs-swap:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
}

.cxs-swap-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s ease;
    width: 100%;
    height: 100%;
}

.cxs-swap.spinning .cxs-swap-inner {
    transform: rotate(180deg);
}

/* Rate bar */
.cxs-rate-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding: 10px 18px;
    border-top: 1px solid var(--border-light);
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.cxs-rate-val {
    font-weight: 600;
    color: var(--text-primary);
}

.cxs-updated {
    font-size: 0.74rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cxs-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success, #4ade80);
    animation: cxs-pulse-animate 2s ease-in-out infinite;
}

@keyframes cxs-pulse-animate {
    0%,
    100% {
        opacity: 0.4;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* Quick amounts */
.cxs-quick {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 14px;
}

.cxs-q {
    font-size: 0.88rem;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.cxs-q:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
}

/* Popular pairs */
.cxs-pairs-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.cxs-pairs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.cxs-pair {
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
    background: var(--bg-light, #2f3033);
    overflow: hidden;
}

.cxs-pair:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-pair-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.cxs-pair-rate {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

/* Picker */
.cxs-picker {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: var(--bg-light, var(--bg));
    border: 1px solid var(--border);
    border-radius: 12px;
    z-index: 1000;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: none;
    opacity: 0;
    transform: translateY(-8px);
    transition:
        opacity 0.2s ease,
        transform 0.2s ease;
}

.cxs-picker.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.cxs-picker-loading {
    padding: 32px 16px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.cxs-picker-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.cxs-picker-search {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans, sans-serif);
}

.cxs-picker-search::placeholder {
    color: var(--text-secondary);
}

.cxs-picker-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    border-radius: 8px;
    transition:
        background-color 160ms ease,
        color 160ms ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cxs-picker-close:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    color: var(--text-primary);
}

.cxs-picker-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px;
}

.cxs-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 160ms ease;
}

.cxs-picker-item:hover {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-picker-item--selected {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.cxs-picker-flag {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cxs-picker-flag svg {
    width: 100%;
    height: 100%;
    border-radius: 6px;
}

.cxs-picker-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.cxs-picker-name {
    font-size: 0.94rem;
    font-weight: 500;
    color: var(--text-primary);
}

.cxs-picker-code {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.cxs-picker-checkmark {
    color: var(--primary, #4ade80);
    font-size: 0.9rem;
    font-weight: 600;
    flex-shrink: 0;
}

@container (max-width: 480px) {
    .cxs-row {
        grid-template-columns: 22px minmax(0, 1fr);
        grid-template-areas:
            "flag input"
            "flag button";
        align-items: start;
    }

    .cxs-cur-btn {
        margin-bottom: 0;
        margin-top: 2px;
    }

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

    .cxs-amount,
    .cxs-result {
        font-size: 1.6rem;
    }

    .cxs-result-line {
        align-items: flex-start;
    }

    .cxs-row {
        padding: 14px;
    }

    .cxs-main > .cxs-row:first-child {
        padding-bottom: 22px;
    }
}

/* ── Chart Panel ───────────────────────────────────── */

.cxs-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 20px;
}

/* Default (narrow layouts): picker uses full card width. */
.cxs-picker {
    right: 0;
    width: 100%;
}

/* Wide chart + converter row follows the native slot's actual card width. */
@container (min-width: 900px) {
    .cxs-layout {
        flex-direction: row;
    }

    .cxs-picker {
        right: auto;
        width: calc((100% - 1rem) / 2);
    }
}

@container (max-width: 600px) {
    .cxs-layout {
        flex-direction: column;
    }

    .cxs-picker {
        width: 100%;
    }
}

.cxs-layout .cxs-main {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
}

.cxs-chart-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 12px;
    padding: 16px;
    background: var(--slot-inset-bg, var(--bg-light, transparent));
}

@container (max-width: 600px) {
    .cxs-chart-panel {
        min-height: 212px;
    }
}

.cxs-chart-header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 12px;
}

.cxs-chart-title {
    display: none;
}

.cxs-chart-periods {
    display: flex;
    gap: 4px;
}

.cxs-period {
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-light);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease;
}

.cxs-period:hover {
    background: var(--bg-hover);
    border-color: var(--border);
}

.cxs-period--active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cxs-period--active:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.cxs-chart-body {
    flex: 1;
    /* Matches renderChart() fixed H in script.js so loading state doesn’t jump. */
    min-height: 212px;
    position: relative;
}

.cxs-chart-svg {
    width: 100%;
    height: 100%;
    display: block;
    min-height: 212px;
}

.cxs-chart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    min-height: 212px;
    height: 100%;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.cxs-chart-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.45rem 0.7rem;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.cxs-stat {
    flex: 1 1 92px;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cxs-stat--placeholder {
    visibility: hidden;
    pointer-events: none;
}

.cxs-stat-label {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cxs-stat-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2px;
}

.cxs-stat-value--up {
    color: var(--success);
}

.cxs-stat-value--down {
    color: var(--danger);
}

.cxs-chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.cxs-chart-fill {
    opacity: 0.15;
}

.cxs-chart-dot {
    fill: var(--primary);
    r: 4;
}

/* ── Chart grid & axes ─────────────────────────────────────── */

.cxs-chart-grid-line {
    stroke: var(--border-light);
    stroke-width: 1;
    stroke-dasharray: 3 3;
}

.cxs-chart-y-label {
    font-size: 10px;
    fill: var(--text-secondary);
    font-family: var(--font-sans, sans-serif);
    dominant-baseline: middle;
}

.cxs-chart-x-label {
    font-size: 10px;
    fill: var(--text-secondary);
    font-family: var(--font-sans, sans-serif);
    dominant-baseline: middle;
}

/* ── Chart hover interaction ───────────────────────────────── */

.cxs-chart-hit {
    fill: transparent;
    pointer-events: all;
    cursor: crosshair;
}

.cxs-chart-hl-line {
    stroke: var(--text-secondary);
    stroke-width: 1;
    stroke-dasharray: 3 3;
    stroke-opacity: 0.5;
    pointer-events: none;
}

.cxs-chart-hl-dot {
    fill: var(--primary, #4285f4);
    stroke: var(--bg-light, var(--bg, #1f1f1f));
    stroke-width: 2;
    pointer-events: none;
}

.cxs-chart-tooltip {
    position: absolute;
    background: var(--bg-light);
    border: 1px solid var(--border);
    border-radius: var(--theme-radius-sm, 8px);
    padding: 8px 12px;
    font-size: 0.8rem;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.15s ease;
    top: 0;
}

.cxs-chart-tooltip--visible {
    opacity: 1;
}

.cxs-tt-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.cxs-tt-rate {
    font-weight: 600;
    color: var(--text-primary);
}

.trc-card {
  --trc-accent: var(--primary);
  container-type: inline-size;
  box-sizing: border-box;
  width: 100%;
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid var(--border-light);
  border-radius: 18px;
  background: var(--bg-light);
  color: var(--text-primary);
  font-family: var(--font-sans, system-ui, sans-serif);
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .trc-card) {
  overflow: hidden;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .trc-card) > .results-slot-panel-body {
  padding: 0 !important;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .trc-card) .results-slot-panel-title {
  display: none;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .trc-card) > .results-slot-panel-body > .trc-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.trc-card *,
.trc-card *::before,
.trc-card *::after {
  box-sizing: border-box;
}

.trc-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.trc-title-wrap {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding-top: 2px;
}

.trc-glyph {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--trc-accent);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
}

.trc-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trc-provider-field {
  display: grid;
  min-width: min(250px, 52%);
  gap: 4px;
}

.trc-label {
  display: block;
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.2;
}

.trc-status {
  display: none;
}

.trc-status[data-status="success"] {
  color: var(--success);
}

.trc-status[data-status="failed"] {
  color: var(--warning);
}

.trc-status[data-status="disabled"] {
  color: var(--text-secondary);
}

.trc-language-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.trc-field {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.trc-provider-select,
.trc-source-select,
.trc-target-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2380868b' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 10px 6px;
  padding: 0 32px 0 12px;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.trc-provider-select:focus,
.trc-source-select:focus,
.trc-target-select:focus {
  border-color: var(--trc-accent);
  outline: none;
}

.trc-source-input:focus,
.trc-output:focus {
  outline: none;
}

.trc-icon-button {
  display: inline-flex;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.trc-icon-button:hover,
.trc-icon-button:focus-visible,
.trc-audio-button.trc-audio-playing {
  border-color: var(--border);
  color: var(--text-primary);
  background: color-mix(in srgb, var(--text-secondary) 10%, transparent);
  outline: none;
}

.trc-icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.trc-icon-button svg,
.trc-button svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.trc-text-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.trc-pane {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 8px;
  min-height: 190px;
  padding: 13px 14px 10px;
  border: 1px solid var(--border-light);
  border-radius: 16px;
  background: var(--bg);
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.trc-pane:focus-within {
  border-color: var(--trc-accent);
  box-shadow: 0 0 0 1px var(--trc-accent);
}

.trc-source-input,
.trc-output {
  width: 100%;
  min-height: 92px;
  max-height: 220px;
  resize: vertical;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.32;
  padding: 0;
}

.trc-output {
  color: var(--text-primary);
}

.trc-source-input::placeholder,
.trc-output::placeholder {
  color: var(--text-secondary);
}

.trc-romanization {
  min-height: 1.2em;
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.35;
}

.trc-romanization:empty {
  display: none;
}

.trc-pane-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-top: auto;
}

.trc-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

.trc-button {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text-primary);
  cursor: pointer;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 7px 11px;
}

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

.trc-button:disabled,
.trc-card[data-trc-loading="1"] .trc-button {
  cursor: wait;
  opacity: 0.68;
}

.trc-copy-button[data-copied="1"] {
  border-color: var(--success);
  color: var(--success);
}

@container (max-width: 680px) {
  .trc-card {
    padding: 10px;
  }

  .trc-toolbar {
    display: grid;
    gap: 8px;
  }

  .trc-provider-field {
    min-width: 0;
  }
}

.dslot-card {
  --dslot-accent: var(--primary);
  container-type: inline-size;
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 18px;
  background: var(--bg, Canvas);
  color: var(--text-primary, CanvasText);
  font-family: var(--font-sans, sans-serif);
}

.dslot-head {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dslot-kicker,
.dslot-label {
  color: var(--text-secondary, #5f6368);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: uppercase;
}

.dslot-word-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.dslot-word {
  margin: 0;
  color: var(--text-primary, inherit);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.dslot-phonetic {
  color: var(--text-secondary, #5f6368);
  font-size: 0.96rem;
  line-height: 1.35;
}

.dslot-audio {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 8px;
  background: var(--bg, Canvas);
  color: var(--text-secondary, #5f6368);
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.dslot-audio:hover,
.dslot-audio:focus-visible,
.dslot-audio.dslot-audio-playing {
  border-color: var(--dslot-accent, #4285f4);
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 9%, transparent);
  color: var(--dslot-accent, #4285f4);
  outline: none;
}

.dslot-audio:active {
  transform: translateY(1px);
}

.dslot-audio-icon {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.dslot-definitions {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dslot-def {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg-light, Canvas) 80%, transparent);
}

.dslot-def-num {
  color: var(--text-secondary, #5f6368);
  font-size: 0.92rem;
  line-height: 1.55;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.dslot-def-copy {
  min-width: 0;
}

.dslot-def-line {
  color: var(--text-primary, inherit);
  font-size: 0.98rem;
  line-height: 1.55;
}

.dslot-pos {
  color: var(--dslot-accent, #4285f4);
  font-size: 0.88rem;
  font-style: italic;
  margin-right: 6px;
}

.dslot-example {
  margin-top: 2px;
  color: var(--text-secondary, #5f6368);
  font-size: 0.9rem;
  font-style: italic;
  line-height: 1.45;
}

.dslot-related {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  padding: 12px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-light, Canvas) 75%, transparent);
}

.dslot-related-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.dslot-tags {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dslot-tag,
.dslot-term {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 999px;
  background: var(--bg, Canvas);
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.dslot-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px dashed var(--dslot-accent, #4285f4);
  border-radius: 999px;
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 5%, transparent);
  color: var(--dslot-accent, #4285f4);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.25;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease;
}

.dslot-more:hover,
.dslot-more:focus-visible {
  border-color: var(--dslot-accent, #4285f4);
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 12%, transparent);
}

.dslot-term {
  display: grid;
  align-items: start;
  gap: 2px;
  min-width: 0;
  min-height: 32px;
  padding: 5px 7px;
}

.dslot-term-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.dslot-term-word {
  min-width: 0;
  padding: 0 0 0 6px;
  border: 0;
  background: transparent;
  color: var(--text-primary, inherit);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
  text-align: left;
  overflow-wrap: anywhere;
}

.dslot-term-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 7px;
  min-width: 0;
  padding-left: 4px;
  color: var(--text-secondary, #5f6368);
  font-size: 0.76rem;
  line-height: 1.25;
}

.dslot-term-meta {
  color: var(--dslot-accent, #4285f4);
  font-style: italic;
}

.dslot-term-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.dslot-rating {
  flex: 0 0 auto;
  padding: 1px 5px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--success, #34a853) 13%, transparent);
  color: var(--success, #137333);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
}

.dslot-term-link {
  flex: 0 0 auto;
  color: var(--text-link, var(--dslot-accent, #4285f4));
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.dslot-term-link:hover,
.dslot-term-link:focus-visible {
  text-decoration: underline;
}

.dslot-tag-button {
  min-height: 24px;
  padding-block: 3px;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    color 0.16s ease,
    background-color 0.16s ease,
    transform 0.16s ease;
}

.dslot-tag-button:hover,
.dslot-tag-button:focus-visible {
  color: var(--dslot-accent, #4285f4);
}

.dslot-card :where(button, a[href]):focus-visible {
  outline: 2px solid var(--dslot-accent, #4285f4);
  outline-offset: 2px;
}

.dslot-tag-button.dslot-tag:hover,
.dslot-tag-button.dslot-tag:focus-visible {
  border-color: var(--dslot-accent, #4285f4);
  background: color-mix(in srgb, var(--dslot-accent, #4285f4) 8%, transparent);
}

.dslot-tag-button:active {
  transform: translateY(1px);
}

/* Custom dslot-more styling is declared above */

.dslot-origin {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-light, Canvas) 75%, transparent);
}

.dslot-origin p {
  margin: 0;
  color: var(--text-primary, inherit);
  font-size: 0.94rem;
  line-height: 1.5;
}

.dslot-empty {
  color: var(--text-secondary, #5f6368);
  font-size: 0.96rem;
  line-height: 1.5;
}

.dslot-empty strong {
  color: var(--text-primary, inherit);
  font-weight: 600;
}

.dslot-source {
  color: var(--text-secondary, #5f6368);
  font-size: 0.78rem;
  line-height: 1.35;
}

.dslot-source a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  color: var(--text-link, var(--dslot-accent, #4285f4));
  text-decoration: none;
}

.dslot-source a:hover,
.dslot-source a:focus-visible {
  text-decoration: underline;
}

@container (max-width: 420px) {
  .dslot-word {
    font-size: 1.36rem;
  }

  .dslot-related {
    grid-template-columns: 1fr;
  }

  .dslot-def {
    grid-template-columns: 1.1rem minmax(0, 1fr);
  }
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .dslot-card) {
  overflow: hidden;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .dslot-card) > .results-slot-panel-body {
  padding: 0 !important;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .dslot-card) .results-slot-panel-title {
  display: none;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .dslot-card) > .results-slot-panel-body > .dslot-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

/* Unnest inside at-a-glance wrapper (.glance-box) */
.glance-box:has(.dslot-card) {
  padding: 0 !important;
  overflow: hidden;
}

.glance-box:has(.dslot-card) .dslot-card {
  width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 14px;
}

/* ── Modal overlay ──────────────────────────────────────────────── */
.dslot-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: var(--overlay-bg, rgba(0, 0, 0, 0.7));
  backdrop-filter: blur(4px);
  animation: dslot-fade-in 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.dslot-modal-overlay.dslot-modal-closing {
  animation: dslot-fade-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Modal container ────────────────────────────────────────────── */
.dslot-modal-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 580px;
  max-height: 80vh;
  border: 1px solid var(--border-light, #444746);
  border-radius: 20px;
  background: var(--bg-light, Canvas);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  animation: dslot-scale-in 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  color: var(--text-primary);
  font-family: var(--font-sans, sans-serif);
}

.dslot-modal-overlay.dslot-modal-closing .dslot-modal-container {
  animation: dslot-scale-out 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* ── Modal header ───────────────────────────────────────────────── */
.dslot-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light, #444746);
}

.dslot-modal-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.dslot-modal-word {
  color: var(--text-primary);
  font-weight: 700;
}

.dslot-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease;
}

.dslot-modal-close:hover {
  background: var(--bg-hover, #3c4043);
  color: var(--text-primary);
}

/* ── Modal body ─────────────────────────────────────────────────── */
.dslot-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.dslot-tags-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-start;
}

/* ── Animations ─────────────────────────────────────────────────── */
@keyframes dslot-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dslot-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes dslot-scale-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes dslot-scale-out {
  from {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
  to {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
}

/* Stock Quote Slot */

.stocks-card {
    container-type: inline-size;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    --stocks-up: #188038;
    --stocks-down: #d93025;
    --stocks-flat: var(--text-secondary);
    --stocks-line: var(--stocks-flat);
    color: var(--text-primary);
    display: grid;
    gap: 12px;
    font-family: var(--font-sans, sans-serif);
}

.stocks-summary {
    align-items: stretch;
    display: grid;
    gap: 12px;
    min-width: 0;
}



.stocks-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.stocks-identity {
    min-width: 0;
}

.stocks-eyebrow {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.3;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.stocks-symbol-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.stocks-symbol {
    color: var(--text-primary);
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1.05;
    text-decoration: none;
}

.stocks-symbol:hover {
    color: var(--text-link);
    text-decoration: underline;
}

.stocks-exchange {
    border: 1px solid var(--border-light);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1;
    max-width: 190px;
    overflow: hidden;
    padding: 4px 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stocks-company {
    color: var(--text-secondary);
    font-size: 0.94rem;
    line-height: 1.35;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.stocks-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.stocks-price-block {
    display: grid;
    gap: 2px;
    justify-items: end;
    text-align: right;
}

.stocks-price {
    align-items: baseline;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    white-space: nowrap;
}

.stocks-price-value {
    color: var(--text-primary);
    font-size: 1.65rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1.05;
    border-radius: 6px;
    padding: 0 0.15rem;
    transition: color 180ms ease;
}

@keyframes stocks-price-flash-up {
    0% {
        background-color: color-mix(in srgb, var(--stocks-up) 38%, transparent);
        color: var(--stocks-up);
    }
    100% {
        background-color: transparent;
        color: var(--text-primary);
    }
}

@keyframes stocks-price-flash-down {
    0% {
        background-color: color-mix(in srgb, var(--stocks-down) 38%, transparent);
        color: var(--stocks-down);
    }
    100% {
        background-color: transparent;
        color: var(--text-primary);
    }
}

.stocks-price-flash-up {
    animation: stocks-price-flash-up 650ms ease-out;
}

.stocks-price-flash-down {
    animation: stocks-price-flash-down 650ms ease-out;
}

@keyframes stocks-change-flash {
    0% {
        transform: scale(1.04);
        filter: brightness(1.08);
    }
    100% {
        transform: scale(1);
        filter: none;
    }
}

.stocks-change-flash-up,
.stocks-change-flash-down {
    animation: stocks-change-flash 450ms ease-out;
}

.stocks-currency {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 650;
}

.stocks-change {
    font-size: 0.82rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 4px;
}

.stocks-card-up .stocks-change {
    background-color: var(--stocks-up);
    color: #ffffff;
}

.stocks-card-down .stocks-change {
    background-color: var(--stocks-down);
    color: #ffffff;
}

.stocks-card-flat .stocks-change {
    background-color: var(--stocks-flat);
    color: #ffffff;
}

.stocks-chart {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--slot-inset-border, var(--border-light));
    border-radius: 16px;
    padding: 16px;
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--text-primary) 4%, transparent),
            transparent 58%
        ),
        var(--slot-inset-bg, var(--bg-light, transparent));
    box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-primary) 6%, transparent);
    --stocks-line: var(--stocks-flat);
}

.stocks-chart-up {
    --stocks-line: var(--stocks-up);
}

.stocks-chart-down {
    --stocks-line: var(--stocks-down);
}

.stocks-chart-flat {
    --stocks-line: var(--stocks-flat);
}

.stocks-chart-header {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    min-width: 0;
}

.stocks-chart-title {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.stocks-chart-periods {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
    padding: 4px;
    border: 1px solid var(--border-light);
    border-radius: 100px;
    background: color-mix(in srgb, var(--bg-light, transparent) 72%, transparent);
}

.stocks-period {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 999px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans, sans-serif);
    font-size: 0.72rem;
    font-weight: 650;
    line-height: 1;
    min-height: 24px;
    min-width: 30px;
    padding: 5px 6px;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        color 160ms ease;
}

.stocks-period:hover,
.stocks-period:focus-visible {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
    border-color: var(--border-light);
    color: var(--text-primary);
    outline: none;
}

.stocks-period--active,
.stocks-period--active:hover {
    background: var(--stocks-line);
    border-color: var(--stocks-line);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--stocks-line) 34%, transparent);
}

.stocks-chart-body {
    flex: 1;
    min-height: 100px;
    min-width: 0;
    position: relative;
}

.stocks-chart-loading {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.9rem;
    height: 100%;
    min-height: 100px;
    justify-content: center;
}

.stocks-chart-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.45rem 0.7rem;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
}

.stocks-chart-stats:empty {
    display: none;
    min-height: 0;
}

.stocks-chart-stat {
    flex: 1 1 92px;
    min-width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stocks-chart-stat-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1;
    text-transform: uppercase;
}

.stocks-chart-stat-value {
    color: var(--text-primary);
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    font-weight: 650;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stocks-chart-stat-value--up {
    color: var(--stocks-up);
}

.stocks-chart-stat-value--down {
    color: var(--stocks-down);
}

.stocks-sparkline {
    display: block;
    width: 100%;
    height: 100%;
}

.stocks-sparkline-area {
    fill: color-mix(in srgb, var(--stocks-line) 16%, transparent);
}

.stocks-sparkline-line {
    fill: none;
    stroke: var(--stocks-line);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2.4;
}

.stocks-sparkline-dot {
    fill: var(--stocks-line);
    transition: cy 280ms ease, cx 280ms ease;
}

@keyframes stocks-dot-pulse {
    0% {
        r: 3;
        opacity: 1;
    }
    40% {
        r: 5.5;
        opacity: 0.85;
    }
    100% {
        r: 3;
        opacity: 1;
    }
}

.stocks-sparkline-dot--pulse {
    animation: stocks-dot-pulse 520ms ease-out;
}

.stocks-sparkline-label {
    fill: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0;
}

.stocks-sparkline-empty {
    align-items: center;
    color: var(--text-secondary);
    display: flex;
    font-size: 0.9rem;
    height: 100%;
    min-height: 100px;
    justify-content: center;
}

/* Hover and Grid Styles */
.stocks-chart-grid-line {
    stroke: var(--border-light, #dadce0);
    stroke-width: 1;
    stroke-dasharray: 2,4;
    opacity: 0.72;
}
.stocks-chart-x-label,
.stocks-chart-y-label {
    fill: var(--text-secondary);
    font-size: 10px;
    font-weight: 500;
}
.stocks-chart-hl-line {
    stroke: var(--stocks-line);
    stroke-width: 1;
    stroke-dasharray: 2,3;
    opacity: 0.45;
}
.stocks-chart-hl-dot {
    fill: var(--bg-light, var(--bg));
    stroke: var(--stocks-line);
    stroke-width: 2;
}
.stocks-chart-hit {
    fill: transparent;
    pointer-events: all;
    cursor: crosshair;
}
.stocks-chart-tooltip {
    position: absolute;
    background: var(--bg, #1a1a1a);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.28);
    pointer-events: none;
    z-index: 10;
    margin-top: 22px;
    min-width: max-content;
    opacity: 0;
    transition:
        opacity 120ms ease,
        left 80ms ease;
}
.stocks-chart-tooltip::after {
    content: "";
    position: absolute;
    left: 50%;
    top: -5px;
    width: 8px;
    height: 8px;
    background: var(--bg, #1a1a1a);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: translateX(-50%) rotate(45deg);
}
.stocks-chart-tooltip--visible {
    display: block !important;
    opacity: 1;
}
.stocks-tt-date {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}
.stocks-tt-price {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stocks-details {
    display: grid;
    gap: 8px 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: auto;
}

.stocks-detail {
    background-color: var(--bg-hover, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--border-light);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    padding: 6px 10px;
}

.stocks-detail-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
}

.stocks-detail-value {
    color: var(--text-primary);
    font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: 1.25;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stocks-detail-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--text-link);
    text-decoration: none;
}

.stocks-detail-link:hover {
    text-decoration: underline;
}

.stocks-card {
    gap: 14px;
}

@container (min-width: 760px) {
    .stocks-summary {
        grid-template-columns: minmax(300px, 0.82fr) minmax(320px, 1fr);
    }

    .stocks-chart {
        min-height: auto;
    }

    .stocks-chart-body {
        min-height: 190px;
        height: 190px;
        flex: none;
        margin-bottom: 16px;
    }

    .stocks-chart-stats {
        margin-top: auto;
        padding-top: 16px;
    }

    .stocks-details {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px 10px;
        margin-top: auto;
    }
}

@container (max-width: 560px) {
    .stocks-chart-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .stocks-chart-periods {
        justify-content: flex-start;
    }

    .stocks-price-block {
        justify-items: start;
        text-align: left;
    }

    .stocks-price {
        justify-content: flex-start;
    }
}

@container (max-width: 390px) {
    .stocks-details {
        grid-template-columns: 1fr;
    }
}

.stocks-chart {
    border-radius: 16px;
}

.music-card {
    container-type: inline-size;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    padding: 20px;
    border: 1px solid var(--border-light, var(--border, #dadce0));
    border-radius: var(--theme-radius-search, 24px);
    background: var(--bg-light, var(--bg, Canvas));
    color: var(--text-primary, CanvasText);
    font-family: var(--font-sans, sans-serif);
}

.music-song {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 24px;
    min-width: 0;
}

.music-song-cover {
    width: 168px;
    height: 168px;
    overflow: hidden;
    border-radius: 12px;
    background: color-mix(in srgb, var(--text-secondary, #5f6368) 12%, transparent);
    box-shadow: 0 1px 3px color-mix(in srgb, #000 18%, transparent);
}

.music-song-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-song-cover-empty {
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, color-mix(in srgb, var(--primary, #1a73e8) 20%, var(--bg-light, Canvas)), color-mix(in srgb, var(--text-secondary, #5f6368) 14%, var(--bg, Canvas)));
    color: var(--text-secondary, #5f6368);
    font-size: 3.2rem;
}

.music-song-content {
    align-self: center;
    min-width: 0;
}

.music-song-title {
    min-width: 0;
    margin: 4px 0 0;
    font-size: clamp(1.75rem, 3.4cqi, 2.35rem);
    font-weight: 600;
    line-height: 1.08;
    overflow-wrap: anywhere;
}

.music-song-subtitle {
    margin-top: 7px;
    color: var(--text-secondary, #5f6368);
    font-size: .96rem;
    line-height: 1.4;
}

.music-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.music-fact {
    min-width: 0;
    padding-top: 10px;
    border-top: 1px solid var(--border-light, var(--border, #dadce0));
}

.music-fact-label,
.music-fact-value {
    display: block;
    overflow-wrap: anywhere;
}

.music-fact-label {
    color: var(--text-secondary, #5f6368);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .02em;
}

.music-fact-value {
    margin-top: 4px;
    font-size: .88rem;
    line-height: 1.35;
}

.music-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 14px;
}

.music-tags span {
    padding: 4px 9px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary, #5f6368) 10%, transparent);
    color: var(--text-secondary, #5f6368);
    font-size: .74rem;
}

.music-heading,
.music-section {
    min-width: 0;
}

.music-kicker {
    color: var(--text-secondary, #5f6368);
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.3;
    text-transform: uppercase;
}

.music-title {
    min-width: 0;
    margin: 3px 0 0;
    font-size: 1.55rem;
    font-weight: 650;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.music-title-link,
.music-release-title,
.music-artist-link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: var(--text-link, #1a73e8);
    text-decoration: none;
}

.music-title-link:hover,
.music-release-title:hover,
.music-artist-link:hover {
    text-decoration: underline;
}

.music-meta,
.music-byline {
    color: var(--text-secondary, #5f6368);
    font-size: .86rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.music-section {
    margin-top: 16px;
}

.music-section h3 {
    margin: 0 0 8px;
    font-size: .92rem;
    font-weight: 650;
}

.music-releases {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
}

.music-release {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 9px;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--border-light, var(--border, #dadce0));
    border-radius: 14px;
    background: color-mix(in srgb, var(--bg, Canvas) 72%, transparent);
}

.music-cover {
    width: 52px;
    height: 52px;
    overflow: hidden;
    border-radius: 9px;
    background: color-mix(in srgb, var(--text-secondary, #5f6368) 13%, transparent);
}

.music-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.music-release-copy,
.music-release-name {
    min-width: 0;
}

.music-release-name {
    font-size: .92rem;
    font-weight: 650;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.music-byline {
    margin-top: 3px;
    font-size: .78rem;
}

.music-links {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 18px;
}

.music-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 14px 6px 9px;
    border: 1px solid color-mix(in srgb, var(--primary, #1a73e8) 28%, var(--border-light, #dadce0));
    border-radius: 999px;
    background: color-mix(in srgb, var(--primary, #1a73e8) 6%, transparent);
    color: var(--text-link, #1a73e8);
    font-size: .82rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .16s ease, transform .16s ease;
}

.music-service-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: currentColor;
}

.music-service-icon-spotify {
    color: #1ed760;
}

.music-service-icon-apple {
    color: #fa243c;
}

.music-service-icon-deezer {
    color: #a238ff;
}

.music-service-icon-youtube {
    color: #ff0000;
}

.music-pill:hover,
.music-pill:focus-visible {
    background: color-mix(in srgb, var(--primary, #1a73e8) 13%, transparent);
}

.music-pill:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

.music-pill:active {
    transform: translateY(1px);
}

@container (max-width: 720px) {
    .music-song {
        grid-template-columns: 136px minmax(0, 1fr);
        gap: 18px;
    }

    .music-song-cover {
        width: 136px;
        height: 136px;
    }

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

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

@container (max-width: 430px) {
    .music-card {
        padding: 16px;
    }

    .music-song {
        grid-template-columns: minmax(0, 1fr);
    }

    .music-song-cover {
        width: min(100%, 220px);
        height: auto;
        aspect-ratio: 1;
    }

    .music-releases {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ── TMDB Slot Plugin — Minimal Theme ──────────────────────────────────────── */

/* Wide arrangements are driven by this card's actual container size. */
.tmdb-result {
    container-type: inline-size;
    container-name: tmdb-result;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    color: var(--text-primary);
    padding: 0 0 1.25rem;
    font-family: var(--font-sans, sans-serif);
    /* Themes often set --border-light too close to --bg-light in dark mode; edges stay visible. */
    --tmdb-edge: var(
        --border,
        color-mix(in srgb, var(--text-primary, CanvasText) 22%, transparent)
    );
    --tmdb-surface: color-mix(
        in srgb,
        var(--bg-light, var(--bg)) 82%,
        var(--bg) 18%
    );
    --tmdb-surface-soft: color-mix(
        in srgb,
        var(--bg-light, var(--bg)) 52%,
        var(--bg) 48%
    );
    --tmdb-hover: color-mix(
        in srgb,
        var(--primary, #1a73e8) 7%,
        var(--tmdb-surface)
    );
    --tmdb-focus: var(--primary, #1a73e8);
    --tmdb-radius: 12px;
    --tmdb-muted: color-mix(
        in srgb,
        var(--text-secondary) 82%,
        var(--text-primary) 18%
    );
}

.tmdb-result > .tmdb-panel {
    min-width: 0;
    max-width: 100%;
}

/* ── Image Combo (movie / TV): 1 large poster + 2 stacked backdrops ───────── */

.tmdb-img-combo {
    min-width: 0;
    gap: 2px;
    background: rgba(0, 0, 0, 0.65);
    margin-bottom: 0;
    border-radius: var(--tmdb-radius);
    overflow: hidden;
    isolation: isolate;
}

.tmdb-img-main {
    height: 100%;
}

.tmdb-img-side {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 0;
    height: 100%;
}

.tmdb-img-side > .tmdb-combo-tile-wrap,
.tmdb-img-side > .tmdb-combo-img,
.tmdb-img-side > .tmdb-combo-placeholder {
    flex: 1 1 0;
    min-height: 0;
    width: 100%;
}

.tmdb-combo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: var(--bg-light);
    cursor: pointer;
    transition: transform 0.25s ease;
    overflow: hidden;
    transform-origin: center center;
    backface-visibility: hidden;
}

/* Per-tile clip (esp. quad columns): some engines don’t clip transformed <img> on the
   inner horizontal gutter; the wrapper is the reliable overflow box. */
.tmdb-combo-tile-wrap {
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: stretch;
    justify-content: stretch;
}

.tmdb-combo-tile-wrap > .tmdb-combo-img {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
}

/* Hover zoom stays inside each tile (clips black gutters + outer rounded frame). */
.tmdb-img-combo .tmdb-combo-img:hover,
.tmdb-person-photo .tmdb-person-photo-img:hover {
    transform: scale(1.08);
}

/* Ensure overflow hidden clips the zoomed image */
.tmdb-img-main,
.tmdb-img-side,
.tmdb-person-photo {
    overflow: hidden;
}

.tmdb-combo-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-light);
    border-radius: 6px;
}

/* Default (narrow container): stack the image combo on top of the info block.
   The wide side-by-side layout is restored via @container below. */
.tmdb-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

/* ── Person: portrait grid ───────────────────────────────────────────────── */

.tmdb-person-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    margin-bottom: 0;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 7;
    width: 100%;
}

.tmdb-person-photo {
    overflow: hidden;
    background: var(--bg-light);
    grid-template-columns: repeat(2, 1fr);
}

.tmdb-person-grid .tmdb-person-photo:nth-child(odd):last-child {
    grid-row: 1 / 3;
}

.tmdb-person-photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    cursor: pointer;
    transition: transform 0.25s ease;
    overflow: hidden;
    transform-origin: center center;
    backface-visibility: hidden;
}

.tmdb-person-photo--empty {
    opacity: 0.15;
}

/* ── Adaptive image layouts ────────────────────────────────────────────────── */

/* Single image: full width of the combo frame.
   Posters are portrait — do not force 16:9 or cover (that clips tops/sides). */
.tmdb-img-combo.tmdb-img-combo--single {
    display: block;
    grid-template-columns: none;
}

.tmdb-img-combo--single > .tmdb-combo-img:not(.tmdb-combo-poster) {
    width: 100%;
    height: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.tmdb-img-combo--single > .tmdb-combo-img.tmdb-combo-poster {
    width: 100%;
    height: auto;
    max-height: none;
    aspect-ratio: unset;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Two images: side by side */
.tmdb-img-combo.tmdb-img-combo--double {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
}

.tmdb-img-combo--double > .tmdb-combo-tile-wrap {
    aspect-ratio: 1;
    min-height: 0;
}

/* Poster + backdrop: poster column sizes itself to the poster's natural aspect ratio at
   the collage height — no forced width. Backdrops take the remaining space. */
.tmdb-img-combo.tmdb-img-combo--double.tmdb-img-combo--poster-first {
    grid-template-columns: auto minmax(0, 1fr);
}

.tmdb-img-combo--double.tmdb-img-combo--poster-first > .tmdb-combo-tile-wrap {
    aspect-ratio: unset;
    align-self: stretch;
}

/* Triple layout: one row, two equal columns — poster | stacked backdrops.
   (Do not use a 2-row grid with main spanning both rows and side in row 1 only;
    that collapses the side cell height and smushes images.) */
.tmdb-img-combo.tmdb-img-combo--triple {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: 2px;
    min-height: 0;
}

.tmdb-img-combo.tmdb-img-combo--triple.tmdb-img-combo--poster-first {
    grid-template-columns: auto minmax(0, 1fr);
}

.tmdb-img-combo--triple > .tmdb-img-main {
    min-height: 0;
    height: 100%;
    grid-column: 1;
    grid-row: 1;
}

.tmdb-img-combo--triple > .tmdb-img-side {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Poster-leading hero column: poster drives its own width from intrinsic aspect ratio. */
.tmdb-img-combo--poster-first > .tmdb-img-main,
.tmdb-img-combo--double.tmdb-img-combo--poster-first
    > .tmdb-combo-tile-wrap:first-child {
    display: flex;
    min-width: 0;
    min-height: 0;
    align-items: stretch;
}

.tmdb-img-combo--poster-first > .tmdb-img-main > .tmdb-combo-img,
.tmdb-img-combo--poster-first > .tmdb-img-main > .tmdb-combo-placeholder,
.tmdb-img-combo--double.tmdb-img-combo--poster-first
    > .tmdb-combo-tile-wrap:first-child
    > .tmdb-combo-img,
.tmdb-img-combo--double.tmdb-img-combo--poster-first
    > .tmdb-combo-tile-wrap:first-child
    > .tmdb-combo-placeholder {
    width: auto;
    height: 100%;
    min-height: 0;
    object-fit: contain;
    object-position: center top;
    display: block;
}

/* Three stills only (no poster in the assembled set) */
.tmdb-img-combo.tmdb-img-combo--triple-no-poster {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2px;
}

.tmdb-img-combo--triple-no-poster > .tmdb-combo-tile-wrap {
    min-height: 0;
}

.tmdb-img-combo--triple-no-poster > .tmdb-combo-tile-wrap > .tmdb-combo-img {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}

/* Poster + three backdrops: full-height poster column | top row (2 stills) + bottom wide still */
.tmdb-img-combo.tmdb-img-combo--quad {
    display: grid;
    grid-template-columns: minmax(158px, 46%) minmax(0, 1fr);
    gap: 2px;
    min-height: 0;
    align-items: stretch;
}

.tmdb-img-combo--quad > .tmdb-img-main {
    min-height: 0;
    height: 100%;
}

.tmdb-img-side--quad {
    display: grid;
    grid-template-rows: 2fr 3fr;
    gap: 2px;
    min-height: 0;
    height: 100%;
}

.tmdb-quad-side-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    min-height: 0;
    overflow: hidden;
}

.tmdb-quad-side-bottom {
    min-height: 0;
    overflow: hidden;
}

.tmdb-img-side--quad .tmdb-quad-side-top .tmdb-combo-tile-wrap,
.tmdb-img-side--quad .tmdb-quad-side-bottom .tmdb-combo-tile-wrap {
    min-height: 0;
}

.tmdb-img-combo--quad .tmdb-combo-tile {
    width: 100%;
    height: 100%;
    min-height: 0;
    object-fit: cover;
}

/* Empty state */
.tmdb-img-combo.tmdb-img-combo--empty {
    display: block;
}

.tmdb-person-info,
.tmdb-info-block {
    padding-bottom: 0.25rem;
    min-width: 0;
}

/* Medium container (>=640px): side-by-side layout. */
@container (min-width: 640px) {
    .tmdb-overview {
        grid-template-columns: repeat(4, 1fr);
    }
    .tmdb-overview .tmdb-person-grid {
        grid-column: 1 / 3;
        aspect-ratio: auto;
        height: 300px;
    }
    .tmdb-person-info,
    .tmdb-info-block {
        grid-column: 3 / 5;
    }
}

/* ── Info block ───────────────────────────────────────────────────────────── */

.tmdb-info-block {
    margin-bottom: 0.5rem;
}

.tmdb-title {
    margin: 0 0 0.75rem;
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
    color: var(--text-primary);
}

.tmdb-year {
    font-weight: 400;
    color: var(--text-secondary);
    font-size: 1.125rem;
}

.tmdb-title-text {
    font-weight: inherit;
    color: inherit;
}

.tmdb-title-sep {
    color: var(--text-secondary);
    font-weight: 400;
}

.tmdb-title:has(.tmdb-title-text) {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    column-gap: 0;
    row-gap: 0.2rem;
}

.tmdb-title-link + .tmdb-year {
    margin-left: 0.35rem;
}

/* Match title text color (not global link blue); h3 is 500 — keep secondary line normal weight. */
.tmdb-title .tmdb-year {
    font-weight: 400;
}

.tmdb-plot {
    margin: 0 0 0.75rem;
    font-size: 0.94rem;
    line-height: 1.55;
    color: var(--tmdb-muted);
}

.tmdb-entity-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    border-block: 1px solid var(--tmdb-edge);
}

.tmdb-entity-fact {
    min-width: 0;
    padding: 0.55rem 0.65rem;
}

.tmdb-entity-fact:nth-child(odd) {
    border-inline-end: 1px solid var(--tmdb-edge);
}

.tmdb-entity-fact:nth-child(n + 3) {
    border-block-start: 1px solid var(--tmdb-edge);
}

.tmdb-entity-fact dt {
    overflow: hidden;
    margin: 0 0 0.12rem;
    color: var(--text-secondary);
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tmdb-entity-fact dd {
    overflow: hidden;
    margin: 0;
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 500;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@container tmdb-result (min-width: 760px) {
    .tmdb-entity-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tmdb-entity-fact:nth-child(n) {
        border-block-start: 0;
        border-inline-end: 1px solid var(--tmdb-edge);
    }

    .tmdb-entity-fact:last-child {
        border-inline-end: 0;
    }
}

/*
 * TMDB strings are overwhelmingly Latin/LTR. On `dir=rtl` pages, without isolation the
 * Unicode bidirectional algorithm can place sentence-final punctuation on the wrong side.
 */
.tmdb-plot,
.tmdb-season-overview,
.tmdb-episode-overview {
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}

/* ── Clickable title (opens the available-service chooser) ───────────────── */

.tmdb-result .tmdb-panel .tmdb-title-link {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    text-align: start;
    text-decoration: none;
    cursor: pointer;
}

.tmdb-result .tmdb-panel .tmdb-title-link .tmdb-title-text {
    color: var(--text-primary);
}

.tmdb-result .tmdb-panel .tmdb-title-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tmdb-result .tmdb-panel .tmdb-title-link:focus-visible {
    color: var(--text-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 4px;
}

.tmdb-title-picker-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    color: var(--text-secondary);
    transition:
        color 0.15s ease,
        transform 0.15s ease;
}

.tmdb-title-link:hover .tmdb-title-picker-icon,
.tmdb-title-link:focus-visible .tmdb-title-picker-icon {
    color: var(--primary, #1a73e8);
    transform: translateX(2px);
}

/* ── Panel header (used above person panel) ──────────────────────────────── */

.tmdb-panel-header {
    margin: 0 0 0.75rem;
}

.tmdb-panel-header .tmdb-title {
    margin: 0;
}

/* ── Back button (injected client-side by script.js) ─────────────────────── */

.tmdb-back-btn {
    all: unset;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    cursor: pointer;
    margin: 0 0 0.75rem;
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid var(--tmdb-edge);
    border-radius: 999px;
    transition:
        background 0.15s,
        border-color 0.15s,
        transform 0.1s;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tmdb-back-btn:hover,
.tmdb-back-btn:focus-visible {
    background: var(--tmdb-hover);
    border-color: var(--tmdb-focus);
}

.tmdb-back-btn:active {
    transform: translateX(-1px);
}

.tmdb-back-btn:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

/* ── Loading state while navigating ──────────────────────────────────────── */

.tmdb-result.tmdb-loading {
    position: relative;
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.15s;
}

.tmdb-result.tmdb-loading::after {
    content: "";
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary, #1a73e8);
    border-radius: 50%;
    animation: tmdb-spin 0.8s linear infinite;
}

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

/* ── Metadata grid (weather-style divider grid) ───────────────────────────── */

.tmdb-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1px;
    background: var(--tmdb-edge);
    border: 1px solid var(--tmdb-edge);
    border-radius: var(--tmdb-radius);
    overflow: hidden;
    margin-bottom: 14px;
}

.tmdb-meta-cell {
    background: var(--tmdb-surface-soft);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.tmdb-meta-label {
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.tmdb-meta-value {
    font-size: 0.94rem;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.35;
}

/* ── Cast: horizontal strip + hover carousel arrows (no scrollbar) ───────── */

.tmdb-cast-carousel {
    position: relative;
    min-width: 0;
}

.tmdb-cast-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 0.5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-width: 0;
}

.tmdb-cast-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.tmdb-cast-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--tmdb-edge);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg, Canvas) 92%, transparent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.tmdb-cast-nav-icon {
    display: block;
    margin-top: -1px;
}

.tmdb-cast-nav--prev {
    left: 0.15rem;
}

.tmdb-cast-nav--next {
    right: 0.15rem;
}

.tmdb-cast-carousel:hover .tmdb-cast-nav:not(:disabled),
.tmdb-cast-carousel:focus-within .tmdb-cast-nav:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

/* Touch / stylus: no hover — keep arrows usable without relying on :hover */
@media (hover: none) {
    .tmdb-cast-carousel .tmdb-cast-nav:not(:disabled) {
        opacity: 1;
        pointer-events: auto;
    }
}

.tmdb-cast-nav:hover,
.tmdb-cast-nav:focus-visible {
    border-color: var(--tmdb-focus);
    color: var(--text-primary);
    background: var(--tmdb-hover);
    outline: none;
}

.tmdb-cast-nav:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

.tmdb-cast-nav:disabled {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none !important;
}

.tmdb-cast-strip {
    display: flex;
    gap: 0.65rem;
    width: max-content;
    padding: 0 0.25rem 0 0;
}

.tmdb-cast-card {
    flex: 0 0 auto;
    width: 7rem;
    background: var(--tmdb-surface-soft);
    border-radius: var(--tmdb-radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid var(--tmdb-edge);
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

/* Clickable cast cards navigate to the person's slot (see script.js). */
.tmdb-cast-card--clickable {
    cursor: pointer;
    user-select: none;
}

.tmdb-cast-card--clickable:hover,
.tmdb-cast-card--clickable:focus-visible {
    transform: translateY(-2px);
    border-color: var(--primary, #1a73e8);
    background: var(--tmdb-hover);
}

.tmdb-cast-card--clickable:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

.tmdb-cast-card--clickable:active {
    transform: translateY(0);
}

.tmdb-cast-photo-wrap {
    width: 100%;
    /* Taller than square: extra card height goes to the headshot, not the name block */
    aspect-ratio: 4 / 5;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 13px 13px 0 0;
    box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.tmdb-cast-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tmdb-cast-initial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.65rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tmdb-cast-name {
    padding: 0.48rem 0.42rem 0.12rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-primary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.tmdb-cast-char {
    padding: 0 0.42rem 0.48rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* ── Filmography scroll strip ─────────────────────────────────────────────── */

.tmdb-filmography-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 0.25rem 0 0.75rem;
    margin-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.tmdb-filmography-scroll::-webkit-scrollbar {
    height: 8px;
}

.tmdb-filmography-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.tmdb-filmography-scroll::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 999px;
}

.tmdb-filmography-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

.tmdb-filmography-strip {
    display: flex;
    gap: 0.65rem;
    width: max-content;
}

.tmdb-film-card {
    flex: 0 0 auto;
    width: 6.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.15s ease;
}

.tmdb-film-card:hover {
    transform: scale(1.03);
}

.tmdb-film-poster {
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-light);
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tmdb-film-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tmdb-film-placeholder {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tmdb-film-title {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
    padding: 0 0.2rem;
}

.tmdb-film-year {
    font-size: 0.67rem;
    color: var(--text-secondary);
    margin-top: 0.1rem;
    text-align: center;
}

/* ── Section heading ──────────────────────────────────────────────────────── */

.tmdb-section-heading {
    margin: 0.75rem 0 0.4rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ── Accordion (seasons, cast) ────────────────────────────────────────────── */

.tmdb-accordion {
    margin-bottom: 0.4rem;
}

.tmdb-accordion-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.tmdb-accordion-summary::-webkit-details-marker {
    display: none;
}

.tmdb-accordion-summary::before {
    content: "\25B6";
    font-size: 0.55rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.tmdb-accordion[open] > .tmdb-accordion-summary::before {
    transform: rotate(90deg);
}

.tmdb-accordion-meta {
    margin-left: auto;
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
}

.tmdb-accordion-body {
    padding: 0 0 0.5rem 0.4rem;
}

/* ── Episode list (lazy-loaded inside a season accordion) ────────────────── */

.tmdb-episodes {
    margin-top: 0.75rem;
}

.tmdb-episodes:empty {
    margin-top: 0;
}

.tmdb-episodes-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--tmdb-edge);
    max-height: min(280px, 42vh);
    overflow-y: auto;
    overflow-x: hidden;
    margin-inline-end: -0.6rem;
    padding-inline-end: 0.5rem;
    scrollbar-color: var(--tmdb-edge) transparent;
    scrollbar-width: thin;
}

/* Cards must keep natural height; flex-shrink was collapsing rows + clipping stills/copy. */
.tmdb-episodes-list > .tmdb-episode {
    flex-shrink: 0;
}

.tmdb-episode {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-block: 0;
    padding-inline-start: 0;
    padding-inline-end: 0.55rem;
    border-radius: var(--tmdb-radius);
    background: var(--tmdb-surface-soft);
    border: 1px solid var(--tmdb-edge);
    color: inherit;
    overflow: hidden;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.1s ease;
}

/* Grid: row height = max(thumb, copy). Stretch thumb so the still fills the cell (cover)
   when copy is taller — no dead band below a short still. */
.tmdb-episode-flow {
    display: grid;
    grid-template-columns: var(--tmdb-episode-thumb-w) minmax(0, 1fr);
    column-gap: 0.65rem;
    align-items: stretch;
    min-width: 0;
    padding-top: 0;
    --tmdb-episode-thumb-w: 118px;
}

.tmdb-episode-thumb {
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    max-width: var(--tmdb-episode-thumb-w);
    margin: 0;
    border-start-start-radius: 12px;
    border-end-start-radius: 12px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
    overflow: hidden;
    background: color-mix(in srgb, var(--tmdb-edge) 28%, var(--bg-light));
    align-self: stretch;
    display: flex;
    flex-direction: column;
    min-height: calc(var(--tmdb-episode-thumb-w) * 9 / 16);
}

.tmdb-episode-copy {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding-inline-end: 0.35rem;
}

.tmdb-episode-head {
    display: block;
    margin: 0;
    min-width: 0;
}

.tmdb-episode-thumb--link,
.tmdb-episode-head--link {
    color: inherit;
    text-decoration: none;
}

.tmdb-episode-thumb--link {
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.tmdb-episode-head--link:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
    border-radius: 6px;
}

.tmdb-episode-thumb--link:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
    border-start-start-radius: 12px;
    border-end-start-radius: 12px;
    border-start-end-radius: 0;
    border-end-end-radius: 0;
}

.tmdb-episode--clickable {
    cursor: default;
}

.tmdb-episode--clickable:hover,
.tmdb-episode--clickable:focus-within {
    border-color: var(--tmdb-focus);
    background: var(--tmdb-hover);
}

.tmdb-episode-head--link:active {
    transform: translateY(1px);
}

.tmdb-episode--clickable .tmdb-episode-head--link:hover .tmdb-episode-title,
.tmdb-episode--clickable
    .tmdb-episode-head--link:focus-visible
    .tmdb-episode-title {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.tmdb-episode-still {
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.tmdb-episode-still--empty {
    flex: 1 1 auto;
    width: 100%;
    min-height: calc(var(--tmdb-episode-thumb-w) * 9 / 16);
    opacity: 0.25;
}

.tmdb-episode-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.tmdb-episode-num {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tmdb-episode-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.tmdb-episode-meta {
    font-size: 0.72rem;
    color: var(--text-secondary);
}

.tmdb-episode-header + .tmdb-episode-meta {
    margin-top: 0.25rem;
}

/* ~2 lines; full copy available on TMDB via existing episode links.
   min-height: WebKit often contributes ~0 intrinsic height for -webkit-box + clamp,
   which collapsed the grid row and clipped the still + meta. */
.tmdb-episode-overview {
    margin: 0;
    padding-top: 0.1rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    min-height: calc(1.45em * 2);
}

.tmdb-episodes-loading,
.tmdb-episodes-error,
.tmdb-episodes-empty {
    padding: 0.75rem;
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--tmdb-edge);
}

.tmdb-episodes-error {
    color: var(--danger, #d33);
}

/* Stack episode cards only on very narrow viewports — not when the slot alone is narrow.
   Otherwise default themes keep a ~480px slot but LiterallyGoogle reads “wide”; episode rows
   must stay thumb | copy inside the rail. */
@media (max-width: 420px) {
    .tmdb-episode {
        padding-inline-start: 0.45rem;
    }

    .tmdb-episode-flow {
        grid-template-columns: 1fr;
        row-gap: 0.45rem;
    }

    .tmdb-episode-thumb {
        grid-column: 1;
        grid-row: 1;
        max-width: 100%;
        border-radius: 12px;
    }

    .tmdb-episode-copy {
        grid-column: 1;
        grid-row: 2;
        padding-inline-end: 0;
    }
}

/* ── Season detail row ────────────────────────────────────────────────────── */

.tmdb-season-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
}

.tmdb-season-poster {
    flex-shrink: 0;
    width: 52px;
    border-radius: 8px;
    display: block;
}

.tmdb-season-info {
    flex: 1;
    min-width: 0;
}

.tmdb-season-overview {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    max-height: calc(1.45em * 3 + 0.25em);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

/* ── Tabs ─────────────────────────────────────────────────────────────────── */

.tmdb-tabs {
    position: relative;
}

.tmdb-tab-bar {
    display: flex;
    gap: 0.15rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
    border-bottom: 1px solid var(--tmdb-edge);
}

.tmdb-tab-bar::-webkit-scrollbar {
    display: none;
}

.tmdb-tab-btn {
    all: unset;
    cursor: pointer;
    flex: 0 0 auto;
    padding: 0.45rem 0.9rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    margin-bottom: -1px;
    transition:
        color 0.15s,
        border-color 0.15s;
}

.tmdb-tab-btn:hover {
    color: var(--text-primary);
}

.tmdb-tab-btn--active {
    color: var(--text-primary);
    border-bottom-color: var(--primary, #1a73e8);
}

/* ── Jellyfin card ────────────────────────────────────────────────────────── */

.tmdb-jf-wrap {
    margin-top: 0.75rem;
}

.tmdb-jf-card--compact {
    flex-shrink: 0;
    align-self: flex-start;
    padding: 0.2rem 0.55rem 0.2rem 0.45rem;
    gap: 0.35rem;
    border-radius: 999px;
    max-width: none;
}

.tmdb-jf-card--compact.tmdb-jf-card--icon-only {
    padding: 0.38rem;
    gap: 0;
    border-radius: 10px;
    margin-left: auto;
}

.tmdb-jf-card--compact.tmdb-jf-card--icon-only .tmdb-jf-logo {
    width: 24px;
    height: 24px;
    display: block;
}

.tmdb-jf-card--compact .tmdb-jf-logo {
    width: 18px;
    height: 18px;
}

.tmdb-jf-card--compact .tmdb-jf-btn {
    margin-left: 0;
    border: none;
    padding: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #1a73e8);
    white-space: nowrap;
}

.tmdb-jf-card {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    transition:
        border-color 0.15s,
        background 0.15s;
    max-width: 100%;
}

.tmdb-jf-card:hover {
    border-color: var(--primary, #1a73e8);
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.tmdb-jf-logo {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    object-fit: contain;
}

.tmdb-jf-title {
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.tmdb-jf-btn {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary, #1a73e8);
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--primary, #1a73e8);
    border-radius: 4px;
    white-space: nowrap;
}

/* ── Image Modal ──────────────────────────────────────────────────────────── */

.tmdb-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease;
}

.tmdb-modal-overlay.tmdb-modal--visible {
    opacity: 1;
    visibility: visible;
}

.tmdb-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    transition:
        background 0.15s ease,
        border-color 0.15s ease;
    z-index: 10001;
}

.tmdb-modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.4);
}

.tmdb-modal-close:focus {
    outline: 2px solid var(--primary, #4285f4);
    outline-offset: 2px;
}

.tmdb-modal-img {
    max-width: 100%;
    max-height: calc(100vh - 4rem);
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.tmdb-modal-overlay.tmdb-modal--visible .tmdb-modal-img {
    transform: scale(1);
}

/* ── Service chooser modal ───────────────────────────────────────────────── */

.tmdb-service-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(32, 33, 36, 0.52);
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.16s ease,
        visibility 0.16s ease;
}

.tmdb-service-modal-overlay.tmdb-service-modal--visible {
    opacity: 1;
    visibility: visible;
}

.tmdb-service-modal {
    position: relative;
    width: min(100%, 360px);
    padding: 1.25rem;
    border: 1px solid var(--border-light, #dadce0);
    border-radius: 24px;
    background: var(--bg, #fff);
    color: var(--text-primary, #202124);
    box-shadow:
        0 8px 24px rgba(60, 64, 67, 0.2),
        0 2px 6px rgba(60, 64, 67, 0.12);
    transform: translateY(8px) scale(0.98);
    transition: transform 0.16s ease;
}

.tmdb-service-modal--visible .tmdb-service-modal {
    transform: translateY(0) scale(1);
}

.tmdb-service-modal-heading {
    padding-right: 2.5rem;
}

.tmdb-service-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
}

.tmdb-service-modal-subtitle {
    margin: 0.25rem 0 1rem;
    color: var(--text-secondary, #5f6368);
    font-size: 0.9rem;
    line-height: 1.4;
}

.tmdb-service-modal-close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary, #5f6368);
    font: inherit;
    font-size: 1.4rem;
    cursor: pointer;
}

.tmdb-service-modal-close:hover {
    background: var(--bg-hover, #f1f3f4);
}

.tmdb-service-modal-close:focus-visible,
.tmdb-service-option:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

.tmdb-service-modal-list {
    display: grid;
    gap: 0.5rem;
}

.tmdb-service-option {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--border-light, #dadce0);
    border-radius: 999px;
    background: var(--bg-light, #f8f9fa);
    color: var(--text-primary, #202124);
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(60, 64, 67, 0.08);
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.tmdb-service-option:hover {
    border-color: color-mix(in srgb, var(--primary, #1a73e8) 44%, var(--border-light, #dadce0));
    background: color-mix(in srgb, var(--primary, #1a73e8) 6%, var(--bg, #fff));
    box-shadow: 0 2px 6px rgba(60, 64, 67, 0.14);
    transform: translateY(-1px);
}

.tmdb-service-option-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg, #fff);
    color: var(--primary, #1a73e8);
    font-weight: 700;
}

.tmdb-service-option-icon img {
    width: 24px;
    height: 24px;
    display: block;
    object-fit: contain;
}

.tmdb-service-option-label {
    min-width: 0;
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.tmdb-service-option-arrow {
    color: var(--text-secondary, #5f6368);
    font-size: 1rem;
}

/* ── Wide-container progressive enhancements ──────────────────────────────── */
/* These override earlier base rules when the inline container is wide enough.
   Placed at the end so they always win in the cascade. */

@container (min-width: 900px) {
    /* Redistribute overview: give info block more room (40/60 split) */
    .tmdb-overview {
        grid-template-columns: 2fr 3fr;
        gap: 1.25rem;
    }
    .tmdb-overview .tmdb-person-grid {
        grid-column: 1;
        height: 360px;
    }
    .tmdb-person-info,
    .tmdb-info-block {
        grid-column: 2;
    }

    /* Scale up typography */
    .tmdb-title {
        font-size: 1.4rem;
    }

    /* Larger cast cards */
    .tmdb-cast-card {
        width: 7.75rem;
    }

    /* Wider episode still column */
    .tmdb-episode-flow {
        --tmdb-episode-thumb-w: 160px;
    }
}

/* Very wide containers (≥1100px): maximize the info section. */
@container (min-width: 1100px) {
    .tmdb-overview {
        grid-template-columns: 1fr 2fr;
        gap: 1.5rem;
    }
    .tmdb-overview .tmdb-person-grid {
        height: 400px;
    }
    .tmdb-title {
        font-size: 1.6rem;
    }
    .tmdb-cast-card {
        width: 8.5rem;
    }
    .tmdb-episode-flow {
        --tmdb-episode-thumb-w: 180px;
    }
}

/* ── New Google-style hero layout (movies & TV shows) ──────────────────────── */

/* Header: title row (title + optional Jellyfin), then subtitle */
.tmdb-header {
    margin-bottom: 0.75rem;
}

.tmdb-header-primary {
    min-width: 0;
}

.tmdb-header-title-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.5rem;
    width: 100%;
}

.tmdb-header-title-row .tmdb-title-link {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.tmdb-header-title-row .tmdb-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tmdb-header .tmdb-title {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
    line-height: 1.25;
}

.tmdb-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.tmdb-header-primary > .tmdb-subtitle {
    margin-top: 0.35rem;
}

/* Hero: stacked by default; movies with a trailer use a two-column band on wide containers. */
.tmdb-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
    min-width: 0;
}

/* Hero media: the image combo fills the hero column */
.tmdb-hero-media {
    min-width: 0;
    width: 100%;
}

.tmdb-hero-side {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0;
    min-height: 0;
}

.tmdb-hero-trailer {
    min-width: 0;
    flex-shrink: 0;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-side {
    gap: 0.45rem;
    min-height: 0;
    overflow: hidden;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-trailer {
    width: 100%;
    max-width: 100%;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-info {
    flex: 0 0 auto;
    gap: 0.45rem;
    min-height: 0;
}

.tmdb-hero.tmdb-hero--movie-with-trailer {
    container-type: inline-size;
    container-name: tmdb-movie-hero;
    margin-bottom: 0.65rem;
}

.tmdb-hero--movie-with-trailer + .tmdb-section {
    margin-top: 0;
}

.tmdb-hero-media .tmdb-img-combo {
    height: 280px;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: unset;
    min-height: 260px;
}

/* Movie hero poster-only: frame wraps image (overrides fixed 280px on .tmdb-hero-media .tmdb-img-combo). */
.tmdb-hero--movie .tmdb-hero-media .tmdb-img-combo.tmdb-img-combo--single {
    height: auto;
    min-height: 0;
    max-height: none;
    background: var(--bg-light);
}

/* Movie + trailer: side column stacks trailer + copy; poster column height is intrinsic. */
.tmdb-hero--movie-with-trailer .tmdb-hero-media {
    display: flex;
    min-height: 0;
}

.tmdb-hero--movie-with-trailer .tmdb-hero-media .tmdb-img-combo {
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    aspect-ratio: unset;
}

/* Single poster: don't stretch to trailer column — combo hugs intrinsic poster height */
.tmdb-hero--movie-with-trailer
    .tmdb-hero-media
    .tmdb-img-combo.tmdb-img-combo--single {
    flex: 0 0 auto;
    align-self: flex-start;
    height: auto;
    min-height: 0;
}

/* Hero info: optional “Created by”, then ratings, then overview (director stays in `.tmdb-subtitle` on movies). */
.tmdb-hero-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    min-width: 0;
}

.tmdb-created-by {
    font-size: 0.9rem;
    color: var(--tmdb-muted);
    line-height: 1.4;
    margin: 0;
}

.tmdb-trailer {
    width: 100%;
    border: 1px solid var(--tmdb-edge);
    border-radius: 10px;
    overflow: hidden;
    background: var(--tmdb-surface-soft);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.tmdb-trailer-frame {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    flex: 1 1 auto;
    min-height: 0;
}

/* Stacked hero (non-wide containers): keep trailer as a normal 16:9 block.
   The side-by-side "fill available height" mode above can collapse/hide it when
   the side column is content-driven instead of height-capped by the row layout. */
@container tmdb-movie-hero (max-width: 719px) {
    .tmdb-hero--movie-with-trailer .tmdb-hero-side {
        overflow: visible;
    }

    .tmdb-hero--movie-with-trailer .tmdb-hero-trailer {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
        align-self: stretch;
        margin-inline: 0;
        overflow: visible;
    }

    .tmdb-hero--movie-with-trailer .tmdb-trailer {
        height: auto;
    }

    .tmdb-hero--movie-with-trailer .tmdb-trailer-frame {
        aspect-ratio: 16 / 9;
        height: auto;
        width: 100%;
    }
}

/* Ratings display */
.tmdb-ratings {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.tmdb-rating-item {
    --tmdb-rating-accent: var(--primary, #1a73e8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.32rem;
    min-height: 32px;
    box-sizing: border-box;
    background: color-mix(
        in srgb,
        var(--tmdb-rating-accent) 5%,
        var(--tmdb-surface-soft)
    );
    border: 1px solid color-mix(
        in srgb,
        var(--tmdb-rating-accent) 26%,
        var(--tmdb-edge)
    );
    border-radius: 999px;
    padding: 0 0.62rem;
    white-space: nowrap;
    box-shadow: none;
}

.tmdb-rating-logo,
.tmdb-rating-jf-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: block;
    object-fit: contain;
}

.tmdb-rating-logo-fallback {
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tmdb-rating-accent);
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1;
}

.tmdb-rating-item--tmdb {
    --tmdb-rating-accent: #01b4e4;
}

.tmdb-rating-item--imdb {
    --tmdb-rating-accent: #f5c518;
}

.tmdb-rating-item--rt {
    --tmdb-rating-accent: #fa320a;
    gap: 0.38rem;
}

.tmdb-rating-item--letterboxd {
    --tmdb-rating-accent: #00e054;
    padding-inline: 0.5rem;
}

.tmdb-rating-item--jellyfin {
    --tmdb-rating-accent: #00a4dc;
    padding-inline: 0.5rem;
}

.tmdb-rating-item--seerr {
    --tmdb-rating-accent: #6366f1;
}

.tmdb-rating-segment {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}

.tmdb-rating-divider {
    width: 1px;
    height: 16px;
    flex: 0 0 1px;
    background: var(--tmdb-edge);
}

.tmdb-rating-audience-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ff8200;
}

.tmdb-rating-audience-icon svg {
    display: block;
}

.tmdb-rating-seerr-status {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-primary);
}

.tmdb-rating-score {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

.tmdb-rating-unit {
    margin-left: -0.18rem;
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1;
}

.tmdb-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;
}

.tmdb-rating-item--link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.tmdb-rating-item--link:hover,
.tmdb-rating-item--link:focus-visible {
    border-color: var(--tmdb-rating-accent);
    background: color-mix(in srgb, var(--tmdb-rating-accent) 7%, var(--bg, #fff));
    box-shadow: 0 2px 5px rgba(60, 64, 67, 0.14);
    transform: translateY(-1px);
}

.tmdb-rating-item--link:focus-visible {
    outline: 2px solid var(--tmdb-rating-accent);
    outline-offset: 2px;
}

.tmdb-rating-external {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-link, var(--primary, #1a73e8));
}

/* Director / Creator credit */
.tmdb-hero-director {
    font-size: 0.88rem;
    color: var(--tmdb-muted);
    line-height: 1.4;
}

.tmdb-hero-director-label {
    font-weight: 400;
    color: var(--text-secondary);
}

/* Cast section heading */
.tmdb-section {
    margin-bottom: 1rem;
    min-width: 0;
}

.tmdb-section--cast {
    margin-bottom: 0;
}

.tmdb-cast-panel {
    border: 1px solid var(--tmdb-edge);
    border-radius: 16px;
    background: var(--tmdb-surface-soft);
    padding: 0.75rem 0.85rem 0.55rem;
    min-width: 0;
    box-sizing: border-box;
}

.tmdb-cast-panel .tmdb-section-heading {
    margin-bottom: 0.55rem;
    padding: 0 0.1rem;
}

.tmdb-cast-panel .tmdb-cast-scroll {
    padding: 0.1rem 0 0;
}

.tmdb-panel > .tmdb-section--cast:last-child,
.tmdb-tv-body > .tmdb-section--cast:last-child,
.tmdb-tv-main > .tmdb-section--cast:last-child {
    margin-bottom: 0;
}

.tmdb-panel > .tmdb-section--cast:last-child,
.tmdb-tv-body > .tmdb-section--cast:last-child {
    padding-bottom: 0;
}

.tmdb-panel:has(> .tmdb-section--cast:last-child),
.tmdb-tv-body:has(> .tmdb-section--cast:last-child) {
    padding-bottom: 0;
}

.tmdb-result:has(.tmdb-section--cast:last-child) {
    padding-bottom: 0.5rem;
}

.tmdb-section-heading {
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* English labels + “N people”; RTL page `dir` must not reorder digits vs word or flex items. */
    direction: ltr;
    unicode-bidi: isolate;
    text-align: start;
}

.tmdb-section-count {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    white-space: nowrap;
}

/* Movies with trailer: poster column | trailer + copy.
   Gate on BOTH viewport and the slot inline size (`.tmdb-result` container).
   Viewport-only `@media` was forcing this layout while the above-results slot
   stayed narrow, stretching collage / cast / episodes past the panel in themes
   without LiterallyGoogle’s full-width slot shell. */
@media (min-width: 640px) {
    @container (min-width: 720px) {
        .tmdb-hero--movie-with-trailer {
            grid-template-columns: minmax(220px, min(40%, 340px)) minmax(0, 1fr);
            align-items: stretch;
            column-gap: 1rem;
        }

        /* Avoid forcing a tall poster column when the still is shorter than the trailer rail */
        .tmdb-hero--movie-with-trailer .tmdb-hero-media {
            min-height: 0;
        }

        /* Side column must not exceed the poster height — overflow hidden clips the rest */
        .tmdb-hero--movie-with-trailer .tmdb-hero-side {
            align-self: stretch;
            overflow: hidden;
        }

        /* Two-column mode only: let trailer fill the capped side column height. */
        .tmdb-hero--movie-with-trailer .tmdb-trailer {
            height: 100%;
        }

        .tmdb-hero--movie-with-trailer .tmdb-trailer-frame {
            aspect-ratio: unset;
            height: 100%;
            width: 100%;
        }
    }
}

/* TV + movie-without-trailer: taller stacked collage on wide containers. */
@container (min-width: 720px) {
    .tmdb-panel--tv .tmdb-hero-media .tmdb-img-combo,
    .tmdb-hero--movie:not(.tmdb-hero--movie-with-trailer)
        .tmdb-hero-media
        .tmdb-img-combo {
        height: 400px;
        min-height: 320px;
    }

    .tmdb-header .tmdb-title {
        font-size: 1.65rem;
    }
}

@container (min-width: 900px) {
    .tmdb-panel--tv .tmdb-hero-media .tmdb-img-combo,
    .tmdb-hero--movie:not(.tmdb-hero--movie-with-trailer)
        .tmdb-hero-media
        .tmdb-img-combo {
        height: 488px;
        min-height: 400px;
    }

    .tmdb-header .tmdb-title {
        font-size: 1.85rem;
    }
}

@container (min-width: 1100px) {
    .tmdb-panel--tv .tmdb-hero-media .tmdb-img-combo,
    .tmdb-hero--movie:not(.tmdb-hero--movie-with-trailer)
        .tmdb-hero-media
        .tmdb-img-combo {
        height: 568px;
        min-height: 440px;
    }
}
/* TV body: column wrapper when an episode rail exists (band + cast below).
   Wide containers: `.tmdb-tv-band--with-head` is a grid (title row, then hero | episodes rail). */
.tmdb-tv-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
    min-width: 0;
    max-width: 100%;
}

.tmdb-tv-band {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
    min-width: 0;
}

.tmdb-tv-band-head {
    min-width: 0;
}

/* Title sits in the band so wide layouts can align the episodes rail with the title row. */
.tmdb-tv-band--with-head > .tmdb-tv-band-head .tmdb-header {
    margin-bottom: 0.5rem;
}

/* Main column must not flex-grow and steal vertical space from siblings in stretched panels. */
.tmdb-tv-main {
    flex: 0 1 auto;
    min-width: 0;
}

/* Wide panel + episode rail: title spans full width; hero left / rail right; rail spans both
   rows so its top lines up with the title (no dead space above the episode box). */
@container tmdb-result (min-width: 560px) {
    .tmdb-panel--tv .tmdb-tv-band--with-head {
        display: grid;
        /* Slightly wider rail column so episodes block aligns closer to the panel edge. */
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
        grid-template-rows: auto minmax(0, 1fr);
        row-gap: 0;
        column-gap: 1.75rem;
        align-items: stretch;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-band-head {
        grid-column: 1 / -1;
        grid-row: 1;
        min-width: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-main {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail {
        grid-column: 2;
        grid-row: 1 / span 2;
        /* Fill the grid track: a fixed max-width left empty space to the right of the rail
           (misaligned vs cast / full-width content below). Column width is already capped by fr. */
        min-width: min(100%, 240px);
        max-width: none;
        width: 100%;
        justify-self: stretch;
        position: relative;
        box-sizing: border-box;
        min-height: 0;
        height: auto;
        max-height: none;
        overflow: hidden;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-seasons-rail,
    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-season-detail,
    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes {
        overflow: hidden;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes-list {
        max-height: none;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-seasons-rail {
        flex: 1 1 0;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-season-detail {
        flex: 1 1 0;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes {
        flex: 1 1 0;
        min-height: 0;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail .tmdb-episodes-list {
        flex: 1 1 0;
        min-height: 0;
    }
}

@container tmdb-result (min-width: 900px) {
    .tmdb-result
        .tmdb-tv-body {
        gap: 1.75rem;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head {
        column-gap: 2.25rem;
    }

    .tmdb-panel--tv .tmdb-tv-band--with-head .tmdb-tv-rail {
        max-width: none;
    }
}

/* Narrow slot: tighten gaps; when a rail exists, keep hero → cast → episodes reading order. */
@container tmdb-result (max-width: 559px) {
    .tmdb-tv-body:has(.tmdb-tv-band) {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-band {
        display: contents;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-band-head {
        grid-row: 1;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-main {
        grid-row: 2;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) > .tmdb-section {
        grid-row: 3;
    }

    .tmdb-tv-body:has(.tmdb-tv-band) .tmdb-tv-rail {
        grid-row: 4;
    }

    .tmdb-tv-body:not(:has(.tmdb-tv-band)) {
        gap: 0.55rem;
    }

    .tmdb-panel--tv .tmdb-hero {
        margin-bottom: 0.65rem;
    }

    .tmdb-tv-main .tmdb-section:last-child,
    .tmdb-tv-body > .tmdb-section:last-child {
        margin-bottom: 0;
    }
}

.tmdb-tv-rail {
    border: 1px solid var(--tmdb-edge);
    border-radius: 12px;
    background: var(--tmdb-surface-soft);
    padding: 0.5rem 0.6rem;
    display: flex;
    flex-direction: column;
    min-width: 0;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    min-height: 0;
}

.tmdb-seasons-rail {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    /* Stacked layout: grow from content (flex-1 + min-height:0 collapses when parent height is auto). */
    flex: 0 1 auto;
    min-height: auto;
}

.tmdb-seasons-carousel {
    position: relative;
    flex-shrink: 0;
}

.tmdb-seasons-scroll {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
    padding: 0.2rem 0 0;
    border-bottom: 1px solid var(--tmdb-edge);
    box-sizing: border-box;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tmdb-seasons-scroll::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.tmdb-season-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 1.85rem;
    height: 1.85rem;
    padding: 0;
    margin: 0;
    border: 1px solid var(--tmdb-edge);
    border-radius: 999px;
    background: color-mix(in srgb, var(--bg, Canvas) 90%, transparent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.tmdb-season-nav-icon {
    display: block;
    margin-top: -1px;
}

.tmdb-season-nav--prev {
    left: 0.15rem;
}

.tmdb-season-nav--next {
    right: 0.15rem;
}

.tmdb-seasons-carousel:hover .tmdb-season-nav:not(:disabled),
.tmdb-seasons-carousel:focus-within .tmdb-season-nav:not(:disabled) {
    opacity: 1;
    pointer-events: auto;
}

@media (hover: none) {
    .tmdb-seasons-carousel .tmdb-season-nav:not(:disabled) {
        opacity: 1;
        pointer-events: auto;
    }
}

.tmdb-season-nav:hover,
.tmdb-season-nav:focus-visible {
    border-color: var(--primary, #1a73e8);
    color: var(--text-primary);
    background: color-mix(in srgb, var(--bg-light, var(--bg)) 95%, transparent);
    outline: none;
}

.tmdb-season-nav:focus-visible {
    outline: 2px solid var(--primary, #1a73e8);
    outline-offset: 2px;
}

.tmdb-season-nav:disabled {
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none !important;
}

.tmdb-seasons-strip {
    display: flex;
    align-items: flex-end;
    gap: 0.15rem;
    width: max-content;
    padding: 0 0.25rem 0 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-sizing: border-box;
}

.tmdb-season-tab {
    appearance: none;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.42rem 0.72rem 0.52rem;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    white-space: nowrap;
    flex: 0 0 auto;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition:
        color 0.15s ease,
        border-color 0.15s ease;
}

.tmdb-season-tab:hover,
.tmdb-season-tab:focus-visible {
    outline: none;
    background: transparent;
}

.tmdb-season-tab:focus-visible {
    box-shadow: none;
}

.tmdb-season-tab:focus-visible .tmdb-season-tab-label {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.tmdb-season-tab.is-active {
    border-bottom-color: var(--primary, #1a73e8);
    background: transparent;
}

.tmdb-season-tab:not(.is-active) .tmdb-season-tab-label {
    color: var(--text-secondary);
}

.tmdb-season-tab.is-active .tmdb-season-tab-label {
    color: var(--text-primary);
}

.tmdb-season-tab-label {
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.2;
}

.tmdb-season-detail {
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    min-width: 0;
    min-height: auto;
}

.tmdb-season-facts {
    margin-block: 0 0.5rem;
    margin-inline: 0;
    padding-block: 0 0.45rem;
    padding-inline: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--tmdb-edge);
    /* Inherit document `direction` so the row packs to inline-start in RTL; each segment stays `dir=ltr` for numbers/dates. */
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    flex-direction: row;
    gap: 0.35rem;
    justify-content: start;
}

.tmdb-season-facts__seg {
    unicode-bidi: isolate;
}

.tmdb-season-facts__sep {
    unicode-bidi: isolate;
    color: var(--text-secondary);
    opacity: 0.85;
}

.tmdb-tv-rail .tmdb-season-overview {
    flex-shrink: 0;
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    /* Hard cap so flex never gives the episode block zero height if line-clamp fails */
    max-height: calc(1.45em * 3 + 0.35rem);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.tmdb-season-overview--empty {
    display: none;
}

.tmdb-tv-rail .tmdb-episodes {
    margin-top: 0;
    flex: 0 1 auto;
    min-height: auto;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    align-self: stretch;
    width: 100%;
}

.tmdb-tv-rail .tmdb-episodes-list {
    flex: 0 1 auto;
    min-height: auto;
    width: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    padding-bottom: 0.35rem;
    /* Base .tmdb-episodes-list uses a negative margin for scrollbar gutter; keep rail flush. */
    margin-inline-end: 0;
    padding-inline-end: 0.3rem;
}

/* Episode list: scroll inside a viewport cap on stacked layouts (phones still scroll the page). */
@container (max-width: 559px) {
    .tmdb-tv-rail .tmdb-episodes-list {
        max-height: min(420px, 70vh);
    }
}

@container (min-width: 560px) {
    .tmdb-tv-rail .tmdb-episodes-list {
        max-height: min(520px, 65vh);
    }
}

/* Shared card styling for every theme. */
.tmdb-result .tmdb-img-combo,
.tmdb-result .tmdb-person-grid,
.tmdb-result .tmdb-combo-placeholder,
.tmdb-result .tmdb-trailer,
.tmdb-result .tmdb-trailer-frame,
.tmdb-result .tmdb-tv-rail,
.tmdb-result .tmdb-cast-card,
.tmdb-result .tmdb-episode,
.tmdb-result .tmdb-episode-thumb,
.tmdb-result .tmdb-season-poster,
.tmdb-result .tmdb-film-card,
.tmdb-result .tmdb-film-poster,
.tmdb-result .tmdb-jf-card,
.tmdb-result
    .tmdb-title-link:focus-visible {
    border-radius: 20px !important;
}

.tmdb-result
    .tmdb-trailer
    .tmdb-trailer-frame {
    border-radius: 0 !important;
}

.tmdb-result .tmdb-cast-photo-wrap,
.tmdb-result .tmdb-cast-photo {
    border-radius: 0 !important;
}

.tmdb-result .tmdb-jf-card--compact {
    border-radius: 20px !important;
}

.tmdb-result
    .tmdb-panel
    .tmdb-title-link,
.tmdb-result
    .tmdb-panel
    .tmdb-title-link
    .tmdb-title-text {
    color: var(--text-primary) !important;
}

.tmdb-result
    .tmdb-panel
    .tmdb-title-link:hover,
.tmdb-result
    .tmdb-panel
    .tmdb-title-link:focus-visible {
    color: var(--text-primary) !important;
}

.tmdb-result
    .tmdb-panel
    .tmdb-title-link
    + .tmdb-year {
    margin-left: 0.35rem;
}

/* ── Material person profile ───────────────────────────────────────────────── */

.tmdb-panel--person {
    --tmdb-person-blue: var(--primary, #1a73e8);
    --tmdb-person-surface: var(--bg-light, var(--bg));
    padding: clamp(0.35rem, 1vw, 0.75rem);
}

.tmdb-person-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.tmdb-person-portrait {
    position: relative;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--tmdb-edge);
    border-radius: 16px;
    background:
        linear-gradient(
            145deg,
            color-mix(in srgb, var(--tmdb-person-blue) 9%, transparent),
            transparent 52%
        ),
        var(--tmdb-person-surface);
    box-shadow: 0 1px 3px color-mix(in srgb, #000 14%, transparent);
}

.tmdb-person-portrait-button {
    all: unset;
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    cursor: zoom-in;
}

.tmdb-person-portrait-button:focus-visible {
    outline: 3px solid var(--tmdb-person-blue);
    outline-offset: -3px;
}

.tmdb-person-portrait-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 18%;
    transition:
        transform 220ms ease,
        filter 220ms ease;
}

.tmdb-person-portrait-button:hover .tmdb-person-portrait-img,
.tmdb-person-portrait-button:focus-visible .tmdb-person-portrait-img {
    transform: scale(1.025);
    filter: saturate(1.04);
}

.tmdb-person-photo-action {
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border: 1px solid color-mix(in srgb, #fff 35%, transparent);
    border-radius: 999px;
    background: color-mix(in srgb, #202124 78%, transparent);
    color: #fff;
    box-shadow: 0 2px 8px color-mix(in srgb, #000 28%, transparent);
    backdrop-filter: blur(8px);
}

.tmdb-person-photo-action svg {
    width: 1.2rem;
    height: 1.2rem;
}

.tmdb-person-portrait-placeholder {
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 5;
    place-items: center;
    background:
        radial-gradient(
            circle at 30% 25%,
            color-mix(in srgb, var(--tmdb-person-blue) 24%, transparent),
            transparent 42%
        ),
        var(--tmdb-person-surface);
    color: var(--tmdb-person-blue);
    font-size: clamp(4rem, 14vw, 8rem);
    font-weight: 500;
}

.tmdb-person-content {
    min-width: 0;
}

.tmdb-person-heading {
    margin: 0 0 0.85rem;
}

.tmdb-person-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: auto;
    margin-bottom: 0.25rem;
    padding: 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.tmdb-panel--person .tmdb-title {
    margin: 0;
    font-size: clamp(1.65rem, 4vw, 2.4rem);
    font-weight: 500;
    line-height: 1.14;
    letter-spacing: -0.025em;
}

.tmdb-panel--person .tmdb-title-link {
    padding: 0.1rem 0;
    border-radius: 8px;
}

.tmdb-panel--person .tmdb-title-picker-icon {
    width: 1.2rem;
    height: 1.2rem;
}

.tmdb-person-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0 0 0.85rem;
    border-block: 1px solid var(--tmdb-edge);
}

.tmdb-person-fact {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.55rem;
    min-height: 3.4rem;
    padding: 0.55rem 0.65rem;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.tmdb-person-fact:nth-child(odd) {
    border-right: 1px solid var(--tmdb-edge);
}

.tmdb-person-fact:nth-child(n + 3) {
    border-top: 1px solid var(--tmdb-edge);
}

.tmdb-person-fact-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 auto;
    color: var(--tmdb-person-blue);
}

.tmdb-person-fact-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.08rem;
}

.tmdb-person-fact-label {
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.055em;
    line-height: 1.2;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.tmdb-person-fact-value {
    display: -webkit-box;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.tmdb-panel--person .tmdb-tab-bar {
    gap: 0.45rem;
    margin: 0 0 0.85rem;
    padding: 0;
    border: 0;
}

.tmdb-panel--person .tmdb-tab-btn {
    padding: 0.45rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
    transition:
        background 150ms ease,
        border-color 150ms ease,
        box-shadow 150ms ease,
        color 150ms ease;
}

.tmdb-panel--person .tmdb-tab-btn:hover,
.tmdb-panel--person .tmdb-tab-btn:focus-visible {
    border-color: color-mix(
        in srgb,
        var(--tmdb-person-blue) 55%,
        var(--tmdb-edge)
    );
    background: color-mix(
        in srgb,
        var(--tmdb-person-blue) 7%,
        transparent
    );
}

.tmdb-panel--person .tmdb-tab-btn:focus-visible {
    outline: 2px solid var(--tmdb-person-blue);
    outline-offset: 2px;
}

.tmdb-panel--person .tmdb-tab-btn--active {
    border-color: transparent;
    background: color-mix(
        in srgb,
        var(--tmdb-person-blue) 14%,
        transparent
    );
    color: var(--tmdb-person-blue);
    box-shadow: none;
}

.tmdb-person-overview-panel {
    display: grid;
    gap: 1.15rem;
}

.tmdb-person-biography,
.tmdb-person-gallery {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.tmdb-person-section-heading {
    margin: 0 0 0.65rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tmdb-person-biography-text {
    margin: 0;
    color: var(--tmdb-muted);
    font-size: 0.91rem;
    line-height: 1.55;
}

.tmdb-person-gallery-strip {
    display: grid;
    grid-auto-columns: minmax(5.25rem, 7rem);
    grid-auto-flow: column;
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0.1rem 0 0.35rem;
    scrollbar-color: var(--border-light) transparent;
    scrollbar-width: thin;
}

.tmdb-person-gallery-item {
    all: unset;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border: 1px solid var(--tmdb-edge);
    border-radius: 16px;
    background: var(--bg);
    cursor: zoom-in;
    box-shadow: 0 1px 3px color-mix(in srgb, #000 10%, transparent);
}

.tmdb-person-gallery-item:focus-visible {
    outline: 3px solid var(--tmdb-person-blue);
    outline-offset: 2px;
}

.tmdb-person-gallery-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.tmdb-person-gallery-item:hover .tmdb-person-gallery-img,
.tmdb-person-gallery-item:focus-visible .tmdb-person-gallery-img {
    transform: scale(1.045);
}

.tmdb-panel--person .tmdb-section-heading {
    margin: 1rem 0 0.55rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.tmdb-panel--person .tmdb-filmography-scroll {
    margin: 0;
    padding: 0.1rem 0 0.8rem;
}

.tmdb-panel--person .tmdb-filmography-strip {
    gap: 0.75rem;
}

.tmdb-panel--person .tmdb-film-card {
    width: 7.5rem;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid var(--tmdb-edge);
    border-radius: 18px;
    background: var(--tmdb-person-surface);
    box-shadow: 0 1px 3px color-mix(in srgb, #000 9%, transparent);
    transform: translateY(0);
    transition:
        transform 160ms ease,
        border-color 160ms ease,
        box-shadow 160ms ease;
}

.tmdb-panel--person .tmdb-film-card:hover,
.tmdb-panel--person .tmdb-film-card:focus-visible {
    border-color: color-mix(
        in srgb,
        var(--tmdb-person-blue) 45%,
        var(--tmdb-edge)
    );
    box-shadow: 0 5px 14px color-mix(in srgb, #000 14%, transparent);
    transform: translateY(-2px);
}

.tmdb-panel--person .tmdb-film-card:focus-visible {
    outline: 2px solid var(--tmdb-person-blue);
    outline-offset: 2px;
}

.tmdb-panel--person .tmdb-film-poster {
    margin: 0;
    border-radius: 0;
}

.tmdb-film-copy {
    display: flex;
    min-height: 5.8rem;
    flex: 1;
    flex-direction: column;
    padding: 0.6rem 0.65rem 0.65rem;
}

.tmdb-panel--person .tmdb-film-title {
    padding: 0;
    text-align: left;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.28;
}

.tmdb-film-role {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 0.2rem;
    color: var(--text-secondary);
    font-size: 0.69rem;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.tmdb-film-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: auto;
    padding-top: 0.45rem;
}

.tmdb-panel--person .tmdb-film-year {
    margin: 0;
    font-size: 0.67rem;
    text-align: left;
}

.tmdb-film-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    color: var(--text-secondary);
    font-size: 0.67rem;
    font-variant-numeric: tabular-nums;
}

.tmdb-film-rating > span {
    color: #f9ab00;
    font-size: 0.72rem;
}

@container tmdb-result (min-width: 580px) {
    .tmdb-person-hero {
        grid-template-columns: minmax(11rem, 13rem) minmax(0, 1fr);
        gap: clamp(1rem, 2.5vw, 1.6rem);
    }

    .tmdb-person-portrait {
        position: sticky;
        top: 1rem;
    }
}

@container tmdb-result (min-width: 860px) {
    .tmdb-person-hero {
        grid-template-columns: 13rem minmax(0, 1fr);
    }

    .tmdb-person-facts {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .tmdb-person-fact:nth-child(n) {
        border-top: 0;
        border-right: 1px solid var(--tmdb-edge);
    }

    .tmdb-person-fact:last-child {
        border-right: 0;
    }

    .tmdb-person-biography,
    .tmdb-person-gallery {
        padding: 0;
    }

    .tmdb-panel--person .tmdb-film-card {
        width: 8.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tmdb-person-portrait-img,
    .tmdb-person-gallery-img,
    .tmdb-panel--person .tmdb-film-card {
        transition: none;
    }
}

.books-card {
  container-type: inline-size;
  width: 100%;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  padding: 1rem;
  border: 1px solid var(--border-light, var(--border, #dadce0));
  border-radius: var(--theme-radius-search, 24px);
  background: var(--bg-light, var(--bg, #fff));
  color: var(--text-primary, #202124);
}

.books-card__layout {
  display: grid;
  gap: 1rem;
  min-width: 0;
}

.books-card__media {
  display: flex;
  justify-content: center;
}

.books-card__cover {
  display: block;
  width: min(148px, 44cqw);
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 10px;
  background: var(--bg, #f1f3f4);
  box-shadow: 0 2px 8px color-mix(in srgb, #000 18%, transparent);
}

.books-card__cover--empty {
  display: grid;
  place-items: center;
  font-size: 2.4rem;
}

.books-card__content {
  min-width: 0;
}

.books-card__eyebrow,
.books-card__authors,
.books-card__section p {
  margin: 0;
  color: var(--text-secondary, #5f6368);
}

.books-card__eyebrow {
  margin-bottom: 0.25rem;
  color: var(--primary, #1a73e8);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.books-card h2 {
  margin: 0;
  font-size: clamp(1.3rem, 5cqw, 2rem);
  line-height: 1.15;
}

.books-card__authors {
  margin-top: 0.35rem;
}

.books-card__meta,
.books-card__chips,
.books-card__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.books-card__meta {
  margin-top: 0.85rem;
}

.books-card__meta span,
.books-card__chips span {
  padding: 0.3rem 0.65rem;
  border-radius: 100px;
  background: var(--bg, #f1f3f4);
  color: var(--text-secondary, #5f6368);
  font-size: 0.78rem;
}

.books-card__section {
  margin-top: 1rem;
}

.books-card__section h3 {
  margin: 0 0 0.4rem;
  font-size: 0.88rem;
}

.books-card__section p {
  font-size: 0.88rem;
  line-height: 1.45;
}

.books-card__links {
  margin-top: 1rem;
}

.books-card__links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  box-sizing: border-box;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border, #dadce0);
  border-radius: 100px;
  color: var(--text-link, #1a73e8);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 120ms ease, transform 120ms ease;
}

.books-card__links a:hover {
  background: color-mix(in srgb, var(--primary, #1a73e8) 8%, transparent);
  transform: translateY(-1px);
}

.books-card__links .books-card__primary {
  border-color: var(--primary, #1a73e8);
  background: var(--primary, #1a73e8);
  color: #fff;
}

.books-card__links a:focus-visible {
  outline: 2px solid var(--primary, #1a73e8);
  outline-offset: 2px;
}

@container (min-width: 560px) {
  .books-card {
    padding: 1.25rem;
  }

  .books-card__layout {
    grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
    align-items: start;
  }

  .books-card__cover {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .books-card__links a {
    transition: none;
  }
}

.speedtest-card {
    container-type: inline-size;
    --speedtest-accent: #4285f4;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-family: var(--font-sans, sans-serif);
}

.speedtest-card__controls {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.speedtest-card__controls--footer {
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
}

.speedtest-card__button-group {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.65rem;
    margin-left: auto;
}

.speedtest-card__server-picker {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    min-width: 0;
    flex: 1 1 250px;
    align-items: flex-start;
}

.speedtest-card__server-picker-label {
    color: var(--text-secondary);
    font-size: 0.88rem;
    white-space: nowrap;
}

.speedtest-card__server-select {
    min-width: 250px;
    max-width: 280px;
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-light, #2f3033);
    color: var(--text-primary);
    font: inherit;
    font-size: 0.94rem;
}

.speedtest-card__server-select:disabled {
    opacity: 0.72;
}

.speedtest-card__action {
    flex-shrink: 0;
    min-height: 2.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        opacity 160ms ease;
    margin-left: auto;
}

.speedtest-card__button-group .speedtest-card__action {
    margin-left: 0;
}

.speedtest-card__action--cancel {
    border-color: color-mix(in srgb, #d93025 36%, var(--border));
    background: color-mix(in srgb, #d93025 10%, transparent);
    color: #f28b82;
}

.speedtest-card__action--cancel:hover:not(:disabled) {
    background: color-mix(in srgb, #d93025 16%, transparent);
}

.speedtest-card__action:hover:not(:disabled) {
    background: var(--bg-hover, rgba(255, 255, 255, 0.04));
}

.speedtest-card__action:disabled {
    cursor: default;
    opacity: 0.7;
}

.speedtest-card__gauge-shell {
    position: relative;
    min-height: 352px;
    max-height: 420px;
    padding: 1.15rem 0 0.95rem;
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    overflow: hidden;
    opacity: 1;
    transition:
        max-height 220ms ease,
        min-height 220ms ease,
        padding 220ms ease,
        opacity 160ms ease,
        border-color 160ms ease;
}

.speedtest-card__gauge {
    display: block;
    width: min(100%, 610px);
    margin: 0 auto;
}

.speedtest-card__gauge-track,
.speedtest-card__gauge-fill {
    fill: none;
    stroke-linecap: round;
    stroke-width: 15;
}

.speedtest-card__gauge-track {
    stroke: color-mix(in srgb, var(--border) 82%, transparent);
}

.speedtest-card__gauge-fill {
    stroke: var(--speedtest-accent);
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 220ms ease;
}

.speedtest-card__gauge-tip {
    fill: #ffffff;
    transition: transform 220ms ease;
    /* initial transform is 0 degrees around the center of the arc */
    transform: rotate(0deg);
    transform-origin: 160px 170px;
}

.speedtest-card__ticks text {
    fill: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: middle;
}

.speedtest-card__center {
    position: absolute;
    top: 60%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.14rem;
    width: min(100%, 300px);
    text-align: center;
    pointer-events: none;
}

.speedtest-card__phase {
    min-height: 1rem;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.speedtest-card__value {
    font-size: 3.2rem;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.speedtest-card__unit {
    margin-top: 0.25rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.speedtest-card__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    background: var(--bg-light, #2f3033);
}

.speedtest-card--compact .speedtest-card__gauge-shell {
    min-height: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-top-color: transparent;
    border-bottom-color: transparent;
    opacity: 0;
}

.speedtest-card--compact .speedtest-card__stats {
    border-top: 1px solid var(--border-light);
}

.speedtest-card__stat {
    padding: 1rem 1.1rem;
}

.speedtest-card__stat + .speedtest-card__stat {
    border-left: 1px solid var(--border-light);
}

.speedtest-card__stat-value {
    font-size: 2.45rem;
    font-weight: 400;
    line-height: 0.96;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
}

.speedtest-card__stat-label {
    margin-top: 0.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.speedtest-card__details {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 0 0;
}

.speedtest-card__detail {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem;
    font-size: 1rem;
    color: var(--text-secondary);
}

.speedtest-card__detail strong {
    color: var(--text-primary);
    font-weight: 600;
}

.speedtest-card__assessment {
    margin: 1rem 0 0;
    font-size: 1rem;
    line-height: 1.45;
}

.speedtest-card__status {
    margin: 0.7rem 0 0;
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.speedtest-card__debug {
    margin: 0.9rem 0 0;
    padding-top: 0.9rem;
    border-top: 1px solid var(--border-light);
}

.speedtest-card__debug-summary {
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.92rem;
    user-select: none;
}

.speedtest-card__debug[open] .speedtest-card__debug-summary {
    margin-bottom: 0.7rem;
}

.speedtest-card__debug-output {
    margin: 0;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-light, #2f3033);
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
    font:
        0.82rem/1.45 ui-monospace,
        SFMono-Regular,
        Menlo,
        Consolas,
        monospace;
}

@container (min-width: 640px) {
    .speedtest-card__details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 639px) {
    .speedtest-card__controls--footer {
        width: 100%;
    }

    .speedtest-card__server-picker {
        width: 100%;
    }

    .speedtest-card__server-select {
        width: 100%;
        max-width: none;
    }

    .speedtest-card__button-group {
        width: 100%;
        justify-content: flex-end;
    }

    .speedtest-card__action {
        align-self: auto;
    }

    .speedtest-card__gauge-shell {
        min-height: 312px;
        max-height: 360px;
        padding: 0.95rem 0 0.85rem;
    }

    .speedtest-card__center {
        top: 61%;
        width: min(100%, 260px);
    }

    .speedtest-card__value {
        font-size: 2.75rem;
    }

    .speedtest-card__ticks text {
        font-size: 11px;
    }

    .speedtest-card__stat {
        padding: 0.9rem 1rem;
    }
}

.speedtest-card :where(button, input, select, a[href], [role="button"]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.timer-widget {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: var(--text-primary);
    background: var(--bg-light, var(--bg));
    border: 1px solid var(--border-light, var(--border));
    border-radius: 16px;
    box-sizing: border-box;
    user-select: none;
}

/* Flatten degoog slot shell — .timer-widget is the visible card. */
#results-page .results-slot-panel:has(> .results-slot-panel-body > .timer-widget) {
    overflow: visible;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .timer-widget) > .results-slot-panel-body {
    padding: 0 !important;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .timer-widget) .results-slot-panel-title {
    display: none;
}

#results-sidebar .timer-widget,
#results-page .results-slot-panel:has(> .results-slot-panel-body > .timer-widget) > .results-slot-panel-body > .timer-widget {
    width: 100%;
    max-width: none;
    margin: 0;
    background: var(--bg-light, var(--bg));
    border: 0;
    border-radius: 1rem;
}

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid var(--border-light, var(--border));
}

.timer-tabs {
  display: flex;
  min-width: 0;
  gap: 4px;
}

.timer-tab,
.timer-icon-btn,
.timer-action-btn {
  font: inherit;
  color: inherit;
}

.timer-tab {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1;
  cursor: pointer;
}

.timer-tab:hover {
  color: var(--text-primary);
  background: var(--bg);
}

.timer-tab[aria-selected="true"] {
  color: var(--text-primary);
  background: var(--bg);
  border-color: var(--border-light, var(--border));
}

.timer-tab[aria-selected="true"] svg {
  color: var(--text-link);
}

.timer-icon-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.timer-icon-btn:hover,
.timer-icon-btn[aria-pressed="true"] {
  color: var(--text-primary);
  background: var(--bg);
}

.timer-icon-btn[aria-pressed="true"] {
  border-color: var(--border-light, var(--border));
}

.timer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
}

.timer-circle {
  position: relative;
  width: 148px;
  height: 148px;
  display: grid;
  place-items: center;
}

.timer-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.timer-track {
  stroke: var(--border-light, var(--border));
}

.timer-progress {
  stroke: var(--text-link);
  stroke-dasharray: 339.292;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.timer-display {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 138px;
  min-height: 34px;
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
}

.timer-widget[data-mode="stopwatch"] .timer-display {
  cursor: default;
}

.timer-display-input {
  position: relative;
  z-index: 1;
  width: 112px;
  min-height: 34px;
  padding: 0 4px 2px;
  border: 0;
  border-bottom: 2px solid var(--text-link);
  outline: 0;
  color: var(--text-primary);
  background: transparent;
  font: inherit;
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.timer-tone-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light, var(--border));
}

.timer-widget[data-mode="stopwatch"] .timer-tone-bar {
  display: none;
}

.timer-tone-label {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.timer-tone-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  height: 32px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--border-light, var(--border));
  border-radius: 100px;
  background: var(--bg, #fff);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}

.timer-tone-select:hover {
  border-color: var(--border);
  background-color: var(--bg-hover, var(--bg-light));
}

.timer-tone-select:focus {
  outline: 0;
  border-color: var(--text-link, #1a73e8);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-link, #1a73e8) 18%, transparent);
}

.timer-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--border-light, var(--border));
}

.timer-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.timer-action-btn svg {
  pointer-events: none;
}

.timer-action-btn:hover {
  background: var(--bg);
}

.timer-action-btn + .timer-action-btn {
  border-left: 1px solid var(--border-light, var(--border));
}

.timer-widget[data-running="true"] .timer-action-btn[data-timer-action="toggle-play"],
.timer-widget[data-alarming="true"] .timer-action-btn[data-timer-action="toggle-play"] {
  color: var(--text-link);
}

@media (max-width: 420px) {
  .timer-tab span {
    display: none;
  }

  .timer-tab {
    width: 34px;
    padding: 0;
  }

  .timer-circle {
    width: 136px;
    height: 136px;
  }

  .timer-display {
    font-size: 1.78rem;
  }
}

.timer-widget :where(button, input, select, [role="button"]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.until-card {
    container-type: inline-size;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    color: var(--until-text, var(--text-primary, CanvasText));
    --until-text: var(--text-primary, #202124);
    --until-muted: var(--text-secondary, #5f6368);
    --until-board: var(--bg, #ffffff);
    --until-board-2: var(--bg-light, #f8f9fa);
    --until-flap-text: var(--text-primary, #202124);
    --until-edge: color-mix(in srgb, var(--border, #dadce0) 82%, var(--bg, #ffffff));
    --until-line: color-mix(in srgb, var(--border, #dadce0) 72%, transparent);
    --until-amber: var(--warning, #fbbc04);
    --until-blue: var(--primary, #1a73e8);
    --until-green: var(--success, #188038);
    --until-accent: var(--text-link, var(--primary, #1a73e8));
    --until-panel-highlight: rgba(255, 255, 255, 0.78);
    --until-panel-shadow: rgba(60, 64, 67, 0.14);
    --until-panel-shadow-strong: rgba(60, 64, 67, 0.2);
    --until-flap-border: color-mix(in srgb, var(--border, #dadce0) 86%, var(--bg, #ffffff));
    --until-flap-highlight: rgba(255, 255, 255, 0.82);
    --until-flap-lowlight: color-mix(in srgb, var(--border, #dadce0) 36%, transparent);
    --until-flap-shadow: rgba(60, 64, 67, 0.18);
    --until-flap-text-shadow: rgba(255, 255, 255, 0.7);
    --until-hinge: color-mix(in srgb, var(--border, #dadce0) 86%, rgba(0, 0, 0, 0.2));
    --until-hinge-highlight: rgba(255, 255, 255, 0.8);
    --until-chip-bg: color-mix(in srgb, var(--bg-light, #f8f9fa) 86%, transparent);
    --until-detail-bg: color-mix(in srgb, var(--bg-light, #f8f9fa) 72%, transparent);
    --until-detail-bg-hover: color-mix(in srgb, var(--primary, #1a73e8) 8%, var(--bg-light, #f8f9fa));
    /* Material-ish rounding hierarchy. */
    --until-radius: 24px;
    --until-radius-sm: 14px;
    --until-radius-flap: 10px;
}

[data-theme="dark"] .until-card {
    --until-text: var(--text-primary, #e8eaed);
    --until-muted: var(--text-secondary, #a1a1aa);
    --until-board: #17181b;
    --until-board-2: #202126;
    --until-flap-text: #f8fafc;
    --until-edge: color-mix(in srgb, var(--border, #4b5563) 72%, #9ca3af);
    --until-line: rgba(255, 255, 255, 0.1);
    --until-amber: #fbbf24;
    --until-blue: #8ab4f8;
    --until-green: #86efac;
    --until-accent: #8ab4f8;
    --until-panel-highlight: rgba(255, 255, 255, 0.08);
    --until-panel-shadow: rgba(0, 0, 0, 0.24);
    --until-panel-shadow-strong: rgba(0, 0, 0, 0.3);
    --until-flap-border: rgba(255, 255, 255, 0.12);
    --until-flap-highlight: rgba(255, 255, 255, 0.12);
    --until-flap-lowlight: rgba(0, 0, 0, 0.5);
    --until-flap-shadow: rgba(0, 0, 0, 0.26);
    --until-flap-text-shadow: rgba(0, 0, 0, 0.48);
    --until-hinge: rgba(0, 0, 0, 0.45);
    --until-hinge-highlight: rgba(255, 255, 255, 0.05);
    --until-chip-bg: rgba(255, 255, 255, 0.05);
    --until-detail-bg: rgba(255, 255, 255, 0.045);
    --until-detail-bg-hover: rgba(255, 255, 255, 0.08);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .until-card {
        --until-text: var(--text-primary, #e8eaed);
        --until-muted: var(--text-secondary, #a1a1aa);
        --until-board: #17181b;
        --until-board-2: #202126;
        --until-flap-text: #f8fafc;
        --until-edge: color-mix(in srgb, var(--border, #4b5563) 72%, #9ca3af);
        --until-line: rgba(255, 255, 255, 0.1);
        --until-amber: #fbbf24;
        --until-blue: #8ab4f8;
        --until-green: #86efac;
        --until-accent: #8ab4f8;
        --until-panel-highlight: rgba(255, 255, 255, 0.08);
        --until-panel-shadow: rgba(0, 0, 0, 0.24);
        --until-panel-shadow-strong: rgba(0, 0, 0, 0.3);
        --until-flap-border: rgba(255, 255, 255, 0.12);
        --until-flap-highlight: rgba(255, 255, 255, 0.12);
        --until-flap-lowlight: rgba(0, 0, 0, 0.5);
        --until-flap-shadow: rgba(0, 0, 0, 0.26);
        --until-flap-text-shadow: rgba(0, 0, 0, 0.48);
        --until-hinge: rgba(0, 0, 0, 0.45);
        --until-hinge-highlight: rgba(255, 255, 255, 0.05);
        --until-chip-bg: rgba(255, 255, 255, 0.05);
        --until-detail-bg: rgba(255, 255, 255, 0.045);
        --until-detail-bg-hover: rgba(255, 255, 255, 0.08);
    }
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .until-card) {
    max-width: none;
    overflow: visible;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

#results-page .results-slot-panel:has(> .results-slot-panel-body > .until-card) > .results-slot-panel-body {
    padding: 0 !important;
}

.until-card__panel {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(230px, 0.92fr);
    grid-template-areas:
        "header header"
        "main details";
    gap: 18px 28px;
    align-items: stretch;
    min-width: 0;
    padding: clamp(18px, 2vw, 28px);
    border: 1px solid var(--until-edge);
    border-radius: var(--until-radius);
    background:
        linear-gradient(180deg, var(--until-panel-highlight), transparent 36%),
        linear-gradient(135deg, color-mix(in srgb, var(--until-blue) 10%, transparent), transparent 52%),
        var(--until-board);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--until-panel-highlight) 80%, transparent),
        0 1px 2px var(--until-panel-shadow-strong),
        0 10px 30px var(--until-panel-shadow);
}

.until-card__header {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    min-width: 0;
    padding: 0 2px 10px;
    border-bottom: 1px solid var(--until-line);
}

.until-card__kicker,
.until-card__status,
.until-card__eyebrow,
.until-card__detail dt {
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.until-card__kicker {
    flex: 0 0 auto;
    padding: 5px 12px;
    border-radius: 999px;
    border: 1px solid var(--until-line);
    background: var(--until-chip-bg);
    color: color-mix(in srgb, var(--until-muted) 88%, var(--until-text));
}

.until-card__status {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid color-mix(in srgb, var(--until-green) 42%, transparent);
    border-radius: 999px;
    color: var(--until-green);
    background: color-mix(in srgb, var(--until-green) 10%, transparent);
    margin-left: auto;
}

/* Google-style status chip dot. */
.until-card__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
    transform-origin: center;
    animation: until-status-pulse 1.8s ease-out infinite;
}

.until-card--past .until-card__status {
    color: var(--until-amber);
    border-color: color-mix(in srgb, var(--until-amber) 42%, transparent);
    background: color-mix(in srgb, var(--until-amber) 11%, transparent);
}

.until-card__main {
    grid-area: main;
    display: grid;
    align-content: center;
    gap: 10px;
    min-width: 0;
}

.until-card__eyebrow {
    color: var(--until-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.until-card__answer {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 9px 12px;
    min-width: 0;
    color: var(--text-primary, inherit);
    line-height: 1;
}

.until-card__answer--small {
    display: block;
    color: var(--until-text);
    font-size: 1.34rem;
    font-weight: 780;
    line-height: 1.16;
}

.until-card__part {
    display: inline-grid;
    grid-template-columns: auto;
    gap: 6px;
    min-width: 0;
}

.until-card__flap {
    position: relative;
    display: block;
    width: max-content;
    min-width: var(--until-flap-width, 76px);
    height: var(--until-flap-height, 64px);
    border: 1px solid var(--until-flap-border);
    border-radius: var(--until-radius-flap);
    overflow: hidden;
    color: var(--until-flap-text);
    background: var(--until-board-2);
    box-shadow:
        inset 0 1px 0 var(--until-flap-highlight),
        inset 0 -1px 0 var(--until-flap-lowlight),
        0 6px 16px var(--until-flap-shadow);
    font-variant-numeric: tabular-nums;
    perspective: 320px;
}

/* Hidden in-flow element rendered at the real value size so the flap grows
   to fit any number (e.g. "366,000" days). The four animated leaves are
   absolutely positioned and don't contribute width, so this is what the
   max-content box measures; --until-flap-width stays a per-level minimum. */
.until-card__flap-sizer {
    display: block;
    visibility: hidden;
    height: var(--until-flap-height, 64px);
    padding: 0 14px;
    font-size: var(--until-part-value-size, 1.42rem);
    font-weight: var(--until-part-value-weight, 700);
    line-height: var(--until-flap-height, 64px);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Hairline hinge that splits the flap into two leaves. */
.until-card__flap::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    z-index: 6;
    background: var(--until-hinge);
    box-shadow: 0 1px 0 var(--until-hinge-highlight);
}

.until-card__flap-card {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    box-sizing: border-box;
    overflow: hidden;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--until-flap-highlight) 68%, transparent), transparent 60%),
        var(--until-board-2);
}

.until-card__flap-card--upper {
    top: 0;
    z-index: 1;
    border-radius: var(--until-radius-flap) var(--until-radius-flap) 0 0;
}

.until-card__flap-card--lower {
    bottom: 0;
    z-index: 1;
    border-radius: 0 0 var(--until-radius-flap) var(--until-radius-flap);
}

/* Real split-flap motion: the old top leaf folds over the hinge, then the
   new lower leaf drops into place. These are solid half-cards, not masks, so
   the lower quarter cannot go transparent mid-animation. */
.until-card__flap-card--flip-upper {
    top: 0;
    z-index: 4;
    border-radius: var(--until-radius-flap) var(--until-radius-flap) 0 0;
    transform-origin: center bottom;
    transform: rotateX(0deg);
    backface-visibility: visible;
    pointer-events: none;
    visibility: hidden;
}

.until-card__flap-card--flip-lower {
    bottom: 0;
    z-index: 5;
    border-radius: 0 0 var(--until-radius-flap) var(--until-radius-flap);
    transform-origin: center top;
    transform: rotateX(180deg);
    backface-visibility: hidden;
    pointer-events: none;
    visibility: hidden;
}

.until-card__flap-text {
    position: absolute;
    left: 0;
    right: 0;
    height: 200%;
    display: grid;
    place-items: center;
    padding: 0 10px;
    color: var(--until-flap-text);
    font-size: var(--until-part-value-size, 1.42rem);
    font-weight: var(--until-part-value-weight, 700);
    line-height: 1;
    text-shadow: none;
    font-variant-numeric: tabular-nums;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

.until-card__flap-card--upper .until-card__flap-text,
.until-card__flap-card--flip-upper .until-card__flap-text {
    top: 0;
}

.until-card__flap-card--lower .until-card__flap-text,
.until-card__flap-card--flip-lower .until-card__flap-text {
    bottom: 0;
}

.until-card__flap--anim .until-card__flap-card--flip-upper {
    animation: until-flip-top 341ms cubic-bezier(0.36, 0, 0.66, 1) both;
    visibility: visible;
}

.until-card__flap--anim .until-card__flap-card--flip-lower {
    animation: until-flip-bottom 341ms cubic-bezier(0.34, 0.62, 0.46, 1) both;
    visibility: visible;
}

.until-card__part-unit {
    color: var(--until-muted);
    font-size: var(--until-part-unit-size, 0.78rem);
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1.1;
    text-transform: uppercase;
}

.until-card__part--0 {
    --until-flap-width: 96px;
    --until-flap-height: 76px;
    --until-part-value-size: 2.24rem;
    --until-part-value-weight: 700;
    --until-part-unit-size: 0.82rem;
}

.until-card__part--1 {
    --until-flap-width: 82px;
    --until-flap-height: 66px;
    --until-part-value-size: 1.72rem;
}

.until-card__part--2 {
    --until-flap-width: 74px;
    --until-flap-height: 58px;
    --until-part-value-size: 1.46rem;
}

.until-card__part--3,
.until-card__part--4,
.until-card__part--5,
.until-card__part--6 {
    --until-flap-width: 68px;
    --until-flap-height: 54px;
    --until-part-value-size: 1.28rem;
}

.until-card__now {
    color: var(--until-text);
    font-size: 2.2rem;
    font-weight: 820;
    line-height: 1;
    text-shadow: 0 1px 1px var(--until-flap-text-shadow);
}

.until-card__caption {
    color: var(--until-muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.until-card__details {
    grid-area: details;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
}

.until-card__detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 42px;
    padding: 4px 5px 4px 12px;
    border: 1px solid var(--until-line);
    border-radius: 999px;
    background: var(--until-chip-bg);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--until-panel-highlight) 56%, transparent),
        0 1px 2px color-mix(in srgb, var(--until-panel-shadow) 70%, transparent);
    transition:
        background-color 160ms ease,
        border-color 160ms ease,
        transform 160ms ease;
}

.until-card__detail:hover {
    transform: translateY(-1px);
    background: var(--until-detail-bg-hover);
    border-color: color-mix(in srgb, var(--until-accent) 40%, var(--until-line));
}

.until-card__detail dt {
    margin: 0;
    color: color-mix(in srgb, var(--until-muted) 86%, var(--until-text));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.until-card__detail dd {
    position: relative;
    isolation: isolate;
    display: block;
    min-width: 58px;
    min-height: 32px;
    padding: 0;
    border: 1px solid var(--until-flap-border);
    border-radius: 999px;
    overflow: hidden;
    margin: 0;
    color: var(--until-flap-text);
    background: var(--until-board-2);
    box-shadow:
        inset 0 1px 0 color-mix(in srgb, var(--until-flap-highlight) 72%, transparent),
        inset 0 -1px 0 color-mix(in srgb, var(--until-flap-lowlight) 56%, transparent);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    perspective: 180px;
}

.until-card__detail-sizer {
    display: block;
    visibility: hidden;
    min-height: 32px;
    padding: 0 10px;
    line-height: 32px;
    white-space: nowrap;
}

.until-card__detail-half {
    position: absolute;
    left: 0;
    right: 0;
    height: 50%;
    overflow: hidden;
    background:
        linear-gradient(180deg, color-mix(in srgb, var(--until-flap-highlight) 60%, transparent), transparent 62%),
        var(--until-board-2);
}

.until-card__detail-half--upper {
    top: 0;
    z-index: 1;
    border-radius: 999px 999px 0 0;
}

.until-card__detail-half--lower {
    bottom: 0;
    z-index: 1;
    border-radius: 0 0 999px 999px;
}

.until-card__detail-half--flip-upper {
    top: 0;
    z-index: 4;
    border-radius: 999px 999px 0 0;
    transform-origin: center bottom;
    transform: rotateX(0deg);
    backface-visibility: visible;
    visibility: hidden;
}

.until-card__detail-half--flip-lower {
    bottom: 0;
    z-index: 5;
    border-radius: 0 0 999px 999px;
    transform-origin: center top;
    transform: rotateX(180deg);
    backface-visibility: hidden;
    visibility: hidden;
}

.until-card__detail-text {
    position: absolute;
    left: 0;
    right: 0;
    height: 200%;
    display: grid;
    place-items: center;
    padding: 0 10px;
    color: var(--until-flap-text);
    line-height: 1;
    white-space: nowrap;
    -webkit-font-smoothing: antialiased;
}

.until-card__detail-half--upper .until-card__detail-text,
.until-card__detail-half--flip-upper .until-card__detail-text {
    top: 0;
}

.until-card__detail-half--lower .until-card__detail-text,
.until-card__detail-half--flip-lower .until-card__detail-text {
    bottom: 0;
}

.until-card__detail-value--anim .until-card__detail-half--flip-upper {
    animation: until-flip-top 317ms cubic-bezier(0.36, 0, 0.66, 1) both;
    visibility: visible;
}

.until-card__detail-value--anim .until-card__detail-half--flip-lower {
    animation: until-flip-bottom 317ms cubic-bezier(0.34, 0.62, 0.46, 1) both;
    visibility: visible;
}

.until-card__detail dd::after {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    z-index: 6;
    height: 1px;
    background: var(--until-hinge);
    box-shadow: 0 1px 0 var(--until-hinge-highlight);
    pointer-events: none;
}

@keyframes until-status-pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
    }
    45% {
        transform: scale(1.12);
        box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 7px color-mix(in srgb, currentColor 0%, transparent);
    }
}

/* Phase 1: the old upper half rotates around the center hinge. The solid back
   continues over the lower half, matching the mechanical leaf path. */
@keyframes until-flip-top {
    0% {
        transform: rotateX(0deg);
    }
    48% {
        transform: rotateX(-92deg);
    }
    100% {
        transform: rotateX(-180deg);
    }
}

/* Phase 2: the new lower half starts folded behind the hinge, then rotates
   into the bottom half as a normal solid flap. */
@keyframes until-flip-bottom {
    0%,
    50% {
        transform: rotateX(180deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

@container (max-width: 650px) {
    .until-card__panel {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "details";
    }

    .until-card__eyebrow {
        white-space: normal;
    }
}

@container (max-width: 430px) {
    .until-card__panel {
        padding: 12px;
    }

    .until-card__answer {
        gap: 8px;
    }

    .until-card__part--0,
    .until-card__part--1,
    .until-card__part--2,
    .until-card__part--3 {
        --until-flap-width: 72px;
        --until-flap-height: 58px;
        --until-part-value-size: 1.48rem;
    }

    .until-card__details {
        grid-template-columns: 1fr;
    }
}

@container (max-width: 340px) {
    .until-card__details {
        grid-template-columns: 1fr;
    }
}

@container (min-width: 800px) {
    .until-card__part--0 {
        --until-flap-width: 112px;
        --until-flap-height: 88px;
        --until-part-value-size: 2.65rem;
    }

    .until-card__part--1 {
        --until-flap-width: 96px;
        --until-flap-height: 76px;
        --until-part-value-size: 2rem;
    }

    .until-card__part--2 {
        --until-flap-width: 86px;
        --until-flap-height: 68px;
        --until-part-value-size: 1.7rem;
    }

    .until-card__part--3,
    .until-card__part--4,
    .until-card__part--5,
    .until-card__part--6 {
        --until-flap-width: 78px;
        --until-flap-height: 62px;
        --until-part-value-size: 1.48rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .until-card__status::before,
    .until-card__flap-card--flip-upper,
    .until-card__flap-card--flip-lower,
    .until-card__detail-half--flip-upper,
    .until-card__detail-half--flip-lower {
        animation: none !important;
    }

    .until-card__flap-card--flip-upper {
        transform: rotateX(0deg);
    }

    .until-card__flap-card--flip-lower {
        transform: rotateX(180deg);
    }
}

.clrtr-card {
    container-type: inline-size;
    color: var(--text-primary, CanvasText);
    font-family: var(--font-sans, sans-serif);
    margin: 0;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    --clrtr-surface: var(--bg-light, color-mix(in srgb, var(--bg, Canvas) 92%, var(--text-primary, CanvasText) 8%));
    --clrtr-field-bg: var(--bg, Canvas);
    --clrtr-border: var(--border-light, var(--border, rgba(128, 128, 128, 0.28)));
    --clrtr-muted: var(--text-secondary, color-mix(in srgb, var(--text-primary, CanvasText) 68%, transparent));
}

.clrtr-panel {
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
    gap: 20px;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    background: var(--slot-inset-bg, var(--bg-light, var(--clrtr-surface)));
    border: 1px solid var(--slot-inset-border, var(--clrtr-border));
    border-radius: 12px;
    padding: 20px;
    box-sizing: border-box;
}

.clrtr-preview-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.clrtr-preview-box {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--clrtr-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.clrtr-preview-box:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.clrtr-preview-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 5px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: opacity 0.2s ease;
}

.clrtr-color-name {
    font-size: 0.8rem;
    color: var(--clrtr-muted);
    font-weight: 500;
    text-align: center;
    word-break: break-all;
}

.clrtr-color-name span {
    font-weight: 700;
    color: var(--text-primary, CanvasText);
    text-transform: capitalize;
}

/* Picker section styling */
.clrtr-picker-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    margin-top: 10px;
    border-top: 1px solid var(--clrtr-border);
    padding-top: 14px;
}

.clrtr-wheel {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background: radial-gradient(circle at center, #ffffff 0%, transparent 100%),
                conic-gradient(from 0deg, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
    cursor: crosshair;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.25), 0 2px 6px rgba(0,0,0,0.15);
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    border: 1px solid var(--clrtr-border);
}

.clrtr-wheel-marker {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: transparent;
    box-shadow: 0 0 4px rgba(0,0,0,0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    left: 50%;
    top: 50%;
}

.clrtr-sliders {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.clrtr-slider-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.clrtr-slider-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--clrtr-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.clrtr-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    box-sizing: border-box;
    height: 24px;
    border-block: 7px solid transparent;
    border-radius: 12px;
    background-clip: content-box;
    outline: none;
    margin: 4px 0;
    border: 1px solid var(--clrtr-border);
    cursor: pointer;
}

.clrtr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg, #ffffff);
    border: 2px solid var(--border, #555555);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.1s ease;
}

.clrtr-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.clrtr-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--bg, #ffffff);
    border: 2px solid var(--border, #555555);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform 0.1s ease;
}

.clrtr-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
}

.clrtr-hue-slider {
    background: linear-gradient(to right, #ff0000, #ffff00, #00ff00, #00ffff, #0000ff, #ff00ff, #ff0000);
}

.clrtr-lightness-slider {
    background: linear-gradient(to right, #000000, #7f7f7f, #ffffff);
}

.clrtr-opacity-slider {
    background-size: auto, 8px 8px;
    background-position: 0 0, 0 0;
    background-repeat: no-repeat, repeat;
    background-image: repeating-conic-gradient(#cccccc 0 25%, #ffffff 0 50%);
}

/* Translation rows */
.clrtr-translations {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    width: 100%;
}

.clrtr-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: var(--clrtr-field-bg);
    border: 1px solid var(--clrtr-border);
    transition: background-color 0.15s ease, border-color 0.15s ease;
    min-height: 40px;
    box-sizing: border-box;
}

.clrtr-row:hover {
    background: color-mix(in srgb, var(--clrtr-field-bg) 92%, var(--text-primary, CanvasText) 8%);
    border-color: var(--border, var(--clrtr-border));
}

.clrtr-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--clrtr-muted);
    min-width: 130px;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.clrtr-value-container {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.clrtr-value {
    min-height: 24px;
    font-family: var(--font-mono, monospace);
    font-size: 0.82rem;
    color: var(--text-primary, CanvasText);
    background: transparent;
    border: none;
    outline: none;
    width: 100%;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    padding: 0;
    cursor: text;
}

.clrtr-copy-btn {
    background: transparent;
    border: 1px solid var(--clrtr-border);
    border-radius: 6px;
    color: var(--clrtr-muted);
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
    flex-shrink: 0;
}

.clrtr-copy-btn:not([disabled]):hover {
    border-color: var(--primary, var(--text-link, #1a73e8));
    color: var(--primary, var(--text-link, #1a73e8));
    background: color-mix(in srgb, var(--primary, var(--text-link, #1a73e8)) 12%, transparent);
}

.clrtr-copy-btn[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}

.clrtr-copy-btn.copied {
    border-color: var(--success, #34a853);
    color: var(--success, #34a853);
    background: color-mix(in srgb, var(--success, #34a853) 8%, transparent);
    transform: scale(1.05);
}

.clrtr-copy-icon,
.clrtr-check-icon {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.clrtr-check-icon {
    display: none;
}

.clrtr-copy-btn.copied .clrtr-copy-icon {
    display: none;
}

.clrtr-copy-btn.copied .clrtr-check-icon {
    display: block;
    animation: clrtr-pop 0.2s ease-out;
}

@keyframes clrtr-pop {
    0% { transform: scale(0.6); }
    100% { transform: scale(1); }
}

/* Responsive — stack vertically on narrow slots */
@container (max-width: 680px) {
    .clrtr-panel {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 16px;
    }

    .clrtr-preview-container {
        align-items: center;
        max-width: 200px;
        margin: 0 auto;
    }

    .clrtr-label {
        min-width: 100px;
        font-size: 0.68rem;
    }
}

@container (max-width: 420px) {
    .clrtr-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .clrtr-label {
        min-width: 0;
    }

    .clrtr-value-container {
        width: 100%;
    }
}

/* Wide two-column translations follow the native slot's actual card width. */
@container (min-width: 900px) {
    .clrtr-panel {
        grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
        gap: 24px;
        padding: 24px;
    }
}

@container (min-width: 1100px) {
    .clrtr-translations {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 12px;
        align-content: start;
    }
}

.clrtr-panel {
    border-radius: 24px;
}

.clrtr-row {
    border-radius: 999px;
    padding-inline: 14px;
}

.clrtr-copy-btn {
    border-radius: 999px;
}

.clrtr-card :where(button, input, select, textarea, a[href]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ── Card shell ─────────────────────────────────────────────────────────── */

.sports-slot {
    container-type: inline-size;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 0;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--theme-radius-lg, 16px);
    background: var(--bg);
    box-shadow: none;
    overflow: hidden;
    --sports-radius-pill: var(--theme-radius-pill, 999px);
    --sports-radius-card: var(--theme-radius-lg, 16px);
}

.sports-slot-command {
    background: transparent;
}

/* ── Compact toolbar (replaces giant hero title) ───────────────────────── */

.sports-slot__toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.sports-slot__toolbar-copy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.65rem;
    min-width: 0;
}

.sports-slot__kicker {
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sports-slot__headline {
    color: var(--text-primary);
    font-size: 1.05rem;
    font-weight: 800;
    line-height: 1.2;
}

.sports-slot__meta {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.35;
}

.sports-slot__toolbar-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.sports-slot__body {
    min-width: 0;
}

/* ── Two-column split layout ───────────────────────────────────────────── */

.sports-slot__split {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.15rem 1.15rem;
}

@container (min-width: 860px) {
    .sports-slot__split--active {
        grid-template-columns: minmax(300px, 1.05fr) minmax(280px, 1fr);
        align-items: stretch;
    }

    .sports-slot__split-pane--primary {
        display: flex;
        flex-direction: column;
    }

    .sports-slot__split-pane--games {
        display: flex;
        flex-direction: column;
    }

    .sports-slot__split-pane--games .sports-slot__mini-games--grid {
        flex: 1;
    }
}

.sports-slot__split-pane {
    min-width: 0;
}

.sports-slot__split-pane--secondary {
    display: grid;
    gap: 1rem;
}

.sports-slot__pane {
    min-width: 0;
}

.sports-slot__section-label {
    margin: 0 0 0.65rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ── Badges & live status ──────────────────────────────────────────────── */

.sports-slot__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2rem;
    padding: 0.3rem 0.8rem;
    border-radius: var(--sports-radius-pill);
    border: 1px solid var(--border);
    background: var(--bg-light);
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.sports-slot__badge--live {
    border: 0;
    background: transparent;
    min-height: 0;
    padding: 0;
    color: var(--danger);
}

.sports-slot__live-control {
    display: inline-flex;
    align-items: center;
    gap: 0.42rem;
    color: var(--danger);
}

.sports-slot__live-refresh-spinner {
    flex: 0 0 auto;
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid color-mix(in srgb, currentColor 22%, transparent);
    border-top-color: currentColor;
    border-radius: 50%;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(0.9);
    transition:
        opacity 160ms ease,
        visibility 160ms ease;
}

.sports-slot__live-control--refreshing .sports-slot__live-refresh-spinner {
    opacity: 1;
    visibility: visible;
    animation: sports-slot-refresh-spin 0.75s linear infinite;
}

@keyframes sports-slot-refresh-spin {
    to {
        transform: rotate(360deg);
    }
}

.sports-slot__live-status {
    --sports-live-bar-size: 18px;
    display: inline-flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    min-width: 2.25rem;
    color: var(--danger);
}

.sports-slot__live-status-text {
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    white-space: nowrap;
}

.sports-slot__live-status--refresh {
    cursor: pointer;
    border-radius: var(--sports-radius-pill);
    transition: transform 160ms ease;
}

.sports-slot__live-status--refresh:hover .sports-slot__live-status-text {
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

.sports-slot__live-status--refresh:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--danger) 55%, transparent);
    outline-offset: 2px;
}

.sports-slot__live-status--refresh[aria-busy="true"] {
    cursor: progress;
}

.sports-slot__live-track {
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, currentColor 20%, transparent);
}

.sports-slot__live-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: var(--sports-live-bar-size);
    height: 100%;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 4px color-mix(in srgb, currentColor 45%, transparent);
    animation: sports-slot-live-sweep 2.5s ease-in-out infinite;
    will-change: left;
}

.sports-slot__badge--final {
    border-color: color-mix(in srgb, var(--success) 45%, var(--border));
    background: color-mix(in srgb, var(--success) 12%, var(--bg) 88%);
    color: var(--success);
}

.sports-slot__badge--scheduled {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    background: color-mix(in srgb, var(--primary) 10%, var(--bg) 90%);
    color: var(--primary);
}

.sports-slot__badge--setup,
.sports-slot__badge--warning {
    border-color: color-mix(in srgb, var(--warning) 45%, var(--border));
    background: color-mix(in srgb, var(--warning) 12%, var(--bg) 88%);
    color: var(--warning);
}

@keyframes sports-slot-live-sweep {
    0%,
    100% {
        left: calc(-1 * var(--sports-live-bar-size));
    }

    50% {
        left: 100%;
    }
}

/* ── Scoreboard ────────────────────────────────────────────────────────── */

.sports-slot__scoreboard {
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-card);
    background: var(--bg-light);
    padding: 0.9rem 1rem;
}

.sports-slot__scoreboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.sports-slot__scoreboard-header-meta {
    font-weight: 500;
}

.sports-slot__scoreboard-header-status {
    font-weight: 700;
}

.sports-slot__scoreboard-header-status--live {
    color: var(--danger);
}

.sports-slot__scoreboard-header-status--live .sports-slot__live-control,
.sports-slot__scoreboard-header-status--live .sports-slot__live-status--refresh {
    cursor: pointer;
}

.sports-slot__scoreboard-body {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    justify-items: center;
    gap: 1rem;
}

.sports-slot__scoreboard-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    width: 100%;
    min-width: 0;
}

.sports-slot__scoreboard-team-name {
    width: 100%;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.2;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.sports-slot__scoreboard-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.sports-slot__score-divider {
    color: var(--text-secondary);
    opacity: 0.5;
}

.sports-slot__scoreboard-sublabel,
.sports-slot__scoreboard-meta {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 0.55rem;
}

.sports-slot__penalties {
    margin-top: 0.8rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid color-mix(in srgb, var(--primary) 18%, var(--border));
    border-radius: calc(var(--sports-radius-card) - 2px);
    background:
        linear-gradient(
            180deg,
            color-mix(in srgb, var(--bg) 72%, var(--primary) 4%) 0%,
            color-mix(in srgb, var(--bg-light) 95%, var(--bg) 5%) 100%
        );
}

.sports-slot__penalties--live {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent);
}

.sports-slot__penalties-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.7rem;
}

.sports-slot__penalties-kicker {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.sports-slot__penalties-status {
    margin-top: 0.15rem;
    font-size: 0.92rem;
    font-weight: 800;
    color: var(--text-primary);
}

.sports-slot__penalties-summary {
    padding: 0.35rem 0.65rem;
    border-radius: var(--sports-radius-pill);
    background: color-mix(in srgb, var(--bg-light) 82%, var(--bg) 18%);
    color: var(--text-secondary);
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.sports-slot__penalty-row {
    display: grid;
    grid-template-columns: minmax(0, 140px) minmax(0, 1fr) 2rem;
    gap: 0.7rem;
    align-items: center;
}

.sports-slot__penalty-row + .sports-slot__penalty-row {
    margin-top: 0.55rem;
}

.sports-slot__penalty-team {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-width: 0;
}

.sports-slot__penalty-team .sports-slot__team-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    border-radius: 10px;
}

.sports-slot__penalty-team-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.sports-slot__penalty-team-copy strong {
    font-size: 0.82rem;
    color: var(--text-primary);
}

.sports-slot__penalty-team-copy span {
    color: var(--text-secondary);
    font-size: 0.72rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sports-slot__penalty-shots {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
    flex-wrap: wrap;
}

.sports-slot__penalty-shot {
    position: relative;
    display: inline-flex;
    width: 18px;
    height: 18px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.sports-slot__penalty-shot--sudden-death {
    margin-left: 0.4rem;
}

.sports-slot__penalty-shot--sudden-death-start {
    margin-left: 0.8rem;
}

.sports-slot__penalty-shot--sudden-death-start::before {
    content: "SD";
    position: absolute;
    left: -0.75rem;
    top: 50%;
    transform: translate(-100%, -50%);
    color: var(--text-secondary);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.sports-slot__penalty-shot-core {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    border: 2px solid color-mix(in srgb, var(--border) 92%, var(--text-secondary) 8%);
    background: var(--bg);
    transition:
        transform 220ms ease,
        border-color 220ms ease,
        background 220ms ease,
        box-shadow 220ms ease;
}

.sports-slot__penalty-shot--scored .sports-slot__penalty-shot-core {
    border-color: color-mix(in srgb, var(--success) 60%, var(--border));
    background: color-mix(in srgb, var(--success) 84%, var(--bg) 16%);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 16%, transparent);
}

.sports-slot__penalty-shot--missed .sports-slot__penalty-shot-core {
    border-color: color-mix(in srgb, var(--danger) 52%, var(--border));
    background:
        linear-gradient(
            135deg,
            transparent 0 44%,
            color-mix(in srgb, var(--danger) 78%, transparent) 44% 56%,
            transparent 56% 100%
        ),
        var(--bg);
}

.sports-slot__penalty-shot--pending .sports-slot__penalty-shot-core {
    border-style: dashed;
    opacity: 0.6;
}

.sports-slot__penalty-shot--latest .sports-slot__penalty-shot-core {
    transform: scale(1.08);
}

.sports-slot__penalty-shot--enter .sports-slot__penalty-shot-core {
    animation: sports-slot-penalty-shot-enter 0.5s cubic-bezier(0.18, 0.9, 0.18, 1) both;
}

@keyframes sports-slot-penalty-shot-enter {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.55);
    }

    70% {
        opacity: 1;
        transform: translateY(0) scale(1.14);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.sports-slot__penalty-total {
    text-align: right;
    font-size: 1rem;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.sports-slot__penalties-note {
    margin-top: 0.65rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
}

@media (max-width: 640px) {
    .sports-slot__penalties-head,
    .sports-slot__penalty-row {
        grid-template-columns: 1fr;
    }

    .sports-slot__penalties-head {
        display: grid;
    }

    .sports-slot__penalties-summary,
    .sports-slot__penalty-total {
        justify-self: start;
    }
}

/* ── Team marks ────────────────────────────────────────────────────────── */

.sports-slot__team-mark {
    position: relative;
    display: inline-flex;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg-light, #f8f9fa);
    overflow: hidden;
}

.sports-slot__team-mark-image,
.sports-slot__team-mark-fallback {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sports-slot__team-mark-image {
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 0.3rem;
    object-fit: contain;
}

.sports-slot__team-mark-fallback {
    z-index: 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.sports-slot__team-mark--logo-ready .sports-slot__team-mark-fallback {
    opacity: 0;
}

/* ── Facts strip ───────────────────────────────────────────────────────── */

.sports-slot__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.65rem 0.85rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
}

.sports-slot__fact-label {
    display: block;
    margin-bottom: 0.15rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sports-slot__fact-value {
    font-size: 0.9rem;
    font-weight: 700;
}

/* ── Match cards grid ────────────────────────────────────────────────────── */

.sports-slot__mini-games--grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.sports-slot__games-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.65rem;
}

.sports-slot__games-head .sports-slot__section-label {
    margin: 0;
}

.sports-slot__latest-btn {
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 100px;
    background: var(--bg);
    color: var(--text-link);
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    padding: 0.42rem 0.85rem;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.sports-slot__latest-btn:hover {
    background: var(--bg-hover);
    border-color: var(--text-link);
}

.sports-slot__mini-game--card {
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-card);
    background: var(--bg-light);
    padding: 0.7rem 0.8rem;
}

.sports-slot__mini-game--selectable {
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.sports-slot__mini-game--selectable:hover {
    border-color: var(--text-link);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.sports-slot__mini-game--selectable:focus-visible {
    outline: 2px solid var(--text-link);
    outline-offset: 2px;
}

.sports-slot__mini-game--focus {
    border-color: var(--text-link);
    box-shadow: 0 0 0 1px color-mix(in srgb, var(--text-link) 35%, transparent);
}

.sports-slot__mini-game-top,
.sports-slot__mini-game-score {
    display: flex;
    justify-content: space-between;
    gap: 0.65rem;
    align-items: center;
}

.sports-slot__mini-game-label {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sports-slot__mini-game-status {
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    text-align: right;
}

.sports-slot__mini-game-status--live {
    color: var(--danger);
}

.sports-slot__mini-game-status--final {
    color: var(--success);
}

.sports-slot__mini-game-status--warning {
    color: var(--warning);
}

.sports-slot__mini-game-score {
    margin-top: 0.4rem;
    font-size: 0.88rem;
}

.sports-slot__mini-game--scheduled .sports-slot__mini-game-score {
    justify-content: flex-start;
}

.sports-slot__mini-game-score strong {
    font-size: 0.95rem;
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.sports-slot__mini-game-matchup {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.sports-slot__mini-game .sports-slot__team-mark {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    border-radius: 8px;
}

.sports-slot__mini-game .sports-slot__team-mark-image {
    padding: 0.12rem;
}

.sports-slot__mini-game .sports-slot__team-mark-fallback {
    font-size: 0.5rem;
}

.sports-slot__mini-game-separator {
    color: var(--text-secondary);
    font-weight: 800;
}

.sports-slot__mini-game-meta {
    margin-top: 0.3rem;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

/* ── Scorers ───────────────────────────────────────────────────────────── */

.sports-slot__scorers-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: start;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
    padding-top: 0.65rem;
    margin-top: 0.65rem;
}

.sports-slot__scorers-col {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sports-slot__scorers-col--home {
    align-items: flex-start;
    text-align: left;
}

.sports-slot__scorers-col--away {
    align-items: flex-end;
    text-align: right;
}

.sports-slot__scorers-icon {
    font-size: 0.8rem;
    opacity: 0.7;
    align-self: center;
}

.sports-slot__scorer-item {
    line-height: 1.3;
}

/* ── Standings tables ────────────────────────────────────────────────────── */

.sports-slot__standings-grid {
    display: grid;
    gap: 1rem;
    padding: 1rem 1.15rem 1.15rem;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.sports-slot__table {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--bg) 98%, var(--text-primary) 2%);
}

.sports-slot__table-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 72px 52px 44px;
    gap: 0.45rem;
    align-items: center;
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
    font-size: 0.84rem;
}

.sports-slot__table-row:last-child {
    border-bottom: 0;
}

.sports-slot__table-row--head {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: color-mix(in srgb, var(--bg-light, var(--bg)) 88%, var(--text-primary) 12%);
}

.sports-slot__table-row--highlight {
    color: var(--primary);
    font-weight: 800;
}

.sports-slot__table-team {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.sports-slot__table-team img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.sports-slot__table-team > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.sports-slot__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.65rem 1.15rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
}

.sports-slot__tab {
    padding: 0.42rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--sports-radius-pill);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.86rem;
    font-weight: 700;
    cursor: pointer;
    transition:
        color 150ms ease,
        background 150ms ease,
        border-color 150ms ease;
}

.sports-slot__tab:hover {
    color: var(--text-primary);
    background: var(--bg-light);
}

.sports-slot__tab--active {
    color: var(--text-primary);
    background: var(--bg-light);
    border-color: var(--border);
}

.sports-slot__tab-panel {
    min-width: 0;
}

.sports-slot__tab-panels > .sports-slot__tab-panel:not([style*="display: none"]) {
    display: block;
}

/* ── Stats bars ──────────────────────────────────────────────────────────── */

.sports-slot__stats-list {
    display: grid;
    gap: 0.7rem;
    padding: 1rem 1.15rem 1.15rem;
}

.sports-slot__stats-list--wide {
    max-width: 920px;
    margin: 0 auto;
}

.sports-slot__stat-row {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    grid-template-rows: auto auto;
    column-gap: 0.75rem;
    row-gap: 0.2rem;
    align-items: center;
    font-size: 0.88rem;
}

.sports-slot__stat-val {
    font-weight: 800;
    grid-row: 1;
    line-height: 1;
}

.sports-slot__stat-val--home {
    grid-column: 1;
    text-align: left;
}

.sports-slot__stat-val--away {
    grid-column: 3;
    text-align: right;
}

.sports-slot__stat-bar-track {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    height: 5px;
    width: 100%;
    background: color-mix(in srgb, var(--text-primary) 12%, transparent);
    border-radius: 999px;
    overflow: hidden;
}

.sports-slot__stat-bar {
    height: 100%;
    transition: width 650ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sports-slot__stat-bar--home {
    background: var(--sports-home-color, var(--primary));
    margin-right: auto;
}

.sports-slot__stat-bar--away {
    background: var(--sports-away-color, var(--primary));
    margin-left: auto;
}

.sports-slot__stat-label {
    grid-column: 2;
    grid-row: 2;
    justify-self: center;
    font-size: 0.68rem;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.2;
}

/* ── World Cup groups ────────────────────────────────────────────────────── */

.sports-slot__group-grid,
.sports-slot__group-grid--wide {
    display: grid;
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.15rem;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

@container (min-width: 900px) {
    .sports-slot__group-grid--wide {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.sports-slot__group-card {
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-card);
    background: var(--bg-light);
    padding: 0.7rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.sports-slot__group-card-head {
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.4rem;
    font-size: 0.9rem;
}

.sports-slot__group-table {
    display: flex;
    flex-direction: column;
}

.sports-slot__group-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px 28px 28px;
    align-items: center;
    gap: 0.2rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
    font-size: 0.8rem;
}

.sports-slot__group-row:last-child {
    border-bottom: 0;
}

.sports-slot__group-row--head {
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom-width: 2px;
}

.sports-slot__group-row--highlight {
    font-weight: 800;
    color: var(--primary);
}

.sports-slot__group-team {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.sports-slot__group-team-logo {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.sports-slot__group-row--soccer .sports-slot__group-team-logo {
    width: 20px;
    height: 20px;
}

.sports-slot__group-team > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* ── Bracket ─────────────────────────────────────────────────────────────── */

.sports-slot__bracket-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    padding: 1rem 1.15rem 1.15rem;
}

.sports-slot__sub-tabs-wrapper {
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.2rem;
}

.sports-slot__sub-tabs {
    display: flex;
    gap: 0.3rem;
    width: max-content;
}

.sports-slot__sub-tab {
    padding: 0.3rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-pill);
    background: var(--bg);
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 150ms, color 150ms, border-color 150ms;
}

.sports-slot__sub-tab--active {
    background: var(--bg-light);
    color: var(--text-primary);
    border-color: var(--border);
}

.sports-slot__bracket-matches-grid,
.sports-slot__bracket-grid {
    display: grid;
    gap: 0.65rem;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.sports-slot__bracket-match {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--bg) 98%, var(--text-primary) 2%);
    padding: 0.55rem 0.7rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sports-slot__bracket-match--live {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 4%, var(--bg) 96%);
}

.sports-slot__bracket-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.84rem;
}

.sports-slot__bracket-team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sports-slot__bracket-team strong {
    font-weight: 800;
}

.sports-slot__bracket-match-status {
    font-size: 0.72rem;
    color: var(--text-secondary);
    text-align: right;
    border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    padding-top: 0.2rem;
    margin-top: 0.2rem;
}

.sports-slot__empty-stage {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem 0;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.sports-slot__footer {
    padding: 0.75rem 1.15rem 0.95rem;
    border-top: 1px solid color-mix(in srgb, var(--border) 86%, transparent);
}

.sports-slot__footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
}

.sports-slot__link,
.sports-slot__footer-note {
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.sports-slot__link {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}

.sports-slot__footer-debug {
    color: var(--text-secondary);
    font-size: 0.78rem;
    opacity: 0.9;
}

.sports-slot__link:hover {
    color: var(--text-link);
}

/* ── Native full-width density boosts ───────────────────────────────────── */
@container (min-width: 760px) {
    .sports-slot__mini-games--grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }

    .sports-slot__bracket-matches-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

/* ── Abbreviation tooltips (GP, GD, Pts, etc.) ─────────────────────────── */

.sports-slot__abbr {
    text-decoration: underline dotted;
    text-underline-offset: 2px;
    cursor: help;
}

/* ── Expanded soccer group tables ──────────────────────────────────────── */

.sports-slot__group-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-inline: -0.15rem;
    padding-inline: 0.15rem;
}

.sports-slot__group-table--soccer {
    display: grid;
    grid-template-columns:
        max-content
        1.75rem
        1.45rem
        1.45rem
        1.45rem
        1.75rem
        1.75rem
        2rem
        2rem;
    column-gap: 0.3rem;
    min-width: 100%;
    width: max-content;
}

.sports-slot__group-row--soccer {
    display: grid;
    grid-template-columns: subgrid;
    grid-column: 1 / -1;
    gap: 0;
    font-size: 0.72rem;
    align-items: center;
}

.sports-slot__group-row--soccer.sports-slot__group-row--head {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
}

.sports-slot__group-row--soccer > span:not(.sports-slot__group-team),
.sports-slot__group-row--soccer > strong {
    justify-self: center;
    text-align: center;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sports-slot__group-row--soccer.sports-slot__group-row--head > span:not(:first-child) {
    justify-self: center;
    text-align: center;
}

.sports-slot__group-row--soccer .sports-slot__group-team {
    width: max-content;
    max-width: max-content;
    overflow: visible;
}

.sports-slot__group-row--soccer .sports-slot__group-team > span {
    overflow: visible;
    text-overflow: unset;
    white-space: nowrap;
}

.sports-slot__group-row--soccer strong {
    font-weight: 800;
}

/* ── Match facts strip ───────────────────────────────────────────────────── */

.sports-slot__match-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.6rem;
    margin-top: 0.75rem;
}

.sports-slot__match-fact {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.32rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-pill);
    background: var(--bg-light);
    font-size: 0.76rem;
    line-height: 1.2;
}

.sports-slot__match-fact-label {
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sports-slot__match-fact-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Match timeline ──────────────────────────────────────────────────────── */

.sports-slot__timeline {
    position: relative;
    display: flex;
    flex-direction: column;
    max-height: clamp(18rem, 58vh, 36rem);
    min-height: 0;
    padding: 0 0.85rem;
    overflow: hidden;
}

.sports-slot__timeline-scorebar {
    position: relative;
    top: auto;
    z-index: 3;
    flex-shrink: 0;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.65rem;
    margin: 0 -0.85rem 0.85rem;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-light) 92%, var(--bg) 8%);
    backdrop-filter: blur(8px);
}

.sports-slot__timeline-scorebar-team {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
}

.sports-slot__timeline-scorebar-team--home {
    justify-content: flex-end;
    text-align: right;
}

.sports-slot__timeline-scorebar-team--away {
    justify-content: flex-start;
}

.sports-slot__timeline-scorebar-team .sports-slot__team-mark {
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 2.25rem;
    border-radius: 8px;
}

.sports-slot__timeline-scorebar-team .sports-slot__team-mark-image {
    padding: 0.15rem;
}

.sports-slot__timeline-scorebar-abbr {
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sports-slot__timeline-scorebar-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    min-width: 5.5rem;
}

.sports-slot__timeline-scorebar-score {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.sports-slot__timeline-scorebar-vs {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sports-slot__timeline-scorebar-penalties {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--sports-radius-pill);
    background: color-mix(in srgb, var(--bg) 70%, var(--primary) 8%);
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 800;
}

.sports-slot__timeline-scorebar-penalties--live {
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--danger) 18%, transparent);
}

.sports-slot__timeline-scorebar-penalties-label {
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.sports-slot__timeline-score-pill {
    margin-left: auto;
    padding: 0.1rem 0.45rem;
    border-radius: 100px;
    background: color-mix(in srgb, var(--success) 14%, var(--bg) 86%);
    border: 1px solid color-mix(in srgb, var(--success) 35%, var(--border));
    color: var(--text-primary);
    font-size: 0.72rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.02em;
}

.sports-slot__timeline-event--left .sports-slot__timeline-card-head .sports-slot__timeline-score-pill {
    margin-left: 0;
    margin-right: auto;
    order: -1;
}

.sports-slot__timeline-body {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0.35rem 0 1.15rem;
    scrollbar-gutter: stable;
    -webkit-overflow-scrolling: touch;
}

.sports-slot__timeline-body::-webkit-scrollbar {
    width: 8px;
}

.sports-slot__timeline-body::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-secondary) 35%, transparent);
}

.sports-slot__timeline-body::-webkit-scrollbar-track {
    background: transparent;
}

.sports-slot__timeline-spine {
    position: absolute;
    top: 0.5rem;
    bottom: 0.5rem;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    border-radius: 999px;
    background: color-mix(in srgb, var(--border) 82%, var(--text-secondary) 18%);
    pointer-events: none;
    z-index: 0;
}

.sports-slot__timeline-events {
    position: relative;
    display: grid;
    gap: 0.85rem;
}

.sports-slot__timeline-event--enter {
    animation: sports-slot-timeline-enter 0.52s cubic-bezier(0.18, 0.86, 0.22, 1) both;
}

@keyframes sports-slot-timeline-enter {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

    .sports-slot__penalty-shot--enter .sports-slot__penalty-shot-core {
        animation: none;
    }
}

.sports-slot__timeline-event {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 18px minmax(0, 1fr);
    gap: 0.55rem;
    align-items: start;
}

.sports-slot__timeline-spacer {
    min-height: 1px;
}

.sports-slot__timeline-node {
    position: relative;
    justify-self: center;
    width: 10px;
    height: 10px;
    margin-top: 0.85rem;
    border-radius: 999px;
    border: 2px solid var(--bg-light);
    background: var(--sports-timeline-color, var(--primary));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--sports-timeline-color, var(--primary)) 28%, transparent);
    z-index: 1;
}

.sports-slot__timeline-card {
    position: relative;
    max-width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-card);
    background: var(--bg-light);
    font-size: 0.82rem;
}

.sports-slot__timeline-event--left .sports-slot__timeline-card {
    grid-column: 1;
    justify-self: end;
    width: min(100%, 22rem);
    text-align: right;
    border-left: 3px solid var(--sports-timeline-color, var(--primary));
}

.sports-slot__timeline-event--left .sports-slot__timeline-node {
    grid-column: 2;
}

.sports-slot__timeline-event--left .sports-slot__timeline-spacer {
    grid-column: 3;
}

.sports-slot__timeline-event--right .sports-slot__timeline-spacer {
    grid-column: 1;
}

.sports-slot__timeline-event--right .sports-slot__timeline-node {
    grid-column: 2;
}

.sports-slot__timeline-event--right .sports-slot__timeline-card {
    grid-column: 3;
    justify-self: start;
    width: min(100%, 22rem);
    text-align: left;
    border-right: 3px solid var(--sports-timeline-color, var(--primary));
}

.sports-slot__timeline-event--neutral {
    display: block;
    text-align: center;
}

.sports-slot__timeline-event--neutral .sports-slot__timeline-card {
    display: inline-block;
    width: min(100%, 20rem);
    margin: 0 auto;
    text-align: left;
    border-left: 3px solid var(--sports-timeline-color, var(--primary));
    border-right: 3px solid var(--sports-timeline-color, var(--primary));
}

.sports-slot__timeline-event--neutral .sports-slot__timeline-card-head,
.sports-slot__timeline-event--neutral .sports-slot__timeline-top {
    justify-content: flex-start;
}

.sports-slot__timeline-event--period {
    display: block;
    text-align: center;
}

.sports-slot__timeline-period-pill {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin: 0 auto;
    padding: 0.35rem 0.85rem;
    border: 1px dashed color-mix(in srgb, var(--primary) 35%, var(--border));
    border-radius: 100px;
    background: color-mix(in srgb, var(--primary) 8%, var(--bg) 92%);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.sports-slot__timeline-card--play {
    background: var(--bg);
    border-color: color-mix(in srgb, var(--border) 70%, transparent);
    font-size: 0.78rem;
}

.sports-slot__timeline-card--play .sports-slot__timeline-minute {
    font-size: 0.74rem;
    color: var(--text-secondary);
}

.sports-slot__timeline-card--play .sports-slot__timeline-text {
    color: var(--text-secondary);
}

.sports-slot__timeline-card--goal {
    border-color: color-mix(in srgb, var(--success) 35%, var(--border));
}

.sports-slot__timeline-card--red {
    border-color: color-mix(in srgb, var(--danger) 35%, var(--border));
}

.sports-slot__timeline-card--yellow {
    border-color: color-mix(in srgb, var(--warning) 35%, var(--border));
}

.sports-slot__timeline-card--shootout-goal {
    border-color: color-mix(in srgb, var(--success) 45%, var(--border));
    background: color-mix(in srgb, var(--success) 8%, var(--bg-light) 92%);
}

.sports-slot__timeline-card--shootout-miss {
    border-color: color-mix(in srgb, var(--danger) 45%, var(--border));
    background: color-mix(in srgb, var(--danger) 6%, var(--bg-light) 94%);
}

.sports-slot__timeline-card-head {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.2rem;
}

.sports-slot__timeline-event--left .sports-slot__timeline-card-head {
    justify-content: flex-end;
}

.sports-slot__timeline-event--right .sports-slot__timeline-card-head,
.sports-slot__timeline-event--neutral .sports-slot__timeline-card-head {
    justify-content: flex-start;
}

.sports-slot__timeline-minute {
    font-weight: 800;
    color: var(--text-secondary);
}

.sports-slot__timeline-icon {
    line-height: 1;
}

.sports-slot__timeline-top {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: baseline;
}

.sports-slot__timeline-event--left .sports-slot__timeline-top {
    justify-content: flex-end;
}

.sports-slot__timeline-team {
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 700;
}

.sports-slot__timeline-text {
    display: block;
    color: var(--text-primary);
    margin-top: 0.15rem;
}

.sports-slot__timeline-assist {
    display: block;
    color: var(--text-secondary);
    font-size: 0.74rem;
    margin-top: 0.1rem;
}

.sports-slot__timeline-detail {
    margin: 0.25rem 0 0;
    color: var(--text-secondary);
    font-size: 0.74rem;
    line-height: 1.35;
}

.sports-slot__timeline-period {
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ── Recent form + head-to-head ─────────────────────────────────────────── */

.sports-slot__form-grid {
    display: grid;
    gap: 0.75rem;
    margin-top: 0.85rem;
    flex: 1;
}

.sports-slot__form-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.42rem;
}

.sports-slot__form-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 0.35rem 0.55rem;
    align-items: center;
    padding: 0.52rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-card);
    background: var(--bg-light);
    font-size: 0.78rem;
}

.sports-slot__form-result {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-weight: 800;
    font-size: 0.72rem;
    background: var(--bg-light);
}

.sports-slot__form-item--w .sports-slot__form-result {
    color: var(--success);
}

.sports-slot__form-item--l .sports-slot__form-result {
    color: var(--danger);
}

.sports-slot__form-item--d .sports-slot__form-result {
    color: var(--text-secondary);
}

.sports-slot__form-opponent {
    font-weight: 700;
}

.sports-slot__form-score {
    font-weight: 800;
}

.sports-slot__form-comp {
    grid-column: 2 / -1;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.sports-slot__h2h {
    margin-top: 0.85rem;
}

.sports-slot__h2h-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.sports-slot__h2h-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.45rem 0.65rem;
    align-items: center;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.8rem;
}

.sports-slot__h2h-date {
    color: var(--text-secondary);
    font-size: 0.72rem;
    white-space: nowrap;
}

.sports-slot__h2h-matchup {
    font-weight: 700;
}

.sports-slot__h2h-score {
    font-weight: 800;
}

.sports-slot__h2h-comp {
    grid-column: 1 / -1;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

/* ── Lineup pitch ────────────────────────────────────────────────────────── */

.sports-slot__lineup {
    padding: 1rem 1.15rem 1.15rem;
}

.sports-slot__pitch-wrap {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
    padding: 0.55rem;
    border-radius: calc(var(--sports-radius-card) + 4px);
    background: color-mix(in srgb, #0f1419 88%, var(--bg));
    box-shadow: 0 10px 28px color-mix(in srgb, #000000 24%, transparent);
}

.sports-slot__pitch {
    position: relative;
    width: 100%;
    aspect-ratio: 68 / 105;
    border-radius: var(--sports-radius-card);
    overflow: hidden;
    border: 1px solid #1a5c34;
    background:
        repeating-linear-gradient(
            0deg,
            #2f9a52 0,
            #2f9a52 8%,
            #268646 8%,
            #268646 16%
        );
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #9fe0b4 18%, transparent);
}

.sports-slot__pitch::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(0, 0, 0, 0.18) 100%
    );
    pointer-events: none;
    z-index: 1;
}

.sports-slot__pitch-team-bar {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    padding: 0.5rem 0.75rem;
    background: color-mix(in srgb, #101820 78%, transparent);
    backdrop-filter: blur(2px);
}

.sports-slot__pitch-team-bar--home {
    top: 0;
    border-bottom: 1px solid color-mix(in srgb, #ffffff 10%, transparent);
}

.sports-slot__pitch-team-bar--away {
    bottom: 0;
    border-top: 1px solid color-mix(in srgb, #ffffff 10%, transparent);
}

.sports-slot__pitch-team-name {
    font-size: 0.82rem;
    font-weight: 800;
    color: #f4fff7;
    letter-spacing: 0.01em;
}

.sports-slot__pitch-formation-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.18rem 0.62rem;
    border-radius: 100px;
    background: color-mix(in srgb, #1f6d3d 82%, #000000);
    border: 1px solid color-mix(in srgb, #8fd4a4 35%, transparent);
    color: #e8fff0;
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.sports-slot__pitch-surface {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.22;
    background:
        repeating-linear-gradient(
            90deg,
            color-mix(in srgb, #ffffff 16%, transparent) 0,
            color-mix(in srgb, #ffffff 16%, transparent) 1px,
            transparent 1px,
            transparent 12%
        );
}

.sports-slot__pitch-players {
    position: absolute;
    top: 6%;
    right: 0;
    bottom: 6%;
    left: 0;
    z-index: 2;
}

.sports-slot__pitch-center-circle,
.sports-slot__pitch-halfway,
.sports-slot__pitch-box {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.sports-slot__pitch-center-circle {
    top: 50%;
    left: 50%;
    width: 22%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    border: 1px solid color-mix(in srgb, #ffffff 48%, transparent);
    border-radius: 50%;
}

.sports-slot__pitch-halfway {
    top: 50%;
    left: 3%;
    right: 3%;
    height: 1px;
    background: color-mix(in srgb, #ffffff 48%, transparent);
}

.sports-slot__pitch-box {
    left: 20%;
    right: 20%;
    height: 17%;
    border: 1px solid color-mix(in srgb, #ffffff 42%, transparent);
}

.sports-slot__pitch-box--top {
    top: 0;
    border-top: 0;
}

.sports-slot__pitch-box--bottom {
    bottom: 0;
    border-bottom: 0;
}

.sports-slot__pitch-six-yard--top,
.sports-slot__pitch-six-yard--bottom {
    position: absolute;
    left: 38%;
    right: 38%;
    height: 7%;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    pointer-events: none;
    z-index: 1;
}

.sports-slot__pitch-six-yard--top {
    top: 0;
    border-top: none;
}

.sports-slot__pitch-six-yard--bottom {
    bottom: 0;
    border-bottom: none;
}

.sports-slot__pitch-penalty-arc--top,
.sports-slot__pitch-penalty-arc--bottom {
    position: absolute;
    left: 50%;
    width: 14%;
    aspect-ratio: 1;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 1;
}

.sports-slot__pitch-penalty-arc--top {
    top: 12.5%;
    clip-path: inset(50% 0 0 0);
}

.sports-slot__pitch-penalty-arc--bottom {
    bottom: 12.5%;
    clip-path: inset(0 0 50% 0);
}

.sports-slot__pitch-corner-arc {
    position: absolute;
    width: 5%;
    aspect-ratio: 1;
    border: 1.5px solid rgba(255, 255, 255, 0.85);
    pointer-events: none;
    z-index: 1;
}

.sports-slot__pitch-corner-arc--tl {
    left: -1px;
    top: -1px;
    border-left: none;
    border-top: none;
    border-radius: 0 0 100% 0;
}

.sports-slot__pitch-corner-arc--tr {
    right: -1px;
    top: -1px;
    border-right: none;
    border-top: none;
    border-radius: 0 0 0 100%;
}

.sports-slot__pitch-corner-arc--bl {
    left: -1px;
    bottom: -1px;
    border-left: none;
    border-bottom: none;
    border-radius: 0 100% 0 0;
}

.sports-slot__pitch-corner-arc--br {
    right: -1px;
    bottom: -1px;
    border-right: none;
    border-bottom: none;
    border-radius: 100% 0 0 0;
}

.sports-slot__pitch-goal--top,
.sports-slot__pitch-goal--bottom {
    position: absolute;
    left: 50%;
    width: 11%;
    height: 3px;
    transform: translateX(-50%);
    border: 1.5px solid rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
    z-index: 1;
}

.sports-slot__pitch-goal--top {
    top: -2px;
    border-bottom: none;
}

.sports-slot__pitch-goal--bottom {
    bottom: -2px;
    border-top: none;
}

.sports-slot__pitch-player {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.18rem;
    width: 72px;
    text-align: center;
    z-index: 2;
    outline: none;
}

.sports-slot__pitch-player-avatar {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid color-mix(in srgb, #ffffff 72%, #ffffff);
    box-shadow:
        0 2px 8px color-mix(in srgb, #000000 34%, transparent),
        inset 0 0 0 1px color-mix(in srgb, #ffffff 18%, transparent);
    transition: transform 0.15s ease;
}

.sports-slot__pitch-player:hover .sports-slot__pitch-player-avatar,
.sports-slot__pitch-player:focus-visible .sports-slot__pitch-player-avatar {
    transform: scale(1.15);
}

.sports-slot__pitch-player--captain .sports-slot__pitch-player-avatar {
    box-shadow: 0 0 0 2px #d9a441;
}

.sports-slot__pitch-player--card-yellow .sports-slot__pitch-player-avatar::after,
.sports-slot__pitch-player--card-red .sports-slot__pitch-player-avatar::after {
    content: "";
    position: absolute;
    right: -3px;
    bottom: -2px;
    width: 6px;
    height: 8px;
    border-radius: 1px;
    border: 1px solid rgba(0, 0, 0, 0.35);
    z-index: 2;
}

.sports-slot__pitch-player--card-yellow .sports-slot__pitch-player-avatar::after {
    background: #e8b923;
}

.sports-slot__pitch-player--card-red .sports-slot__pitch-player-avatar::after {
    background: #d3392f;
}

.sports-slot__pitch-player-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center 18%;
    opacity: 0;
    transition: opacity 0.2s ease;
    transform: scale(1.12);
}

.sports-slot__pitch-player-avatar--ready .sports-slot__pitch-player-image {
    opacity: 1;
}

.sports-slot__lineup-bench-item--ready .sports-slot__lineup-bench-image {
    opacity: 1;
}

.sports-slot__lineup-bench-item--ready .sports-slot__lineup-bench-fallback {
    opacity: 0;
}

.sports-slot__lineup-bench-item .sports-slot__lineup-bench-avatar .sports-slot__lineup-bench-fallback {
    position: absolute;
    inset: 0;
}

.sports-slot__pitch-player-initials,
.sports-slot__pitch-player-fallback {
    position: absolute;
    inset: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.74rem;
    font-weight: 800;
    color: #f4fff7;
}

.sports-slot__pitch-player-avatar--ready .sports-slot__pitch-player-initials,
.sports-slot__pitch-player-avatar--ready .sports-slot__pitch-player-fallback {
    opacity: 0;
}

.sports-slot__pitch-player-name {
    font-size: 0.6rem;
    font-weight: 800;
    line-height: 1.15;
    color: #f8fff9;
    text-shadow: 0 1px 3px color-mix(in srgb, #000000 72%, transparent);
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sports-slot__pitch-player-jersey {
    font-size: 0.54rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.sports-slot__pitch-player--out {
    opacity: 0.45;
}

.sports-slot__pitch-player--in .sports-slot__pitch-player-image,
.sports-slot__pitch-player--in .sports-slot__pitch-player-fallback {
    border-color: var(--success);
}

.sports-slot__lineup-bench-grid {
    display: grid;
    gap: 0.85rem;
    margin-top: 0.9rem;
}

@container (min-width: 720px) {
    .sports-slot__lineup-bench-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.sports-slot__lineup-bench-label {
    margin: 0 0 0.45rem;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sports-slot__lineup-bench-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.35rem;
}

.sports-slot__lineup-bench-item {
    display: grid;
    grid-template-columns: 32px 24px minmax(0, 1fr) auto;
    gap: 0.35rem 0.45rem;
    align-items: center;
    padding: 0.42rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-pill);
    background: var(--bg-light);
    font-size: 0.76rem;
}

.sports-slot__lineup-bench-item .sports-slot__lineup-bench-avatar,
.sports-slot__lineup-bench-item > .sports-slot__lineup-bench-fallback {
    position: relative;
    width: 32px;
    height: 32px;
    grid-column: 1;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg);
    border: 1px solid var(--border);
}

.sports-slot__lineup-bench-item .sports-slot__lineup-bench-avatar .sports-slot__lineup-bench-image {
    position: absolute;
    inset: 0;
}

.sports-slot__lineup-bench-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.sports-slot__lineup-bench-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 800;
    color: var(--text-secondary);
}

.sports-slot__lineup-bench-num {
    font-weight: 800;
    color: var(--text-secondary);
}

.sports-slot__lineup-bench-name {
    font-weight: 700;
}

.sports-slot__lineup-bench-pos {
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 700;
}

.sports-slot__lineup-bench-item--in {
    border-color: color-mix(in srgb, var(--success) 45%, var(--border));
}

.sports-slot__lineup-bench-item--out {
    opacity: 0.45;
}

.sports-slot__stats-list--dense {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 0.65rem 1.25rem;
}

@container (min-width: 900px) {
    .sports-slot__form-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@container (max-width: 720px) {
    .sports-slot__toolbar {
        flex-direction: column;
    }

    .sports-slot__toolbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .sports-slot__scoreboard-body {
        gap: 0.65rem;
    }

    .sports-slot__scoreboard-score {
        font-size: 1.4rem;
        white-space: nowrap;
    }

    .sports-slot__mini-game-top,
    .sports-slot__mini-game-score {
        flex-direction: column;
        align-items: flex-start;
    }

    .sports-slot__mini-game-score strong,
    .sports-slot__mini-game-status {
        text-align: left;
    }

    .sports-slot__table-row {
        grid-template-columns: 30px minmax(0, 1fr) 64px 48px 40px;
    }

    .sports-slot__pitch-player {
        width: 52px;
        gap: 0.1rem;
    }

    .sports-slot__pitch-player-avatar {
        width: 34px;
        height: 34px;
        border-width: 1.5px;
    }

    .sports-slot__pitch-player-fallback,
    .sports-slot__pitch-player-initials {
        font-size: 0.62rem;
    }

    .sports-slot__pitch-player-name {
        font-size: 0.52rem;
        max-width: 52px;
    }
}

@container (max-width: 480px) {
    .sports-slot__scoreboard {
        padding: 0.8rem;
    }

    .sports-slot__scoreboard-header {
        align-items: flex-start;
        gap: 0.5rem;
    }

    .sports-slot__scoreboard-header-status {
        flex-shrink: 0;
        text-align: end;
    }

    .sports-slot__scoreboard-body {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "home away"
            "score score";
        column-gap: 0.75rem;
        row-gap: 0.65rem;
    }

    .sports-slot__scoreboard-team--home {
        grid-area: home;
    }

    .sports-slot__scoreboard-team--away {
        grid-area: away;
    }

    .sports-slot__scoreboard-score {
        grid-area: score;
        width: 100%;
        padding-top: 0.65rem;
        border-top: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
        font-size: 1.5rem;
    }

    .sports-slot__scoreboard-team-name {
        font-size: 0.84rem;
    }

    .sports-slot__team-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }
}

@media (max-width: 480px) {
    .sports-slot__pitch-player {
        width: 44px;
    }

    .sports-slot__pitch-player-avatar {
        width: 22px;
        height: 22px;
    }

    .sports-slot__pitch-player-initials,
    .sports-slot__pitch-player-fallback {
        font-size: 0.52rem;
    }

    .sports-slot__pitch-player-name {
        font-size: 11px;
        padding: 0 4px;
        max-width: 40px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ── Non-soccer roster / lineup list styling ───────────────────────────────── */

.sports-slot__lineup-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 0.5rem;
    background: var(--bg);
}

.sports-slot__lineup-team-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: var(--sports-radius-card);
    background: var(--bg-light);
    border-top: 4px solid var(--team-brand-color, var(--primary));
}

.sports-slot__lineup-team-name {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text-primary);
}

.sports-slot__lineup-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.sports-slot__lineup-section-title {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    padding-bottom: 0.25rem;
}

.sports-slot__lineup-player-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.sports-slot__lineup-player-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg);
}

.sports-slot__lineup-player-avatar {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-light);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.sports-slot__lineup-player-avatar-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--text-secondary);
    background: var(--bg-light);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.sports-slot__lineup-player-avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sports-slot__lineup-player-num {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-secondary);
    min-width: 1.2rem;
}

.sports-slot__lineup-player-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sports-slot__lineup-player-pos {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: var(--bg-light);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
}

.result-episode-context {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}
