/* CC-2026-039: list-like two-line rows on narrow viewports (no sideways scroll). */
/* CC-2026-061: Year/Rating + TMDB-mark above year/score columns (not floating sort bar). */
/* CC-2026-065: Light|Dark only; shared year/score tracks so values sit under headers. */
/* CC-2026-066: tighter year/score tracks + gap → more title width (align under heads stays). */
/* CC-2026-063/114: mobile streaming = one peek row + More. */
/* CC-2026-070: no wizard — results-first entry. */
@media (max-width: 700px) {
  .screen-results {
    min-height: 0;
    padding-bottom: calc(2.5rem + env(safe-area-inset-bottom, 0px));
    --cc-col-num: 1.65rem;
    --cc-col-poster: 2.75rem;
    --cc-col-year: 2.6rem;
    --cc-col-score: 3.05rem;
    /* Spacer track only between Year and Rating. */
    --cc-gap-year-score: 0.55rem;
    /* Extra air between title and Year (on top of column-gap). */
    --cc-gap-title-year: 0.3rem;
  }
  /* Tagline wraps in the brand column so it stays off the Caviar Picks stack. */
  .screen-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    container-type: inline-size;
  }
  .header-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    flex: 1;
  }
  .purpose-strip {
    padding-left: 0;
    padding-right: 0.75rem;
    font-size: 0.78rem;
    white-space: normal;
    line-height: 1.35;
    max-width: 50cqi;
  }
  .header-brand {
    gap: 0.45rem;
  }
  .header-actions {
    margin-top: 0;
    width: min-content;
  }
  .account-btn,
  .caviar-action-btn {
    font-size: 0.76rem;
    padding: 0.36rem 0.48rem;
    letter-spacing: 0.03em;
    line-height: 1;
  }
  .header-actions .caviar-action-btn {
    flex-direction: row;
    gap: 0.22rem;
  }
  .header-actions .caviar-action-btn .caviar-mark {
    width: 0.76rem;
    height: 0.76rem;
  }
  .header-actions .caviar-action-label {
    display: none;
  }
  .header-actions .caviar-action-tune {
    display: inline;
    font-size: 0.76rem;
  }
  #train-dialog.account-dialog {
    max-width: calc(100vw - 0.6rem);
    width: calc(100vw - 0.6rem);
  }
  #train-dialog .train-dialog-panel {
    width: 100%;
    max-height: calc(100dvh - 1.2rem);
    overflow: auto;
    padding: 1.25rem 1rem 1.2rem;
  }
  .train-pack .train-prompt {
    font-size: 1.2rem;
  }
  #train-dialog .train-examples figure { width: 5.6rem; }
  #train-dialog .train-examples figure.train-example-only { width: 6.4rem; }
  #train-dialog .train-examples img,
  #train-dialog .train-examples .poster-ph {
    width: 5.6rem;
    height: 8.4rem;
  }
  #train-dialog .taste-row button {
    width: 3.4rem;
    height: 3.4rem;
  }
  #train-dialog .taste-row button[data-train="skip"] {
    min-height: 3.4rem;
  }
  .prefs-providers-wrap {
    min-height: 0;
  }
  .prefs-bar {
    gap: 1rem;
    margin: 0 0 1rem;
  }
  .prefs-setup-fields {
    gap: 1rem;
  }
  .prefs-row {
    gap: 1rem;
    align-items: stretch;
  }
  .prefs-row .prefs-step,
  .prefs-row .prefs-label {
    width: 100%;
  }
  .prefs-row select {
    width: 100%;
    min-width: 0;
  }
  .prefs-row .segmented {
    width: 100%;
  }
  .prefs-row .segmented button {
    flex: 1 1 0;
  }
  .prefs-optional {
    gap: 0;
    margin-top: 0;
  }
  .prefs-optional-toggle {
    padding: 0.95rem 2rem 0.95rem 0;
    min-height: 2.85rem;
  }
  .prefs-optional:not(.is-collapsed) {
    gap: 0.75rem;
    padding-bottom: 0.95rem;
  }
  .prefs-optional:not(.is-collapsed) .prefs-optional-toggle {
    padding-bottom: 0.5rem;
  }
  .prefs-optional-body {
    gap: 0.75rem;
  }
  .caviar-picks-toggle {
    max-width: none;
  }
  .prefs-optional #prefs-genre {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .prefs-providers-toggle {
    padding: 0.55rem 0.9rem;
    font-size: 0.92rem;
  }
  .prefs-providers label {
    padding: 0.45rem 0.65rem;
    font-size: 0.88rem;
  }
  /* One peek row + More (CC-2026-063/114). */
  .results-colhead {
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns:
      minmax(0, 1fr)
      var(--cc-col-year, 2.6rem)
      var(--cc-gap-year-score, 0.55rem)
      var(--cc-col-score, 3.05rem);
    grid-template-areas: "meta year . score";
    column-gap: 0.35rem;
    align-items: end;
    padding: 0.35rem 0 0.55rem;
    margin: 0 0 0.15rem;
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--bg);
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 500;
  }
  .results-colhead .colhead-meta {
    grid-area: meta;
    justify-self: start;
    align-self: end;
    min-width: 0;
    width: 100%;
    text-align: left;
  }
  .results-colhead .colhead-meta .results-ms {
    display: block;
    font-size: 0.72rem;
    text-align: left;
  }
  .results-colhead .colhead-year {
    grid-area: year;
    align-self: end;
    justify-self: start;
    width: 100%;
    text-align: left;
  }
  .results-colhead .colhead-score {
    grid-area: score;
    justify-self: stretch;
    text-align: right;
  }
  .results-colhead .score-head {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.22rem;
    width: 100%;
    max-width: none;
  }
  .results-colhead button.sort {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0;
    line-height: 1.15;
  }
  .results-colhead button.sort.active {
    color: var(--ink);
  }
  .results-colhead a.tmdb-mark img {
    width: 2.35rem;
  }
  .results {
    overflow-x: hidden;
  }
  /* Table internals must leave table formatting or grid-on-tr is ignored / shrink-wrapped (WebKit). */
  .results table,
  .results tbody {
    display: block;
    width: 100%;
  }
  .results colgroup {
    display: none;
  }
  .results thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  .results tbody tr.result-row {
    --swipe-x: 0px;
    display: grid;
    width: 100%;
    box-sizing: border-box;
    grid-template-columns:
      var(--cc-col-num, 1.65rem)
      var(--cc-col-poster, 2.75rem)
      minmax(0, 1fr)
      1.05rem
      var(--cc-col-year, 2.6rem)
      var(--cc-gap-year-score, 0.55rem)
      var(--cc-col-score, 3.05rem);
    grid-template-areas:
      "num poster title caviar year . score"
      "num poster on on on on on";
    column-gap: 0.35rem;
    row-gap: 0.35rem;
    align-items: start;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
    isolation: isolate;
    touch-action: pan-y;
  }
  .results tbody tr.result-row > .cell-swipe-cover {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--bg);
    transform: translate3d(var(--swipe-x), 0, 0);
    pointer-events: none;
    width: auto;
    max-width: none;
  }
  .results tbody tr.result-row > td:not(.cell-swipe):not(.cell-swipe-cover) {
    position: relative;
    z-index: 2;
    transform: translate3d(var(--swipe-x), 0, 0);
  }
  .results tbody tr.result-row.is-swiping {
    touch-action: none;
  }
  .results tbody tr.result-row.is-swiping > .cell-swipe-cover,
  .results tbody tr.result-row.is-swiping > td:not(.cell-swipe):not(.cell-swipe-cover) {
    transition: none;
    user-select: none;
    will-change: transform;
  }
  .results tbody tr.result-row.is-swipe-snap > .cell-swipe-cover,
  .results tbody tr.result-row.is-swipe-snap > td:not(.cell-swipe):not(.cell-swipe-cover) {
    transition: transform 0.2s ease;
  }
  .results tbody tr.result-row.is-swipe-commit > .cell-swipe-cover,
  .results tbody tr.result-row.is-swipe-commit > td:not(.cell-swipe):not(.cell-swipe-cover) {
    transition: transform 0.22s ease, opacity 0.18s ease;
    opacity: 0;
  }
  .results tbody tr.result-row .cell-swipe {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.2rem;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 5.4rem;
    z-index: 0;
    pointer-events: none;
    text-align: center;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.01em;
    padding: 0 0.3rem;
  }
  .results tbody tr.result-row .cell-swipe svg {
    width: 1.15rem;
    height: 1.15rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
  }
  .results tbody tr.result-row .cell-swipe--dont {
    left: 0;
    color: var(--ink);
    background: color-mix(in srgb, var(--ink) 10%, var(--bg));
  }
  .results tbody tr.result-row .cell-swipe--seen {
    right: 0;
    color: var(--train);
    background: color-mix(in srgb, var(--train) 16%, var(--bg));
  }
  .results tbody tr.result-row.is-swipe-commit .cell-swipe--dont,
  .results tbody tr.result-row.is-swipe-commit .cell-swipe--seen {
    transition: width 0.22s ease, max-width 0.22s ease, left 0.22s ease, right 0.22s ease;
  }
  .results tbody tr.result-row.is-swipe-commit-dont .cell-swipe--dont,
  .results tbody tr.result-row.is-swipe-commit-seen .cell-swipe--seen {
    width: 100%;
    max-width: none;
    left: 0;
    right: 0;
    z-index: 4;
    font-size: 0.82rem;
  }
  .results tbody tr.result-row.is-swipe-commit-dont .cell-swipe--seen,
  .results tbody tr.result-row.is-swipe-commit-seen .cell-swipe--dont {
    visibility: hidden;
  }
  @media (prefers-reduced-motion: reduce) {
    .results tbody tr.result-row.is-swipe-snap > .cell-swipe-cover,
    .results tbody tr.result-row.is-swipe-snap > td:not(.cell-swipe):not(.cell-swipe-cover),
    .results tbody tr.result-row.is-swipe-commit > .cell-swipe-cover,
    .results tbody tr.result-row.is-swipe-commit > td:not(.cell-swipe):not(.cell-swipe-cover),
    .results tbody tr.result-row.is-swipe-commit .cell-swipe--dont,
    .results tbody tr.result-row.is-swipe-commit .cell-swipe--seen {
      transition: none;
    }
  }
  .results tbody td {
    display: block;
    border-bottom: 0;
    padding: 0;
    width: auto;
    max-width: none;
  }
  .results tbody td.cell-swipe {
    display: flex;
    width: 5.4rem;
    max-width: 5.4rem;
  }
  .results tbody td.cell-swipe-cover {
    display: block;
    width: auto;
    max-width: none;
  }
  .results .cell-num {
    grid-area: num;
    align-self: start;
    box-sizing: border-box;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    font-size: 0.85rem;
    line-height: 1;
  }
  .results .cell-poster {
    grid-area: poster;
    align-self: start;
  }
  .results .cell-title {
    grid-area: title;
    min-width: 0;
    justify-self: stretch;
    overflow: visible;
    white-space: normal;
    padding-right: var(--cc-gap-title-year, 0.3rem);
  }
  .results .cell-caviar {
    grid-area: caviar;
    align-self: start;
    width: auto;
    padding: 0.2rem 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .results button.title-open {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    width: 100%;
    white-space: normal;
    overflow: hidden;
    line-height: 1.28;
    line-clamp: 2;
  }
  .results .cell-year {
    grid-area: year;
    justify-self: start;
    width: 100%;
    text-align: left;
    font-size: 0.92rem;
  }
  .results .cell-score {
    grid-area: score;
    justify-self: stretch;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }
  .results .cell-score .score {
    font-size: 1.12rem;
  }
  /* Mix-lijst (118): type under rating so the title row stays one line. */
  .results .title-kind--title {
    display: none;
  }
  .results .title-kind--score {
    display: block;
    margin: 0.1rem 0 0;
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    text-align: right;
    overflow: visible;
  }
  .results .cell-on {
    grid-area: on;
    justify-self: stretch;
    max-width: 100%;
  }
  .results .pills {
    justify-content: flex-start;
  }
  .results .pill {
    max-width: none;
  }
  .results .pill .ext-arrow {
    display: none;
  }
  .title-dialog-panel {
    width: min(36rem, calc(100vw - 1rem));
    max-height: min(92svh, 52rem);
    padding-bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }
  .title-dialog-hero-copy .taste-row {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.4rem;
  }
  .title-dialog-hero-copy .taste-cluster {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
  }
  .title-dialog-hero-copy .taste-row button {
    width: 2.15rem;
    height: 2.15rem;
  }
  a.title-dialog-tmdb .score {
    font-size: 2.1rem;
  }
  .feedback-dialog-panel {
    width: min(26rem, calc(100vw - 1rem));
    max-height: min(92svh, 32rem);
    padding-bottom: calc(1.35rem + env(safe-area-inset-bottom, 0px));
  }
}
