/* TASTIQ site, design "Нейтральный": a calm native-grade app. Three columns on desktop:
   sidebar (where you are, what I understood), the question, an inspector with context. */

:root {
  color-scheme: dark;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Type scale, steps of 1.125-1.2 */
  --t-xs: 0.75rem;
  --t-s: 0.8125rem;
  --t-base: 0.9375rem;
  --t-m: 1.0625rem;
  --t-l: 1.25rem;
  --t-xl: 1.5rem;
  --t-2xl: 1.75rem;

  /* Surfaces: the question sits on the base, panels are one step lighter */
  --bg: #151517;
  --panel: #1c1c1f;
  --group: #1f1f23;
  --popover: #2a2a2f;
  --fill: rgba(255, 255, 255, 0.075);
  --fill-2: rgba(255, 255, 255, 0.11);
  --fill-3: rgba(255, 255, 255, 0.15);
  --sep: rgba(255, 255, 255, 0.085);
  --sep-strong: rgba(255, 255, 255, 0.15);
  --field: rgba(255, 255, 255, 0.06);

  --text: #f2f2f4;
  --text-2: #a9a9b0;
  --text-3: #8d8d95;

  /* One accent: primary actions, selection, focus */
  --accent: #0a84ff;
  --accent-fill: #0071e3;
  --accent-fill-hover: #0068d1;
  --accent-fill-press: #0062c4;
  --accent-text: #62b0ff;
  --accent-tint: rgba(10, 132, 255, 0.2);
  --on-accent: #ffffff;
  --on-accent-tag: rgba(0, 0, 0, 0.22); /* tag inside a filled blue chip: darkens, keeps white text ≥4.5:1 */

  /* Controls drawn over posters and switch knobs: same in both themes */
  --over-media-ink: #ffffff;
  --over-media-fill: rgba(0, 0, 0, 0.42);
  --over-media-edge: rgba(255, 255, 255, 0.9);
  --knob: #ffffff;
  --shadow-knob: 0 1px 3px rgba(0, 0, 0, 0.3);

  --typo-1: #2a2a2f;
  --typo-2: #2c2b2a;
  --typo-3: #282b2e;
  --typo-4: #2d2a2e;
  --typo-ink: #e8e8ec;
  --typo-ink-2: #a3a3ab;
  --poster-edge: rgba(255, 255, 255, 0.07);

  --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.07);
  --shadow-lift: 0 8px 22px rgba(0, 0, 0, 0.38);
  --shadow-drawer: 8px 0 32px rgba(0, 0, 0, 0.4);
  --scroll-thumb: rgba(255, 255, 255, 0.18);
  --scrim: rgba(0, 0, 0, 0.5);

  --sidebar-w: 252px;
  --inspector-w: 352px;
  --toolbar-h: 52px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #ffffff;
    --panel: #f5f5f7;
    --group: #f5f5f7;
    --popover: #ffffff;
    --fill: rgba(0, 0, 0, 0.055);
    --fill-2: rgba(0, 0, 0, 0.085);
    --fill-3: rgba(0, 0, 0, 0.12);
    --sep: rgba(0, 0, 0, 0.09);
    --sep-strong: rgba(0, 0, 0, 0.16);
    --field: #ffffff;

    --text: #1d1d1f;
    --text-2: #5b5b62;
    --text-3: #6c6c73;

    --accent: #0071e3;
    --accent-fill: #0071e3;
    --accent-fill-hover: #0068d1;
    --accent-fill-press: #0062c4;
    --accent-text: #0060c0;
    --accent-tint: rgba(0, 113, 227, 0.11);

    --typo-1: #e8e8ec;
    --typo-2: #ebe9e6;
    --typo-3: #e5e9ec;
    --typo-4: #ebe7ec;
    --typo-ink: #1d1d1f;
    --typo-ink-2: #5b5b62;
    --poster-edge: rgba(0, 0, 0, 0.08);

    --shadow-pop: 0 10px 30px rgba(0, 0, 0, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.08);
    --shadow-lift: 0 8px 22px rgba(0, 0, 0, 0.14);
    --shadow-drawer: 8px 0 32px rgba(0, 0, 0, 0.16);
    --scroll-thumb: rgba(0, 0, 0, 0.2);
    --scrim: rgba(0, 0, 0, 0.3);
  }
}

/* ---------- base ---------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--t-base);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection { background: color-mix(in srgb, var(--accent) 38%, transparent); }

* { scrollbar-width: thin; scrollbar-color: var(--scroll-thumb) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent-text); }

svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
svg.i-s { width: 15px; height: 15px; }
svg.i-l { width: 22px; height: 22px; }

.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; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- app frame ---------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--inspector-w);
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--panel);
  border-right: 1px solid var(--sep);
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--toolbar-h);
  padding: 0 14px 0 18px;
  flex: none;
}

.brand { color: var(--text); font-size: var(--t-m); font-weight: 700; letter-spacing: 0.06em; text-decoration: none; border-radius: 5px; }
.icon-btn.sidebar-close { display: none; }
.sidebar-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 0 10px 24px; }

.main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-width: 0;
  min-height: 0;
  background: var(--bg);
}

.inspector {
  min-height: 0;
  overflow-y: auto;
  background: var(--panel);
  border-left: 1px solid var(--sep);
  padding: 20px 22px 32px;
}

.scrim { display: none; }

/* ---------- toolbar ---------- */

.toolbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--toolbar-h);
  padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--sep);
  background: var(--bg);
}

.toolbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
  font-size: var(--t-s);
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toolbar-title b { color: var(--text); font-weight: 600; }

.icon-btn.menu-btn { display: none; }
.toolbar .btn[hidden] { visibility: hidden; } /* keeps the title centred */

.busy-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.busy-bar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: var(--accent);
  border-radius: 2px;
  animation: slide 1.1s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}
@keyframes slide { from { left: -30%; } to { left: 100%; } }
body.is-busy-visible .busy-bar { opacity: 1; }

/* ---------- content ---------- */

.content {
  min-height: 0;
  overflow-y: auto;
  padding: 36px 44px 56px;
  transition: opacity 0.15s;
}
body.is-busy-visible .content { opacity: 0.6; }
body.is-busy .content, body.is-busy .inspector, body.is-busy .actionbar { pointer-events: none; }

.content-inner { max-width: 940px; }

.q-title {
  margin: 0;
  font-size: var(--t-2xl);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.q-hint {
  margin: 10px 0 0;
  max-width: 62ch;
  color: var(--text-2);
  font-size: var(--t-m);
  line-height: 1.45;
  text-wrap: pretty;
}
.q-body { margin-top: 28px; }

.group-title {
  margin: 28px 0 10px;
  font-size: var(--t-base);
  font-weight: 600;
  color: var(--text);
}
.q-body > .group-title:first-child { margin-top: 0; }
.group-note { margin: -4px 0 12px; color: var(--text-2); font-size: var(--t-s); }

.muted { color: var(--text-2); }
.quiet { color: var(--text-3); }

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  font-size: var(--t-base);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, opacity 0.12s;
}
.btn-lg { min-height: 40px; padding: 0 22px; }
.btn-primary { background: var(--accent-fill); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-fill-hover); }
.btn-primary:active { background: var(--accent-fill-press); }
.btn-primary:disabled { background: var(--fill); color: var(--text-3); cursor: not-allowed; }
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-secondary:hover { background: var(--fill-2); }
.btn-secondary:active { background: var(--fill-3); }
.btn-plain { background: transparent; color: var(--text-2); padding: 0 10px; }
.btn-plain:hover { background: var(--fill); color: var(--text); }
.btn-plain:active { background: var(--fill-2); }
.btn:disabled { cursor: default; }
.btn-plain:disabled { opacity: 0.4; background: transparent; color: var(--text-2); }
.btn-link { background: transparent; color: var(--accent-text); padding: 0 4px; font-weight: 500; }
.btn-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn.is-done { background: var(--fill); color: var(--text); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}
.icon-btn:hover { background: var(--fill); color: var(--text); }
.icon-btn:active { background: var(--fill-2); }

.spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.7s linear infinite;
  flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- action bar ---------- */

.actionbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 44px;
  border-top: 1px solid var(--sep);
  background: var(--bg);
}
.actionbar:empty { display: none; }
.actionbar .spacer { flex: 1; }
.actionbar .status-text { color: var(--text-2); font-size: var(--t-s); }
.anchor-next { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; margin: 0 0 20px; background: var(--group); border: 1px solid var(--sep); border-radius: 12px; }
.pgrid + .anchor-next { margin: 20px 0 0; }
.anchor-next .status-text { font-size: var(--t-s); color: var(--text-2); }
.anchor-next .btn { flex-shrink: 0; min-height: 40px; min-width: 96px; }

/* ---------- chips ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--fill);
  color: var(--text);
  font-size: var(--t-base);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
}
.chip:hover { background: var(--fill-2); }
.chip:active { background: var(--fill-3); transform: scale(0.98); }
.chip[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }
.chip[aria-pressed="true"]:hover { background: var(--accent-fill-hover); }
.chip:disabled { opacity: 0.4; cursor: default; transform: none; }
.chip .i { width: 16px; height: 16px; margin-left: -4px; }

/* Complaint chips: marked = «не нравится» on the blue wash with a minus,
   «никогда» = Action Blue with a ban icon and the word. Shape and word, not colour alone. */
.chip.chip-c[data-state="soft"] { padding-left: 12px; background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--text); }
.chip.chip-c[data-state="soft"]:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.chip.chip-c[data-state="soft"] .i { margin-left: 0; color: var(--accent-text); }
.chip.chip-c[data-state="hard"] { padding-left: 12px; background: var(--accent-fill); color: var(--on-accent); }
.chip.chip-c[data-state="hard"] .i { margin-left: 0; color: var(--on-accent); }
.chip-tag {
  margin-right: -6px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--t-xs);
  font-weight: 600;
  background: var(--on-accent-tag);
  color: var(--on-accent);
}

/* The second question, «что из этого не терпишь вообще», as checkbox rows. */
.ask-list { max-width: 560px; }
.ask-list .row { min-height: 50px; }
.ask-list .row + .row::before { left: 50px; }
.ask-none { margin-top: 10px; }

.chip-add { border-style: dashed; border-color: var(--sep-strong); background: transparent; }
.chip-add:hover { background: var(--fill); }

/* ---------- grouped lists (domain, playback) ---------- */

.list {
  overflow: hidden;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--group);
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--text);
}
.row + .row::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 62px;
  border-top: 1px solid var(--sep);
}
.list-plain .row + .row::before { left: 16px; }
button.row { cursor: pointer; transition: background-color 0.12s; }
button.row:hover { background: var(--fill); }
button.row:active { background: var(--fill-2); }
button.row:focus-visible { outline-offset: -2px; border-radius: 12px; }
button.row:disabled { cursor: default; background: transparent; }

.row-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--fill-2);
  color: var(--text);
  flex: none;
}
.row-main { flex: 1; min-width: 0; }
.row-label { display: block; font-size: var(--t-m); font-weight: 500; line-height: 1.3; }
.row-sub { display: block; margin-top: 2px; color: var(--text-2); font-size: var(--t-s); }
.row-value { color: var(--text-2); font-size: var(--t-base); font-variant-numeric: tabular-nums; }
.row-chev { color: var(--text-3); }
.row:disabled .row-label, .row:disabled .row-icon { color: var(--text-3); }
.row:disabled .row-icon { background: var(--fill); }
.row .row-remove { margin-right: -8px; }
.row-text { font-size: var(--t-base); }

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: var(--t-xs);
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- platform tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  min-height: 116px;
  padding: 16px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--group);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s;
}
.tile:hover { background: color-mix(in srgb, var(--group) 100%, var(--text) 4%); border-color: var(--sep-strong); }
.tile:active { background: var(--fill-2); }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile-label { font-size: var(--t-m); font-weight: 600; }
.tile-check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-fill);
  color: var(--on-accent);
}
.tile-check .i { width: 14px; height: 14px; stroke-width: 2.25; }

/* ---------- posters ---------- */

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 8px;
  background: var(--typo-1);
  container-type: inline-size;
  isolation: isolate;
}
.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--poster-edge);
  pointer-events: none;
}
.poster[data-tone="2"] { background: var(--typo-2); }
.poster[data-tone="3"] { background: var(--typo-3); }
.poster[data-tone="4"] { background: var(--typo-4); }

.p-img {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.25s;
}
.p-img.is-loaded { opacity: 1; }
.poster.is-img .typo { visibility: hidden; }
.poster.is-letterbox .p-img { object-fit: contain; }
.p-bg {
  position: absolute;
  inset: -12%;
  z-index: 1;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(16px) brightness(0.55) saturate(1.1);
}

.typo {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 11cqi 10cqi;
  color: var(--typo-ink);
}
.typo-title {
  font-size: max(9px, 10cqi);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
  hyphens: auto;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.typo-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--typo-ink-2);
  font-size: max(8px, 8.5cqi);
  font-variant-numeric: tabular-nums;
}
.typo-foot .i { width: max(10px, 11cqi); height: max(10px, 11cqi); }
.typo-initial { display: none; }
.poster-sm .typo { align-items: center; justify-content: center; padding: 0; }
.poster-sm .typo-title, .poster-sm .typo-foot { display: none; }
.poster-sm .typo-initial { display: block; font-size: 42cqi; font-weight: 650; color: var(--typo-ink-2); }
.poster-sm { border-radius: 5px; }
/* Too small for a readable title: show the initial instead. */
@container (max-width: 96px) {
  .typo { align-items: center; justify-content: center; padding: 0; }
  .typo-title, .typo-foot { display: none; }
  .typo-initial { display: block; font-size: 40cqi; font-weight: 650; color: var(--typo-ink-2); }
}

/* ---------- poster grid (what you liked / disliked) ---------- */

.grid-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; }
.grid-tools .search { flex: 1; max-width: 460px; }

.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); gap: 26px 18px; }

.pcard {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.pcard .poster { transition: transform 0.18s ease, box-shadow 0.18s ease; }
.pcard:hover .poster { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.pcard:active .poster { transform: none; }
.pcard[aria-pressed="true"] .poster { outline: 3px solid var(--accent); outline-offset: 3px; }
.pcard:focus-visible { outline-offset: 6px; }

.badge {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--over-media-edge);
  background: var(--over-media-fill);
  color: var(--over-media-ink);
  transition: background-color 0.12s, border-color 0.12s;
}
.badge .i { width: 14px; height: 14px; stroke-width: 2.5; opacity: 0; }
.pcard[aria-pressed="true"] .badge { background: var(--accent-fill); border-color: var(--accent-fill); }
.pcard[aria-pressed="true"] .badge .i { opacity: 1; }

.pcard-title {
  font-size: var(--t-base);
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard-meta { margin-top: -6px; color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.pcard-text { display: flex; flex-direction: column; gap: 8px; }

.grid-more { display: flex; justify-content: center; margin-top: 32px; }

/* ---------- search ---------- */

.search { position: relative; }
.search > .i { position: absolute; left: 11px; top: 50%; translate: 0 -50%; color: var(--text-3); pointer-events: none; }
.input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--sep-strong);
  border-radius: 8px;
  background: var(--field);
  color: var(--text);
  font-size: var(--t-base);
}
.search .input { padding-left: 36px; }
.input::placeholder { color: var(--text-3); }
.input:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 340px;
  overflow-y: auto;
  padding: 5px;
  border-radius: 12px;
  background: var(--popover);
  box-shadow: var(--shadow-pop);
}
.suggest[hidden] { display: none; }
.opt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 5px 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.opt .poster { width: 30px; flex: none; }
.opt-title { display: block; font-weight: 500; line-height: 1.3; }
.opt-meta { display: block; color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.opt:hover { background: var(--fill-2); }
.opt[aria-selected="true"] { background: var(--accent-fill); color: var(--on-accent); }
.opt[aria-selected="true"] .opt-meta { color: var(--on-accent); }
.opt-empty { padding: 10px 10px; color: var(--text-2); font-size: var(--t-s); }

/* ---------- why / why not ---------- */

.toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 560px;
  margin-top: 26px;
  padding: 12px 16px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--group);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.toggle-row:hover { border-color: var(--sep-strong); }
.toggle-row .row-main { font-size: var(--t-base); font-weight: 500; }
.toggle-row > .i { color: var(--text-2); }
.toggle-row[aria-checked="true"] > .i { color: var(--accent-text); }
.switch {
  position: relative;
  width: 40px;
  height: 24px;
  flex: none;
  border-radius: 999px;
  background: var(--fill-3);
  transition: background-color 0.15s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--knob);
  box-shadow: var(--shadow-knob);
  transition: transform 0.15s;
}
[aria-checked="true"] > .switch { background: var(--accent-fill); }
[aria-checked="true"] > .switch::after { transform: translateX(16px); }
.box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border: 1.5px solid var(--sep-strong);
  border-radius: 5px;
  background: var(--field);
  color: var(--on-accent);
}
.box .i { width: 14px; height: 14px; stroke-width: 2.5; opacity: 0; }
[aria-checked="true"] > .box { background: var(--accent-fill); border-color: var(--accent-fill); }
[aria-checked="true"] > .box .i { opacity: 1; }

.freetext { margin-top: 22px; max-width: 620px; }
.freetext > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--accent-text);
  font-weight: 500;
  list-style: none;
  cursor: pointer;
  border-radius: 7px;
}
.freetext > summary::-webkit-details-marker { display: none; }
.freetext > summary .i { transition: transform 0.15s; }
.freetext[open] > summary .i { transform: rotate(90deg); }
.freetext-body { margin-top: 8px; }
.freetext-body p { margin: 0 0 10px; color: var(--text-2); font-size: var(--t-s); }
.field { display: flex; gap: 8px; }
.parsed { margin-top: 14px; }
.parsed-note { margin: 0 0 8px; color: var(--text-2); font-size: var(--t-s); }

/* The question about one title: its poster on the left, the question, its year and kind, the hint. */
.q-item {
  --q-poster: 132px;
  display: grid;
  grid-template-columns: var(--q-poster) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: 24px;
  align-items: start;
  max-width: 780px;
}
.q-item > .poster { grid-row: 1 / span 2; width: var(--q-poster); }
.q-item-head { grid-column: 2; padding-top: 2px; }
.q-item-meta { margin: 6px 0 0; color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.q-item > .q-hint { grid-column: 2; margin-top: 12px; }
.q-item + .q-body { margin-top: 24px; }
.group-note { max-width: 62ch; }

/* ---------- playback ---------- */

.pb-groups { display: flex; flex-direction: column; gap: 24px; max-width: 680px; }
.pb-groups .group-title { margin: 0 0 8px; }

/* ---------- result ---------- */

.fork {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 0 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--group);
}
.fork-text { flex: 1 1 240px; }
.fork-q { display: block; font-weight: 600; font-size: var(--t-m); }
.fork-note { display: block; color: var(--text-2); font-size: var(--t-s); }

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--fill);
}
.seg {
  min-height: 30px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: var(--t-s);
  font-weight: 500;
  cursor: pointer;
}
.seg:hover { background: var(--fill-2); }
.seg:active { background: var(--fill-3); }
.seg[aria-pressed="true"] { background: var(--accent-fill); color: var(--on-accent); }

.result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }

/* A result card: the frame holds the card button (opens the details) and «Уже смотрел» as a second button. */
.pick { position: relative; border: 1px solid var(--sep); border-radius: 16px; background: var(--group); transition: border-color 0.12s; }
.pick:hover { border-color: var(--sep-strong); }
.pick:has(> [aria-pressed="true"]) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.pick > .hero:focus-visible, .pick > .alt:focus-visible { outline-offset: -2px; }
.pick-hero > .seen-btn { position: absolute; right: 12px; bottom: 12px; }
.pick-hero .hero-body { padding-bottom: 36px; }
.pick-alt { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-radius: 12px; }
.pick-alt > .seen-btn { margin-right: 8px; }

/* Where a removed card stood. */
.seen-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--fill); font-size: var(--t-s); }
.seen-note p { margin: 0; font-weight: 600; }
.seen-note-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seen-note.is-done { padding: 2px 4px; background: none; color: var(--text-2); }
.alts > .seen-note { margin: 0; }

.hero {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 24px;
  width: 100%;
  padding: 16px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.hero-body { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 4px 0; min-width: 0; }
.hero-title { font-size: var(--t-xl); font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
.hero-meta { color: var(--text-2); font-size: var(--t-base); font-variant-numeric: tabular-nums; }
.hero-reasons { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.hero-reason { display: flex; gap: 8px; font-size: var(--t-base); line-height: 1.45; }
.hero-reason .i { margin-top: 3px; color: var(--accent-text); }
.hero-more { margin-top: 6px; color: var(--text-2); font-size: var(--t-s); }

.alts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.alt {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.alt-body { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; }
.alt-title { font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.alt-meta { color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px 0 8px;
  border-radius: 999px;
  background: var(--fill-2);
  color: var(--text);
  font-size: var(--t-s);
  font-weight: 600;
  white-space: nowrap;
}
.status .bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.status .bars span { width: 3px; border-radius: 1px; background: currentColor; opacity: 0.3; }
.status .bars span:nth-child(1) { height: 5px; }
.status .bars span:nth-child(2) { height: 8px; }
.status .bars span:nth-child(3) { height: 12px; }
.status[data-level="1"] .bars span:nth-child(-n+1),
.status[data-level="2"] .bars span:nth-child(-n+2),
.status[data-level="3"] .bars span:nth-child(-n+3) { opacity: 1; }
.alt > .status { margin-right: 6px; }

.sieves { max-width: 520px; }
.sieves .row { min-height: 40px; padding: 8px 16px; }
.sieves .row-label { font-size: var(--t-base); font-weight: 400; }
.sieves .row-total .row-label { font-weight: 600; }

.whynot { max-width: 620px; }
.whynot .search { max-width: 460px; }
.whynot-out { margin-top: 14px; }
.whynot-card { padding: 14px 16px; border: 1px solid var(--sep); border-radius: 12px; background: var(--group); }
.whynot-card p { margin: 0; }
.whynot-card p + p, .whynot-card p + .kv, .whynot-card .kv + p { margin-top: 10px; }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; margin: 0; font-size: var(--t-s); }
.kv dt { color: var(--text); }
.kv dd { margin: 0; color: var(--text-2); font-variant-numeric: tabular-nums; text-align: right; }
.kv-title { margin: 12px 0 6px; font-size: var(--t-s); font-weight: 600; color: var(--text-2); }

/* ---------- detail (inspector and inline on narrow screens) ---------- */

.detail-head { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; align-items: start; }
.detail-title { margin: 0; font-size: var(--t-l); font-weight: 700; line-height: 1.25; letter-spacing: -0.01em; text-wrap: balance; }
.detail-orig { margin: 3px 0 0; color: var(--text-2); font-size: var(--t-s); }
.detail-meta { margin: 8px 0 0; color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.detail-head .status { margin-top: 12px; }

.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }
.detail-actions .btn-primary { grid-column: 1 / -1; min-height: 40px; }
.detail-actions .btn { padding: 0 10px; }
.detail-link { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; gap: 6px; margin-top: 2px; min-height: 32px; font-weight: 500; text-decoration: none; }
.detail-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.section { margin-top: 26px; }
.section-title { margin: 0 0 10px; font-size: var(--t-s); font-weight: 600; color: var(--text-2); }

.reasons { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.reason { padding: 11px 13px; border: 1px solid var(--sep); border-radius: 10px; background: var(--group); }
.inspector .reason { background: var(--bg); }
.reason-text { display: flex; gap: 8px; margin: 0; line-height: 1.45; }
.reason-text > .i { margin-top: 2px; color: var(--accent-text); }
.reason.is-weak .reason-text { color: var(--text-2); }
.reason.is-weak .reason-text > .i { color: var(--text-3); }
.reason.is-risk .reason-text > .i { color: var(--text); }

.ev { display: flex; gap: 8px; margin-top: 8px; padding-left: 26px; color: var(--text-2); font-size: var(--t-s); line-height: 1.45; }
.ev > .i { width: 14px; height: 14px; margin-top: 2px; color: var(--text-3); }
.ev-body { min-width: 0; }
.ev-src { color: var(--text-2); }
.ev-q { color: var(--text); overflow-wrap: anywhere; }
.ev-more { margin-top: 4px; padding-left: 26px; }
.ev-more > summary { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-size: var(--t-s); cursor: pointer; list-style: none; border-radius: 5px; }
.ev-more > summary::-webkit-details-marker { display: none; }
.ev-more > summary .i { width: 13px; height: 13px; transition: transform 0.15s; }
.ev-more[open] > summary .i { transform: rotate(90deg); }
.ev-more .ev { padding-left: 0; }

.facts { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: var(--t-s); color: var(--text-2); }
.facts li { display: flex; gap: 8px; }
.facts .i { width: 14px; height: 14px; margin-top: 2px; color: var(--text-3); }

/* ---------- inspector content ---------- */

.insp-title { margin: 0 0 14px; font-size: var(--t-m); font-weight: 650; }
.insp-note { margin: 0; color: var(--text-2); font-size: var(--t-s); line-height: 1.5; }
.insp-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 12px; }
.insp-steps li { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 10px; font-size: var(--t-base); line-height: 1.45; }
.insp-steps li::before {
  counter-increment: s;
  content: counter(s);
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--fill-2);
  color: var(--text-2);
  font-size: var(--t-xs);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; margin: 0; font-size: var(--t-s); }
.dl dt { color: var(--text-2); }
.dl dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; }

.insp-block + .insp-block { margin-top: 26px; }
.insp-note + .insp-note { margin-top: 12px; }

.mini-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.mini {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 6px 6px;
  border-radius: 8px;
}
.mini .poster { width: 34px; }
.mini-title { font-size: var(--t-base); font-weight: 500; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-meta { color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.mini.is-current { background: var(--fill-2); }
.mini .i { color: var(--text-3); }
.mini.is-done .i { color: var(--accent-text); }

.insp-poster { width: 148px; }

/* ---------- sidebar ---------- */

.side-block { padding-top: 10px; }
.side-title { margin: 8px 8px 6px; font-size: var(--t-s); font-weight: 600; color: var(--text-3); }

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: var(--t-base);
  text-align: left;
  cursor: pointer;
}
.side-item .i { color: var(--text-2); }
.side-item:hover { background: var(--fill); }
.side-item:active { background: var(--fill-2); }
.side-item[aria-current] { background: var(--fill-2); font-weight: 600; }
.side-item[aria-current] .i { color: var(--accent-text); }
.side-item:disabled { cursor: default; color: var(--text-3); background: transparent; }
.side-item:disabled .i { color: var(--text-3); }
.side-item:focus-visible { outline-offset: -2px; }
.side-count { margin-left: auto; color: var(--text-3); font-size: var(--t-s); font-variant-numeric: tabular-nums; }

/* Steps are one summary row; the list opens under it on demand. */
.steps-toggle { margin-top: 6px; color: var(--text-2); }
.steps-toggle .i { color: var(--text-3); transition: transform 0.15s; }
.steps-toggle[aria-expanded="true"] .i { transform: rotate(90deg); }
.steps-sum { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.steps-sum b { color: var(--text); font-weight: 600; }

.steps { margin: 2px 0 0; padding: 0; list-style: none; }
.steps[hidden] { display: none; }
.step {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  padding: 0 8px;
  border-radius: 7px;
  color: var(--text-3);
  font-size: var(--t-base);
}
.step-mark { display: grid; place-items: center; width: 18px; height: 18px; flex: none; }
.step-mark .i { width: 15px; height: 15px; }
.step-dot { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.step.is-done { color: var(--text-2); }
.step.is-done .step-mark { color: var(--accent-text); }
.step.is-skipped { color: var(--text-3); }
.step.is-current { background: var(--fill-2); color: var(--text); font-weight: 600; }
.step.is-current .step-dot { background: var(--accent); border-color: var(--accent); width: 8px; height: 8px; }
.step-value { margin-left: auto; font-size: var(--t-s); font-weight: 400; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }

.taste { padding: 0 8px; }
.taste-group + .taste-group { margin-top: 14px; }
.taste-label { margin: 0 0 4px; font-size: var(--t-s); color: var(--text-2); }
.taste-items { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.taste-items li { font-size: var(--t-base); line-height: 1.35; }
.taste-items .src { display: block; color: var(--text-3); font-size: var(--t-s); }
.taste-items.is-quiet li { color: var(--text-2); font-size: var(--t-s); }
.taste-empty { margin: 0; color: var(--text-3); font-size: var(--t-s); }

/* ---------- «Моё» ---------- */

.btn-s { min-height: 30px; padding: 0 11px; gap: 5px; border-radius: 7px; font-size: var(--t-s); }
.btn-plain.btn-s { padding: 0 8px; }

.my-tabs { margin-bottom: 18px; }
.seg-count { margin-left: 6px; color: var(--text-2); font-weight: 400; font-variant-numeric: tabular-nums; }
.seg[aria-pressed="true"] .seg-count { color: var(--on-accent); }

.my-undo { display: flex; align-items: center; gap: 6px; margin: 0 0 12px; color: var(--text-2); font-size: var(--t-s); }
.my-undo .btn-link { min-height: 28px; font-size: var(--t-s); }

.my-list { display: flex; flex-direction: column; gap: 8px; max-width: 780px; container-type: inline-size; }
.my-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px 14px;
  padding: 10px 12px 10px 10px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--group);
  transition: border-color 0.12s;
}
.my-row:hover { border-color: var(--sep-strong); }
.my-row.is-selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.my-main {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.my-text { min-width: 0; }
.my-title { display: block; font-weight: 600; line-height: 1.3; }
.my-meta { display: block; margin-top: 3px; color: var(--text-2); font-size: var(--t-s); font-variant-numeric: tabular-nums; }
.my-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.my-ask { margin-right: 2px; color: var(--text-2); font-size: var(--t-s); }
.my-inline { grid-column: 1 / -1; margin-top: 2px; padding: 8px 12px; border-radius: 10px; background: var(--panel); }
@container (max-width: 620px) {
  .my-row { grid-template-columns: minmax(0, 1fr); }
  .my-actions { justify-content: flex-start; padding-left: 68px; }
}
@container (max-width: 440px) {
  .my-actions { padding-left: 0; }
}

.my-detail .detail-status { margin: 10px 0 0; }
.my-detail .detail-link { display: inline-flex; margin-top: 16px; }
/* Inline under its row the title and poster are already on screen: status, date and link only. */
.my-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--text-2); font-size: var(--t-s); }
.my-facts .detail-link { margin: 0; min-height: 28px; }

.my-hist { max-width: 780px; }
.my-hist .row { align-items: flex-start; min-height: 0; padding: 12px 16px; }
.my-hist .row + .row::before { left: 70px; }
.my-hist .poster { width: 40px; flex: none; }
.my-hist .row-label { font-size: var(--t-base); font-weight: 600; }
.my-hist .saved-mark { margin-top: 2px; white-space: nowrap; }

.my-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 520px;
  padding: 22px;
  border: 1px solid var(--sep);
  border-radius: 12px;
  background: var(--group);
}
.my-empty > .i { margin-bottom: 6px; color: var(--text-3); }
.my-empty-title { margin: 0; font-size: var(--t-m); font-weight: 600; }
.my-empty-text { margin: 0 0 14px; color: var(--text-2); }

/* Result: saved state of a pick */
.saved-mark { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); font-size: var(--t-s); }
.saved-mark .i { color: var(--accent-text); }
.hero-body .saved-mark { margin-top: 2px; }
.saved-row { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.saved-row .btn { flex: 1; min-height: 40px; }
.saved-link { flex: none; font-weight: 500; text-decoration: none; }
.saved-link:hover { text-decoration: underline; text-underline-offset: 3px; }

.pcard-from { display: inline-flex; align-items: center; gap: 4px; margin-top: -5px; color: var(--text-2); font-size: var(--t-xs); font-weight: 600; }
.pcard-from .i { width: 13px; height: 13px; color: var(--accent-text); }

/* ---------- messages ---------- */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--sep-strong);
  border-radius: 12px;
  background: var(--group);
}
.banner > .i { margin-top: 1px; }
.banner-text { flex: 1; }
.banner-text b { display: block; }
.banner-text span { color: var(--text-2); font-size: var(--t-s); }
.empty { padding: 40px 0; color: var(--text-2); }

/* ---------- dialog ---------- */

.sheet-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 22px;
  border: 0;
  border-radius: 14px;
  background: var(--popover);
  color: var(--text);
  box-shadow: var(--shadow-pop);
}
.sheet-dialog::backdrop { background: var(--scrim); }
.sheet-dialog h2 { margin: 0 0 6px; font-size: var(--t-m); font-weight: 650; }
.sheet-dialog p { margin: 0; color: var(--text-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- narrow-only blocks: shown when the inspector is gone ---------- */

.narrow-only { display: none; }
.result-shortcuts { margin-top: 12px; }
.result-alternatives { scroll-margin-top: 72px; }

/* ---------- responsive ---------- */

@media (max-width: 1280px) {
  :root { --sidebar-w: 232px; --inspector-w: 328px; }
  .content { padding: 32px 32px 48px; }
  .actionbar { padding: 12px 32px; }
  .q-item { --q-poster: 120px; column-gap: 22px; }
}

@media (max-width: 1100px) {
  .app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .inspector { display: none; }
  .narrow-only { display: block; }
  /* The details of the focused pick come right below the card, so the card keeps only the model's sentence. */
  .hero-reasons:not(:has(.is-ai)) { display: none; }
  .hero-reason:not(.is-ai):not(.is-caveat) { display: none; }
  /* Its details right below have «Уже смотрел» too: one button for the leader is enough. */
  .pick-hero:has(> .hero[aria-pressed="true"]) > .seen-btn { display: none; }
  .pick-hero:has(> .hero[aria-pressed="true"]) .hero-body { padding-bottom: 4px; }
  .detail-inline { margin-top: 20px; padding: 18px; border: 1px solid var(--sep); border-radius: 16px; background: var(--panel); }
  .q-item { --q-poster: 112px; }
}

@media (max-width: 760px) {
  .app { display: block; height: auto; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 50;
    width: min(86vw, 320px);
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.24s ease, visibility 0s linear 0.24s;
  }
  .sidebar.is-open { transform: none; visibility: visible; transition: transform 0.24s ease; box-shadow: var(--shadow-drawer); }
  .icon-btn.sidebar-close { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 49; background: var(--scrim); }
  .scrim[hidden] { display: none; }

  .main { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
  .toolbar { position: sticky; top: 0; z-index: 20; padding: 0 8px; gap: 4px; }
  .icon-btn.menu-btn { display: grid; }
  .back-btn, .restart-btn { padding: 0 8px; }
  .restart-btn .label { display: none; }
  .content { flex: 1; overflow: visible; padding: 22px 16px 28px; }
  .actionbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  .actionbar .btn-lg { padding: 0 18px; }

  .q-title { font-size: var(--t-xl); }
  .q-hint { font-size: var(--t-base); }
  .q-body { margin-top: 22px; }

  /* Poster and question side by side, the hint under both. */
  .q-item { --q-poster: 88px; column-gap: 14px; grid-template-rows: auto auto; align-items: center; }
  .q-item > .poster { grid-row: 1; }
  .q-item-head { padding-top: 0; }
  .q-item .q-title { font-size: var(--t-l); line-height: 1.25; }
  .q-item > .q-hint { grid-column: 1 / -1; margin-top: 14px; }
  .q-item + .q-body { margin-top: 20px; }

  /* The long first filter gets its own line, the three short ones share the second. */
  .my-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .my-tabs .seg { min-height: 34px; padding: 0 8px; }
  .my-tabs .seg:first-child { grid-column: 1 / -1; }

  .grid-tools { flex-wrap: wrap; }
  .grid-tools .search { flex-basis: 100%; max-width: none; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .pcard-title { font-size: var(--t-s); }
  .pcard-meta { font-size: var(--t-xs); }
  .badge { top: 6px; right: 6px; width: 22px; height: 22px; }

  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { min-height: 100px; }

  .hero { grid-template-columns: 104px minmax(0, 1fr); gap: 14px; padding: 12px; }
  .hero-title { font-size: var(--t-l); }
  .alt { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .alt > .status { grid-column: 2; justify-self: start; margin: -6px 0 0; height: 22px; font-size: var(--t-xs); }
  .detail-inline { padding: 16px 14px; }
  .detail-head { grid-template-columns: 92px minmax(0, 1fr); gap: 14px; }
  .fork { padding: 12px; }
  /* Fork options are long phrases: on a phone they stack as full-width rows instead of wrapping unevenly. */
  .fork .segmented { display: flex; flex-direction: column; width: 100%; }
  .fork .seg { min-height: 40px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .busy-bar::before { animation: none; left: 0; width: 100%; opacity: 0.6; }
}

/* ---------- anchors: a poster with four reactions; «за что» as a pair ---------- */

.acard { cursor: default; }
.acard.is-marked .poster { outline: 3px solid var(--accent); outline-offset: 3px; }
.badge.is-on { background: var(--accent-fill); border-color: var(--accent-fill); }
.badge.is-on .i { opacity: 1; }
.reacts { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.react {
  min-height: 34px;
  padding: 0 6px;
  border: 1px solid var(--sep-strong);
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-size: var(--t-s);
  font-weight: 500;
  cursor: pointer;
}
.react:hover { background: var(--fill); }
.react:active { background: var(--fill-2); }
.react[aria-pressed="true"] { background: var(--accent-fill); border-color: var(--accent-fill); color: var(--on-accent); }
.mini-tag { color: var(--text-2); font-size: var(--t-s); white-space: nowrap; }

.pair { display: flex; width: 100%; max-width: 620px; }
.pair .seg { flex: 1 1 0; min-height: 44px; padding: 6px 12px; font-size: var(--t-base); line-height: 1.25; }
.more-chips { margin-top: 18px; }
.profile { margin-top: 28px; max-width: 680px; }
.row[aria-pressed="true"] .row-chev { color: var(--accent-text); }

/* ---------- evidence: the English original on request ---------- */

.ev-orig { display: inline; margin-left: 6px; }
.ev-orig > summary { display: inline; cursor: pointer; color: var(--accent-text); font-size: var(--t-s); list-style: none; }
.ev-orig > summary::-webkit-details-marker { display: none; }
.ev-orig[open] > summary { color: var(--text-2); }
.ev-orig > .ev-q { display: block; margin-top: 4px; }
.detail.is-compact { padding-top: 0; }

/* A long label («Попробуй: мало данных о твоём вкусе») wraps in narrow places: a phone, the detail panel. */
.status { max-width: 100%; white-space: normal; height: auto; min-height: 24px; padding-block: 3px; }

@media (max-width: 760px) {
  /* On a phone it sits under the title of an alternative. */
  .alt { grid-template-columns: 54px minmax(0, 1fr); row-gap: 8px; }
  .alt > .status { grid-column: 2; justify-self: start; margin-right: 0; }
  /* «Уже смотрел» goes under the text column, so the title and the status keep the card's full width. */
  .pick-alt { grid-template-columns: minmax(0, 1fr); }
  .pick-alt > .seen-btn { justify-self: start; margin: -2px 0 10px 76px; }
}

/* ---------- AI picker on the result screen (src/ai/pick.js) ---------- */

.ai-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: -6px 0 16px;
  color: var(--text-2);
  font-size: var(--t-s);
  line-height: 1.5;
}
.ai-note > .i { flex: none; margin-top: 2px; color: var(--text-3); }
.ai-note b { color: var(--text); font-weight: 600; }
.ai-note.is-quiet { align-items: center; flex-wrap: wrap; }
.ai-note.is-quiet > .i { margin-top: 0; color: var(--text-3); }
/* A long message stays beside its icon on a phone; the button goes to the next line instead. */
.ai-note.is-quiet > span { flex: 1 1 0; min-width: 12em; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.hero-reason.is-ai .i { color: var(--accent-text); }
.hero-reason.is-caveat { color: var(--text-2); font-size: var(--t-s); }
.hero-reason.is-caveat .i { color: var(--text-3); margin-top: 2px; }
.alt-reason {
  color: var(--text-2);
  font-size: var(--t-s);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.alt-reason > .i { width: 12px; height: 12px; margin-right: 4px; vertical-align: -1px; color: var(--text-3); }
.seen-hint { display: block; margin-top: 4px; color: var(--text-2); font-size: var(--t-s); line-height: 1.4; }
.link-btn.is-quiet { color: var(--text-2); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--sep-strong); }
.link-btn.is-quiet:hover { color: var(--text); }

.ai-wish { margin-top: 24px; }
.ai-wish .group-title { display: block; }

#intent-controls { margin-top: 12px; }
.evening-controls { margin: 18px 0; padding-top: 16px; border-top: 1px solid var(--sep); }
.evening-controls summary, .evening-entry > summary { cursor: pointer; line-height: 1.5; }
.evening-fit { margin-top: 12px; }
.evening-buttons { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.evening-buttons [aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.evening-reason { display: grid; gap: 10px; margin: 12px 0; }
.evening-reason label { display: grid; gap: 5px; color: var(--text-2); font-size: var(--t-s); }
.evening-reason textarea { resize: vertical; min-height: 62px; }
.evening-reason .input { width: 100%; min-width: 0; }
.evening-reason button { justify-self: start; }
.evening-help, .evening-status { font-size: var(--t-s); color: var(--text-3); line-height: 1.5; margin-top: 10px; }
.evening-chosen { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: var(--t-s); }
.evening-progress { display: grid; gap: 12px; margin-top: 12px; justify-items: start; }
.evening-list { display: grid; gap: 16px; }
.evening-entry { border: 1px solid var(--sep); border-radius: 14px; padding: 16px; overflow-wrap: anywhere; }
.evening-entry > summary { font-weight: 600; }
.evening-context { margin: 12px 0; color: var(--text-2); line-height: 1.5; }
.evening-card { margin-top: 18px; }
.intent-review { margin-top: 16px; }
.intent-check { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 10px; margin: 12px 0; line-height: 1.45; cursor: pointer; }
.intent-check input { margin-top: 4px; accent-color: var(--text); }
.intent-check small { display: block; color: var(--text-2); font-size: var(--t-s); overflow-wrap: anywhere; }

.ai-skip { margin: 16px 0 0; }
.skel { display: block; border-radius: 16px; background: var(--group); border: 1px solid var(--sep); position: relative; overflow: hidden; }
.skel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--fill), transparent);
  transform: translateX(-100%);
  animation: skel 1.4s ease-in-out infinite;
}
@keyframes skel { to { transform: translateX(100%); } }
.skel-hero { display: grid; grid-template-columns: 172px minmax(0, 1fr); gap: 24px; padding: 16px; }
.skel-poster { display: block; aspect-ratio: 2 / 3; border-radius: 10px; background: var(--fill); }
.skel-lines { display: flex; flex-direction: column; gap: 12px; padding-top: 6px; }
.skel-lines > span { display: block; height: 14px; border-radius: 7px; background: var(--fill); }
.skel-lines > span:nth-child(1) { width: 40%; }
.skel-lines > span:nth-child(2) { width: 75%; height: 22px; }
.skel-lines > span:nth-child(3) { width: 60%; }
.skel-alts { display: grid; gap: 8px; margin-top: 30px; }
.skel-alt { height: 76px; border-radius: 12px; }
@media (max-width: 760px) {
  .skel-hero { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; padding: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .skel::after { animation: none; }
}
