.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;
}

/* ── OSM Slot ─────────────────────────────────────────────── */

.osm-slot-wrap {
  margin-bottom: 12px;
  max-width: 680px;
}

.osm-slot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.osm-slot-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.osm-slot-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
  flex-shrink: 0;
}

.osm-slot-city {
  font-size: 0.72rem;
  color: var(--text-secondary);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.osm-slot-open {
  font-size: 0.7rem;
  color: var(--primary);
  text-decoration: none;
  flex-shrink: 0;
  white-space: nowrap;
}

.osm-slot-open:hover {
  text-decoration: underline;
}

.osm-map-container {
  width: 100%;
  height: 280px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

/* Fix Leaflet popup inside dark themes */
.leaflet-popup-content-wrapper {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  box-shadow: none !important;
}

.leaflet-popup-tip {
  background: var(--bg-light) !important;
}

.leaflet-popup-content {
  margin: 8px 12px !important;
  font-size: 0.8rem !important;
}

/* Fix Leaflet controls inside dark themes */
.leaflet-control-zoom a {
  background: var(--bg-light) !important;
  color: var(--text-primary) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--bg-hover) !important;
}

.leaflet-control-attribution {
  background: rgba(0,0,0,0.4) !important;
  color: var(--text-secondary) !important;
  font-size: 0.6rem !important;
}

.leaflet-control-attribution a {
  color: var(--primary) !important;
}

.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);
}

.wiki-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.5rem;
  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-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;
}

/* ── World Clock Slot Styling ────────────────────────── */

.time-result {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
}

.time-result .time-place {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.time-result .time-time {
    margin: 0 0 0.2rem 0;
    font-size: clamp(2.1rem, 5vw, 2.6rem);
    font-weight: 400;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.time-result .time-date {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.45;
}

.time-card__usage {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.time-card__usage code {
    font-size: 0.9em;
}

.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);
    }
}

.dict-card {
  max-width: 704px;
  color: var(--text-primary);
  padding: 0 0 8px 0;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

.dict-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.dict-word {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.dict-phonetic {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-family: ui-monospace, monospace;
  opacity: 0.85;
}

/* Entry groups */

.dict-entry-group {
  margin-bottom: 14px;
}

.dict-entry-group:last-of-type {
  margin-bottom: 8px;
}

.dict-pos {
  font-size: 0.82rem;
  font-style: italic;
  color: var(--link-color, #4a90e2);
  margin-bottom: 6px;
}

/* Definitions list */

.dict-definitions {
  margin: 0 0 8px 0;
  padding-left: 1.3rem;
}

.dict-definitions li {
  margin-bottom: 6px;
  line-height: 1.5;
}

.dict-definition {
  color: var(--text-primary);
  font-size: 0.95rem;
}

.dict-tag {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-hover, rgba(128, 128, 128, 0.1));
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 4px;
  vertical-align: middle;
}

.dict-example {
  font-size: 0.88rem;
  font-style: italic;
  color: var(--text-secondary);
  margin-top: 3px;
  margin-left: 0;
  line-height: 1.45;
}

/* Synonyms */

.dict-synonyms {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.dict-syn-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.dict-syn-chip {
  font-size: 0.8rem;
  color: var(--text-secondary);
  background: var(--bg-hover, rgba(128, 128, 128, 0.1));
  border: 1px solid var(--border-light, rgba(128, 128, 128, 0.2));
  border-radius: 20px;
  padding: 2px 10px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}

.dict-syn-chip:hover {
  background: var(--bg-active, rgba(128, 128, 128, 0.2));
  color: var(--text-primary);
}

/* Divider between groups */

.dict-entry-group + .dict-entry-group {
  border-top: 1px solid var(--border-light, rgba(128, 128, 128, 0.15));
  padding-top: 12px;
}

/* Hidden extra groups */

.dict-extra {
  display: none;
}

/* Show-more button */

.dict-more-btn {
  display: block;
  width: 100%;
  max-width: 704px;
  margin-top: 10px;
  padding: 8px 16px;
  background: var(--bg-hover, rgba(128, 128, 128, 0.08));
  border: 1px solid var(--border-light, rgba(128, 128, 128, 0.2));
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease;
}

.dict-more-btn:hover {
  background: var(--bg-active, rgba(128, 128, 128, 0.16));
}

.dict-more-arrow {
  font-size: 0.7rem;
  vertical-align: middle;
  display: inline-block;
  transition: transform 0.2s ease;
}

.dict-more-btn[aria-expanded="true"] .dict-more-arrow {
  transform: rotate(180deg);
}

/* Footer attribution */

.dict-footer {
  margin-top: 10px;
}

.dict-source-link {
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0.65;
  text-decoration: none;
}

.dict-source-link:hover {
  opacity: 1;
  text-decoration: underline;
}

.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;
  }
}

.currency-widget {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  max-width: 704px;
  color: var(--text-primary);
  padding: 0 0 8px 0;
}

.currency-header {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  line-height: 1.4;
}

.currency-result {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.15;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.currency-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  opacity: 0.75;
  margin-bottom: 18px;
}

.currency-inputs {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
}

.currency-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  gap: 12px;
}

.currency-from-input,
.currency-to-input {
  flex: 1;
  min-width: 0;
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--text-primary);
  background: transparent;
  border: none;
  outline: none;
  padding: 0;
  -moz-appearance: textfield;
}

.currency-from-input::-webkit-outer-spin-button,
.currency-from-input::-webkit-inner-spin-button,
.currency-to-input::-webkit-outer-spin-button,
.currency-to-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.currency-select-wrap {
  position: relative;
  flex-shrink: 0;
}

.currency-select-wrap::after {
  content: "▾";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1;
}

.currency-from-select,
.currency-to-select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--bg-hover, rgba(128, 128, 128, 0.08));
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 5px 26px 5px 9px;
  cursor: pointer;
  outline: none;
  max-width: 210px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
}

.currency-from-select:hover,
.currency-to-select:hover {
  border-color: var(--text-secondary);
}

.currency-loading .currency-from-select,
.currency-loading .currency-to-select {
  opacity: 0.5;
  pointer-events: none;
}

.currency-loading .currency-to-input {
  opacity: 0.4;
}

.currency-divider {
  height: 1px;
  background: var(--border-light);
  margin: 0;
}

/* ── TMDB Slot Plugin ──────────────────────────────────────────────────────── */

.tmdb-result {
  width: 100%;
  color: var(--text-primary);
  padding: 0 0 4px;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
}

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

.tmdb-img-combo {
  gap: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  overflow: hidden;
}

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

.tmdb-img-side {
  display: grid;
  grid-template-rows: 1fr 1fr;
  height: 100%;
}

.tmdb-combo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: var(--bg-light);
}

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

.tmdb-overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

/* ── Person: 3-column portrait grid ──────────────────────────────────────── */

.tmdb-person-grid,
.tmdb-img-combo {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-column: 1 / 3;
  gap: 0rem;
  margin-bottom: 1rem;
  border-radius: 13px;
  overflow: hidden;
  height: 300px;
}

.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;
}

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

.tmdb-person-info,
.tmdb-info-block {
  grid-column: 3 / 5;
  padding-bottom: 0.25rem;
}

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

.tmdb-plot,
.tmdb-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  border-radius: 13px;
  background-color: var(--bg-light);
  border: 1px solid var(--border);
  overflow: hidden;
  justify-content: space-between;
}

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

.tmdb-title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

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

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

.tmdb-ext-link {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--link-color, #1a73e8);
  text-decoration: none;
  margin-top: 0.25rem;
}

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

/* ── Metadata grid ────────────────────────────────────────────────────────── */

.tmdb-meta-grid {
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.tmdb-meta-cell {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  width: 100%;
}

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

.tmdb-meta-value {
  font-size: 0.8125rem;
  color: var(--text-primary);
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Cast horizontal scroll strip ────────────────────────────────────────── */

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

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

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

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

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

.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.4rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.tmdb-cast-name {
  padding: 0.4rem 0.35rem 0.1rem;
  font-size: 0.7rem;
  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.35rem 0.4rem;
  font-size: 0.65rem;
  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.5rem;
  margin-bottom: 0.75rem;
  scrollbar-width: none;
}

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

.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: 13px;
  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: 13px;
  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;
  -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.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  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;
}

/* ── 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: 13px;
  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-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── 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(--border-light);
}

.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 {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border-light);
  border-radius: 13px;
  text-decoration: none;
  color: var(--text-primary);
  background: var(--bg-light);
  transition:
    border-color 0.15s,
    background 0.15s;
  max-width: 100%;
}

.tmdb-jf-card:hover {
  border-color: var(--primary, #1a73e8);
  background: var(--bg-hover);
}

.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;
}

.glance-ai-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.glance-ai-title {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
}

.glance-ai-title .fa-robot {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.glance-ai-sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.5rem 0.25rem 0.25rem;
  border: none;
  border-radius: 1.5rem;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s;
}

.glance-ai-sources-toggle:hover {
  color: var(--text-primary);
}

.glance-ai-sources-toggle::after {
  content: "\25BE";
  font-size: 0.625rem;
  line-height: 1;
  transition: transform 0.15s;
}

.glance-ai-sources-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.glance-ai-stack {
  display: inline-flex;
  align-items: center;
}

.glance-ai-stack-icon {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--bg-hover);
  object-fit: contain;
}

.glance-ai-stack-icon + .glance-ai-stack-icon {
  margin-left: -6px;
}

.glance-ai-rail {
  display: flex;
  gap: 0.5rem;
  margin: -0.25rem 0 0.75rem;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.glance-ai-rail[hidden] {
  display: none;
}

.glance-ai-rail-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 0 0 11rem;
  padding: 0.5rem 0.625rem;
  border-radius: 0.5rem;
  background: var(--bg-hover);
  color: var(--text-primary);
  text-decoration: none;
  scroll-snap-align: start;
  transition: background 0.15s;
}

.glance-ai-rail-card:hover {
  background: rgba(var(--primary-rgb), 0.12);
  text-decoration: none;
}

.glance-ai-rail-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
}

.glance-ai-rail-icon {
  flex-shrink: 0;
  border-radius: 3px;
}

.glance-ai-rail-host {
  color: var(--text-secondary);
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-ai-rail-title {
  font-size: 0.75rem;
  line-height: 1.35;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glance-ai-body--clamped {
  min-height: 160px;
  max-height: 160px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 70%, transparent 100%);
}

.glance-ai-body .glance-snippet > :first-child {
  margin-top: 0;
}

.glance-ai-body .glance-snippet p,
.glance-ai-reply p {
  margin: 0 0 0.75rem;
  line-height: 1.65;
}

.glance-ai-body .glance-snippet h2,
.glance-ai-body .glance-snippet h3,
.glance-ai-reply h2,
.glance-ai-reply h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.glance-ai-body .glance-snippet ul,
.glance-ai-body .glance-snippet ol,
.glance-ai-reply ul,
.glance-ai-reply ol {
  margin: 0 0 0.75rem;
  padding-inline-start: 1.15rem;
}

.glance-ai-body .glance-snippet li,
.glance-ai-reply li {
  margin-bottom: 0.35rem;
  line-height: 1.6;
}

.glance-ai-body .glance-snippet li::marker,
.glance-ai-reply li::marker {
  color: var(--text-secondary);
}

.glance-ai-body .glance-snippet table,
.glance-ai-reply table {
  display: block;
  width: max-content;
  max-width: 100%;
  margin: 0 0 0.75rem;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.glance-ai-body .glance-snippet th,
.glance-ai-body .glance-snippet td,
.glance-ai-reply th,
.glance-ai-reply td {
  padding: 0.375rem 0.625rem;
  text-align: start;
  vertical-align: top;
}

.glance-ai-body .glance-snippet thead th,
.glance-ai-reply thead th {
  background: var(--bg-hover);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.glance-ai-body .glance-snippet tbody tr:nth-child(even),
.glance-ai-reply tbody tr:nth-child(even) {
  background: var(--bg-hover);
}

.glance-ai-body .glance-snippet code,
.glance-ai-reply code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--bg-hover);
  font-size: 0.8125em;
}

.glance-ai-body .glance-snippet pre,
.glance-ai-reply pre {
  margin: 0 0 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.5rem;
  background: var(--bg-hover);
  overflow-x: auto;
}

.glance-ai-body .glance-snippet pre code,
.glance-ai-reply pre code {
  padding: 0;
  background: none;
}

.glance-ai-body .glance-snippet blockquote,
.glance-ai-reply blockquote {
  margin: 0 0 0.75rem;
  padding: 0.125rem 0 0.125rem 0.75rem;
  border-inline-start: 2px solid var(--border);
  color: var(--text-secondary);
}

.glance-ai-body .glance-snippet hr,
.glance-ai-reply hr {
  margin: 1rem 0;
  border: none;
  height: 1px;
  background: var(--border);
}

.glance-ai-key {
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(var(--primary-rgb), 0.16);
  color: var(--text-primary);
  font-weight: 600;
}

.glance-ai.degoog-panel {
  overflow: visible;
  position: relative;
  background: transparent;
}

.glance-ai:has(.glance-ai-collapse:not([hidden])) {
  padding-bottom: 1.5rem;
  margin-bottom: 1rem;
}

.glance-ai-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--white);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s;
  border: 2px solid var(--primary);
  border-radius: 2rem;
}

.glance-ai-expand::after {
  content: "\25BE";
  font-size: 0.75rem;
  line-height: 1;
}

.glance-ai-expand:hover {
  color: var(--text-primary);
}

.glance-ai-expand[hidden],
.glance-ai-collapse[hidden] {
  display: none;
}

.glance-ai-collapse {
  position: absolute;
  left: 50%;
  bottom: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  width: auto;
  margin: 0;
  padding: 0.35rem 0.9rem;
  border: none;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  transform: translate(-50%, 50%);
  transition: color 0.15s;
}

.glance-ai-collapse::after {
  content: "\25BE";
  font-size: 0.75rem;
  line-height: 1;
  transform: rotate(180deg);
}

.glance-ai-collapse:hover {
  color: var(--text-primary);
}

.glance-ai-cite {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  vertical-align: baseline;
  margin: 0 2px;
  padding: 0 4px;
  max-width: 12rem;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s;
}

.glance-ai-cite:hover,
.glance-ai-cite--open {
  background: var(--bg-hover);
}

.glance-ai-cite-favicon {
  flex-shrink: 0;
  border-radius: 2px;
  vertical-align: middle;
}

.glance-ai-cite-host {
  font-size: 0.6875rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-ai-cite-more {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  opacity: 0.8;
}

.glance-ai-pop {
  display: none;
  position: fixed;
  z-index: 9999;
  width: 17rem;
  max-height: 20rem;
  overflow-y: auto;
  padding: 0.375rem;
  border-radius: 0.5rem;
  background: var(--bg-light);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22);
  pointer-events: none;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--text-primary);
}

.glance-ai-pop--visible {
  display: block;
}

.glance-ai-pop--pinned {
  pointer-events: auto;
}

.glance-ai-pop-label {
  padding: 0.25rem 0.375rem;
  color: var(--text-secondary);
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.glance-ai-pop-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.375rem;
  border-radius: 0.375rem;
  color: var(--text-primary);
  text-decoration: none;
}

.glance-ai-pop--pinned .glance-ai-pop-row:hover {
  background: rgba(var(--primary-rgb), 0.12);
  text-decoration: none;
}

.glance-ai-pop-head {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-secondary);
}

.glance-ai-pop-host {
  font-size: 0.625rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.glance-ai-pop-title {
  font-weight: 500;
  display: -webkit-box;
  line-clamp: 2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glance-ai-pop-snippet {
  color: var(--text-secondary);
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.glance-ai-messages {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.glance-ai-chat {
  margin-top: 0.75rem;
}

@property --glance-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

.glance-ai-input-wrap--styled {
  position: relative;
  padding: 2px;
  border-radius: 0.5rem;
}

.glance-ai-input-wrap--styled::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: conic-gradient(
    from var(--glance-angle),
    var(--brand-blue, var(--primary)),
    var(--danger),
    var(--brand-yellow, var(--warning)),
    var(--success),
    var(--brand-blue, var(--primary))
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.glance-ai-input-wrap--styled:focus-within::before {
  opacity: 1;
  animation: glance-ai-spin 4s linear infinite;
}

@keyframes glance-ai-spin {
  to {
    --glance-angle: 360deg;
  }
}

.glance-ai-input {
  position: relative;
  width: 100%;
  min-height: 5rem;
  resize: none;
}

.glance-ai-reply {
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 0.875rem;
}

.glance-ai-reply.glance-ai-user {
  align-self: flex-end;
  max-width: 78%;
  background: var(--bg-hover);
  border-radius: 1rem 0 1rem 1rem;
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  display: block;
  width: auto;
}

.glance-ai-typing {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

.glance-ai-skeleton {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.glance-ai-skeleton .skeleton-line--snippet {
  width: 100%;
}

.glance-ai-skeleton .skeleton-line--snippet-short {
  width: 55%;
}

.glance-ai-writing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.8125rem;
}

.glance-ai-writing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
  animation: glance-ai-pulse 1.2s ease-in-out infinite;
}

.glance-ai-writing span:nth-child(2) {
  animation-delay: 0.2s;
}
.glance-ai-writing span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes glance-ai-pulse {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.glance-ai-thinking-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  opacity: 0.7;
}

.glance-ai-thinking-stream {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-style: italic;
  opacity: 0.75;
  white-space: pre-wrap;
  max-height: 12em;
  overflow-y: auto;
  border-left: 2px solid var(--text-secondary);
  padding: 0.25rem 0.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .glance-ai-input-wrap--styled:focus-within::before {
    animation: none;
  }

  .glance-ai-writing span {
    animation: none;
  }
}

/* ── 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;
    }
}

.lyrics-widget {
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  color: var(--text-primary);
  max-width: 100%;
  width: 100%;
}

/* ── Header ─────────────────────────────────────────────── */
.lyrics-header {
  margin-bottom: 0.75rem;
}

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

/* ── Track info ──────────────────────────────────────────── */
.lyrics-track-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.75rem;
}

.lyrics-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.lyrics-artist {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Lyrics lines ────────────────────────────────────────── */
.lyrics-preview,
.lyrics-full {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.lyrics-preview {
  margin-bottom: 0.5rem;
}

.lyrics-line {
  display: block;
  font-size: 0.875rem;
  line-height: 1.7;
  color: var(--text-primary);
}

/* ── Expand toggle ───────────────────────────────────────── */
.lyrics-details {
  margin-bottom: 0.75rem;
}

.lyrics-show-all {
  font-size: 0.875rem;
  color: var(--link-color);
  cursor: pointer;
  list-style: none;
  user-select: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.lyrics-show-all::-webkit-details-marker {
  display: none;
}

.lyrics-show-all::after {
  content: "›";
  font-size: 1rem;
  line-height: 1;
}

details[open] .lyrics-show-all::after {
  content: "‹";
}

.lyrics-full {
  max-height: 400px;
  overflow-y: auto;
  padding: 0.75rem 0 0.25rem;
  border-top: 1px solid var(--border-light, var(--border-color));
  margin-top: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--text-secondary) transparent;
}

.lyrics-full::-webkit-scrollbar {
  width: 4px;
}

.lyrics-full::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  border-radius: 2px;
  opacity: 0.4;
}

/* ── Source attribution ──────────────────────────────────── */
.lyrics-source {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
}

.lyrics-source-link {
  color: var(--link-color);
  text-decoration: none;
}

.lyrics-source-link:hover {
  text-decoration: underline;
}

/* ── Loading / pending state ─────────────────────────────── */
.lyrics-widget--pending .lyrics-loading {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  min-height: 2rem;
}

.lyrics-loading-dot {
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--link-color);
  flex-shrink: 0;
  animation: lyrics-pulse 1.2s ease-in-out infinite;
}

@keyframes lyrics-pulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }
  50% {
    opacity: 1;
    transform: scale(1.15);
  }
}

.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;
}

.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;
}

/* ── Timer & Stopwatch Plugin ────────────────────────────────────────────── */

.timer-widget {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 704px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  user-select: none;
}

/* ── Header ──────────────────────────────────────────────────────────────── */

.timer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px 10px 10px;
  border-bottom: 1px solid var(--border);
}

.timer-tabs {
  display: flex;
  gap: 4px;
}

.timer-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: 20px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s;
}

.timer-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.timer-tab--active {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.timer-tab--active svg {
  color: var(--text-link);
}

.timer-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.timer-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
  transition:
    background 0.15s,
    color 0.15s;
}

.timer-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.timer-icon-btn[aria-pressed="true"] {
  color: var(--text-link);
}

/* ── Body / Circle ───────────────────────────────────────────────────────── */

.timer-body {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px 20px;
}

.timer-circle-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
}

.timer-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 200px;
  height: 200px;
}

.timer-track {
  stroke: var(--border-light);
}

.timer-progress {
  stroke: var(--text-link);
  /* circumference = 2π × 54 ≈ 339.29 */
  stroke-dasharray: 339.29;
  stroke-dashoffset: 0;
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
  transition: stroke-dashoffset 0.85s linear;
}

.timer-progress--instant {
  transition: none;
}

.timer-display-wrap {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.timer-display {
  font-size: 2.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-primary);
  cursor: pointer;
  line-height: 1;
}

.timer-display:hover {
  opacity: 0.8;
}

/* Stopwatch mode: display is not editable */
.timer-widget[data-mode="stopwatch"] .timer-display {
  cursor: default;
}

.timer-widget[data-mode="stopwatch"] .timer-display:hover {
  opacity: 1;
}

.timer-display-input {
  font-size: 2rem;
  font-weight: 600;
  width: 120px;
  text-align: center;
  background: none;
  border: none;
  border-bottom: 2px solid var(--text-link);
  color: var(--text-primary);
  outline: none;
  padding: 0 4px;
  line-height: 1;
  font-family: inherit;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */

.timer-footer {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--border);
}

.timer-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 15px;
  border: none;
  border-radius: 0;
  background: none;
  color: var(--text-primary);
  cursor: pointer;
  transition: background 0.15s;
  font-size: 1rem;
}

.timer-action-btn:hover {
  background: var(--bg-hover);
}

.timer-action-btn:active {
  background: var(--border);
}

.timer-action-btn + .timer-action-btn {
  border-left: 1px solid var(--border);
}

/* ── Fullscreen ──────────────────────────────────────────────────────────── */

.timer-widget--fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh;
  border-radius: 0;
  border: none;
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.timer-widget--fullscreen .timer-header {
  width: 100%;
  max-width: 560px;
}

.timer-widget--fullscreen .timer-body {
  flex: 1;
  padding: 0;
}

.timer-widget--fullscreen .timer-circle-wrap {
  width: min(60vh, 60vw);
  height: min(60vh, 60vw);
}

.timer-widget--fullscreen .timer-svg {
  width: min(60vh, 60vw);
  height: min(60vh, 60vw);
}

.timer-widget--fullscreen .timer-display {
  font-size: clamp(2rem, 8vw, 5rem);
}

.timer-widget--fullscreen .timer-footer {
  width: 100%;
  max-width: 560px;
  border-radius: 0 0 14px 14px;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  overflow: hidden;
}

/* ── Calculator Plugin ─────────────────────────────────────────────────────── */

.calc-widget {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  max-width: 704px;
  padding: 0 0 4px 0;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  user-select: none;
  overflow: hidden;
}

/* Display */
.calc-display {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 14px 16px 10px 16px;
  min-height: 72px;
  gap: 8px;
  border: 1px solid var(--border-light);
  border-radius: 13px;
}

.calc-history-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  color: var(--text-secondary);
  border-radius: 6px;
  flex-shrink: 0;
  align-self: flex-start;
  margin-top: 2px;
  line-height: 0;
  transition:
    color 0.15s,
    background 0.15s;
}

.calc-history-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.calc-display-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.calc-expr {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: right;
  word-break: break-all;
  min-height: 1.4em;
  max-height: 3em;
  overflow: hidden;
  line-height: 1.4;
}

.calc-result {
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--text-primary);
  text-align: right;
  line-height: 1.1;
  word-break: break-all;
}

.calc-result--small {
  font-size: 1.6rem;
}

.calc-result--error {
  font-size: 1.4rem;
  color: var(--text-secondary);
}

/* History Panel */
.calc-history-panel {
  padding: 6px 0;
  max-height: 160px;
  overflow-y: auto;
}

.calc-history-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.85rem;
  padding: 12px 16px;
}

.calc-history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 16px;
  cursor: pointer;
  transition: background 0.12s;
  gap: 12px;
}

.calc-history-item:hover {
  background: var(--border-light);
}

.calc-history-expr {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calc-history-val {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Grid */
.calc-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0.5rem;
  border: 1px solid var(--border-light);
  background-color: var(--bg-light);
  border-radius: 13px;
}

.calc-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

/* Buttons */
.calc-btn {
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 400;
  height: 42px;
  padding: 0 4px;
  transition:
    background 0.12s,
    filter 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  line-height: 1;
}

button.calc-btn {
  border-radius: 13px;
}

.button-group button.calc-btn:first-child {
  border-radius: 13px 0 0 13px;
}
.button-group button.calc-btn:last-child {
  border-radius: 0 13px 13px 0;
}

.calc-row .button-group {
  grid-column: span 2;
}

.calc-btn sup {
  font-size: 0.6em;
  line-height: 1;
}

.calc-btn--digit {
  background: var(--bg-hover, var(--border-light));
  color: var(--text-primary);
}

.calc-btn--digit:hover {
  filter: brightness(1.15);
}

.calc-btn--digit:active {
  filter: brightness(0.9);
}

.calc-btn--sci {
  background: transparent;
  color: var(--text-secondary);
}

.calc-btn--sci:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--sci:active {
  filter: brightness(0.85);
}

.calc-btn--op {
  background: transparent;
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.calc-btn--op:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--op:active {
  filter: brightness(0.85);
}

.calc-btn--clear {
  background: transparent;
  color: var(--text-secondary);
  font-weight: 500;
}

.calc-btn--clear:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--equals {
  background: var(--text-link);
  color: #202124;
  font-size: 1.1rem;
  font-weight: 500;
}

.calc-btn--equals:hover {
  background: var(--text-link-hover);
}

.calc-btn--equals:active {
  background: var(--text-link-active);
}

/* Deg/Rad toggle */
.calc-btn--toggle {
  background: transparent;
  color: var(--text-secondary);
  border-radius: 32px;
  font-size: 0.82rem;
}

.calc-btn--toggle.calc-btn--active {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 500;
}

.calc-btn--toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Inv active */
.calc-btn--inv {
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.calc-btn--inv:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.calc-btn--inv.calc-btn--active {
  background: var(--bg-hover);
  color: var(--text-primary);
  font-weight: 500;
}

/* Footer */
.calc-footer {
  text-align: center;
  padding: 6px 0 2px;
}

.calc-footer-link {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color 0.15s;
}

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

/* ── Reddit Slot Panel ─────────────────────────────────────── */

.rslot-panel {
  padding: 4px 0 12px;
  margin-bottom: 4px;
  max-width: 680px;
}

.rslot-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.rslot-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.rslot-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
}

/* Post card */
.rslot-post {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 14px 16px;
  text-decoration: none;
  margin-bottom: 12px;
  transition: border-color 0.15s, background 0.15s;
}

.rslot-post:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.rslot-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rslot-post-sub {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.rslot-post-stats {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.rslot-post-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.45;
}

/* Comments label */
.rslot-comments-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* Comments grid — scrollable on mobile */
.rslot-comments-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

@media (max-width: 600px) {
  .rslot-comments-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .rslot-comments-row::-webkit-scrollbar {
    display: none;
  }
  .rslot-comment {
    flex: 0 0 85%;
    scroll-snap-align: start;
    min-width: 0;
  }
}

.rslot-comment {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 13px 15px;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.rslot-comment:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.rslot-comment--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: default;
}

.rslot-comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.rslot-comment-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 70%;
}

.rslot-comment-score {
  font-size: 12px;
  color: var(--text-secondary);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 3px;
}

.rslot-comment-body {
  font-size: 14px;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 480px) {
  .rslot-comments-row { grid-template-columns: 1fr; }
}

@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;
}

.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);
    }
}

.qr-result .qr-label {
  word-break: break-all;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.qr-result .qr-image {
  display: block;
  border-radius: 8px;
}

/* Match LiterallyGoogle suggestion icon column (theme ::before at 0.8rem, 1.125rem). */
.ac-item--bang {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.5rem;
    padding-inline-end: 0.75rem;
    padding-inline-start: 2.75rem;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 400;
}

.ac-item--bang .ac-item-icon {
    position: absolute;
    inset-inline-start: 0.8rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-secondary);
}

.ac-item--bang .ac-item-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}

.ac-item--bang::before {
    content: none !important;
    display: none !important;
}

.ac-item--bang .ac-item-copy {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    overflow: hidden;
}

.ac-item--bang .ac-item-bang-trigger {
    flex: none;
    flex-shrink: 0;
    min-width: max-content;
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
    font-weight: 700;
    color: var(--primary);
}

.ac-item--bang .ac-item-bang-name {
    flex-shrink: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--text-primary);
}

.ac-item--bang .ac-item-bang-desc {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-secondary);
    font-size: 0.88em;
}

.ac-item--bang:hover,
.ac-item--bang.active,
.ac-item--bang.ac-active,
.ac-item--bang.ac-item--bang-active {
    background: var(--bg-hover);
}

.auto-bang-help code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.92em;
}

/* Match LiterallyGoogle suggestion icon column (theme ::before at 0.8rem, 1.125rem). */
.ac-item--history {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-block: 0.5rem;
    padding-inline-end: 0.75rem;
    padding-inline-start: 2.75rem;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 400;
}

.ac-item--history .ac-item-icon {
    position: absolute;
    inset-inline-start: 0.8rem;
    inset-block-start: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.125rem;
    height: 1.125rem;
    color: var(--text-secondary);
}

.ac-item--history .ac-item-icon svg {
    width: 1.125rem;
    height: 1.125rem;
    display: block;
}

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

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

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

.ac-item--history .ac-item-delete svg {
    width: 1rem;
    height: 1rem;
    display: block;
}

.ac-item--history:hover,
.ac-item--history.active,
.ac-item--history.ac-active,
.ac-item--history.selected {
    background: var(--bg-hover);
}

.search-history-result__shell {
    box-sizing: border-box;
    width: min(
        calc(100% - var(--search-history-content-inline-start, 0px)),
        var(
            --degoog-results-rail-inline-size,
            var(--literallygoogle-results-rail-inline-size, 42rem)
        )
    );
    margin-inline-start: var(
        --search-history-content-inline-start,
        var(
            --degoog-results-content-inline-start,
            var(--literallygoogle-results-content-inline-start, 0px)
        )
    );
    margin-inline-end: auto;
}

/* Core centers generic command cards. History owns its rail and starts at the
   same inline edge as the active search field instead. */
.search-history-result.command-result {
    align-self: stretch;
    box-sizing: border-box;
    width: 100%;
    max-width: none;
    margin-inline: 0;
    padding-inline: 0;
}

.search-history-result__heading {
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.35;
}

.search-history-result__list {
    display: flex;
    flex-direction: column;
}

.search-history-result__item {
    min-width: 0;
    padding: 0.85rem 0;
    border-block-end: 1px solid var(--border-light);
}

.search-history-result__item:last-child {
    border-block-end: 0;
}

.search-history-result__meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    margin-block-end: 0.3rem;
}

.search-history-result__clock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    flex-shrink: 0;
    color: var(--text-cite);
}

.search-history-result__clock svg {
    width: 1.125rem;
    height: 1.125rem;
}

.search-history-result__timestamp {
    min-width: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.8125rem;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-history-result__title {
    display: inline-block;
    max-width: 100%;
    overflow-wrap: anywhere;
    color: var(--text-link);
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.35;
    text-decoration: none;
}

.search-history-result__title:hover {
    text-decoration: underline;
}

.search-history-result .history-delete-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    flex-shrink: 0;
    margin-inline-start: auto;
    padding: 0;
    border: none;
    background: none;
    font: inherit;
    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: 1rem;
    height: 1rem;
}

.search-history-result__pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0.95rem 0 0.05rem;
    border-top: 1px solid var(--border-light);
    padding-top: 0.8rem;
}

.search-history-result__pager-status {
    color: var(--text-secondary);
    font-size: 0.875rem;
    min-width: 0;
    text-align: center;
    flex: 1;
}

.search-history-result__pager-btn {
    appearance: none;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: 0.45rem 0.9rem;
    background: var(--primary);
    color: var(--white);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.search-history-result__pager-btn:hover,
.search-history-result__pager-btn:focus-visible {
    background: var(--primary-hover);
}

.search-history-result__pager-btn:active {
    transform: translateY(1px);
}

.search-history-result__pager-btn:disabled {
    background: color-mix(in srgb, var(--border-light) 35%, transparent);
    color: var(--text-secondary);
    cursor: not-allowed;
}

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

#results-layout:has(#fourplay-status) #sidebar-col {
  display: none;
}

#results-layout:has(#fourplay-status) #results-main {
  max-width: none;
}

.fourplay-command {
  width: 100%;
  max-width: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 0.5rem 0 2rem;
}

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

.fourplay-heading {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.fourplay-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.75rem;
  background: var(--bg-light);
  color: var(--primary);
  font-size: 1.125rem;
}

.fourplay-heading-text {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.fourplay-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.2;
}

.fourplay-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.fourplay-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.fourplay-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--text-secondary);
  flex-shrink: 0;
}

.fourplay-dot[data-tone="success"] {
  background: var(--success);
}

.fourplay-dot[data-tone="danger"] {
  background: var(--danger);
}

.fourplay-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.875rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--btn-bg);
  color: var(--btn-text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.fourplay-btn[hidden],
.degoog-icon-btn[hidden] {
  display: none;
}

.fourplay-btn:hover {
  background: var(--bg-hover);
}

.fourplay-btn--danger {
  color: var(--danger);
}

.fourplay-btn--firefox {
  text-decoration: none;
  background: var(--primary);
  color: var(--white);
}

.fourplay-btn--firefox:hover {
  background: var(--primary-hover);
}

.fourplay-session-solve {
  flex-shrink: 0;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
}

.fourplay-refresh {
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  background: var(--bg-light);
  font-size: 0.875rem;
}

.fourplay-test-result {
  padding: 0.75rem 1rem;
  border-radius: 0.5rem;
  background: var(--bg-light);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.fourplay-test-result[hidden] {
  display: none;
}

.fourplay-test-result[data-tone="success"] {
  color: var(--success);
}

.fourplay-test-result[data-tone="danger"] {
  color: var(--danger);
}

.fourplay-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.fourplay-body {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.fourplay-tiles.degoog-grid {
  gap: 1rem;
}

.fourplay-tile.degoog-panel {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  padding: 1.125rem 1.25rem;
}

.fourplay-tile-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.fourplay-tile-value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}

.fourplay-tile-value[data-tone="success"] {
  color: var(--success);
}

.fourplay-tile-value[data-tone="danger"] {
  color: var(--danger);
}

.fourplay-tile-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.fourplay-section-head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-top: 0.25rem;
}

.fourplay-section-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-primary);
}

.fourplay-section-head [data-show-tagalong] {
  margin-left: auto;
}

.fourplay-modal-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.fourplay-sessions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.fourplay-session.degoog-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem 1.25rem;
}

.fourplay-session-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.fourplay-session-origin {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow-wrap: anywhere;
}

.fourplay-session-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.fourplay-session-state.degoog-badge {
  flex-shrink: 0;
  padding: 0.3rem 0.625rem;
  font-weight: 600;
}

.fourplay-session-state[data-tone="success"] {
  color: var(--success);
}

.fourplay-session-state[data-tone="danger"] {
  color: var(--danger);
}

.fourplay-session-clear {
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  flex-shrink: 0;
}

.fourplay-session-clear:hover {
  color: var(--danger);
  background: var(--bg-hover);
}

.fourplay-hero.degoog-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  padding: 3.5rem 2rem;
  text-align: center;
}

.fourplay-hero-icon {
  font-size: 2rem;
  color: var(--text-secondary);
}

.fourplay-hero-text {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  max-width: 34rem;
  line-height: 1.55;
}

.fourplay-hero .fourplay-btn {
  margin-top: 0.25rem;
  background: var(--primary);
  color: var(--white);
}

.fourplay-hero .fourplay-btn:hover {
  background: var(--primary-hover);
}

.fourplay-footer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.fourplay-busy {
  pointer-events: none;
}

@media (max-width: 480px) {
  .fourplay-session.degoog-panel {
    flex-wrap: wrap;
  }

  .fourplay-session-state.degoog-badge {
    order: 3;
  }
}

.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;
}

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;
}

/* ── Translate Command ───────────────────────────────────── */
.trc-wrap {
  max-width: 680px;
  margin-bottom: 12px;
  font-family: var(--font-sans, sans-serif);
}

.trc-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.trc-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-primary);
}

.trc-card {
  border: 1px solid var(--border-light);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color 0.2s;
}

.trc-card:focus-within {
  border-color: var(--primary);
}

.trc-card-top {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg);
  display: flex;
  align-items: center;
}

.trc-select {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 100%;
}

.trc-select:focus { outline: none; }

.trc-card-body {
  padding: 14px 16px;
}

.trc-textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.95rem;
  color: var(--text-primary);
  resize: none;
  height: 90px;
  font-family: var(--font-sans, sans-serif);
  line-height: 1.7;
}

.trc-textarea::placeholder { color: var(--text-secondary); }
.trc-textarea.trc-result { color: var(--text-secondary); }

.trc-card-footer {
  display: flex;
  gap: 6px;
  padding: 0 14px 12px;
  justify-content: flex-end;
}

.trc-foot-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.trc-foot-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border);
}

.trc-action {
  display: flex;
  justify-content: center;
  margin: 6px 0;
}

.trc-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  border-radius: 9px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--font-sans, sans-serif);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.trc-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.trc-btn:active { transform: scale(0.97); }

.trc-btn.trc-loading {
  opacity: 0.6;
  pointer-events: none;
}

.trc-btn.trc-loading .trc-btn-arrow {
  animation: trc-spin 0.7s linear infinite;
}

@keyframes trc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Result fade-in */
.trc-result {
  animation: trc-fadein 0.35s ease;
}

@keyframes trc-fadein {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Copy success flash */
.trc-foot-btn.trc-copied {
  color: var(--success, #4ade80);
  border-color: var(--success, #4ade80);
}

/* ── Custom dropdown ─────────────────────────────────────── */
.trc-dd {
  position: relative;
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  user-select: none;
  width: 100%;
}

.trc-dd-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex: 1;
}

.trc-dd-arrow {
  color: var(--text-secondary);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.trc-dd-open .trc-dd-arrow {
  transform: rotate(180deg);
}

.trc-dd-menu {
  display: none;
  position: fixed;
  min-width: 160px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  z-index: 9999;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
}

.trc-dd-open .trc-dd-menu {
  display: block;
  animation: trc-dd-in 0.15s ease;
}

@keyframes trc-dd-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.trc-dd-item {
  padding: 7px 10px;
  font-size: 0.78rem;
  color: var(--text-primary);
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.1s;
}

.trc-dd-item:hover {
  background: var(--bg-hover);
}

.trc-dd-item-active {
  color: var(--primary);
  font-weight: 600;
}

.trc-auto-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  font-style: italic;
}

/* Arrow on left side — reorder flex */
.trc-dd {
  flex-direction: row;
}
