:root {
  color-scheme: light;
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-2: #efede7;
  --ink: #191917;
  --muted: #66635c;
  --soft: #d9d5c9;
  --line: #d8d4c8;
  --accent: #2d665a;
  --accent-2: #8f3f37;
  --blue: #2b5b7f;
  --shadow: 0 18px 50px rgba(24, 22, 18, 0.13);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(247, 245, 240, 0.86)),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  margin: 0 auto;
  max-width: 1200px;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  width: 100%;
}

.top-bar {
  align-items: center;
  display: flex;
  height: 64px;
  justify-content: flex-end;
  padding: 12px 14px;
  position: relative;
  z-index: 5;
}

.icon-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  display: inline-grid;
  height: 44px;
  justify-content: center;
  padding: 0;
  width: 44px;
}

.icon-button:hover,
.icon-button:focus-visible {
  background: rgba(25, 25, 23, 0.07);
  outline: 0;
}

[data-icon] svg,
.icon-button svg {
  display: block;
  height: 24px;
  stroke-width: 2;
  width: 24px;
}

.home {
  min-height: calc(100vh - 64px);
  position: relative;
}

.search-zone {
  left: 50%;
  max-width: 620px;
  padding: 0 16px;
  position: absolute;
  top: 42%;
  transform: translate(-50%, -50%);
  transition: top 210ms ease-out, transform 210ms ease-out;
  width: 100%;
  z-index: 3;
}

.home-header {
  display: flex;
  justify-content: center;
  margin: 0 auto 14px;
  max-height: clamp(78px, 16vw, 140px);
  opacity: 1;
  pointer-events: none;
  transform: translateY(0);
  transition: opacity 180ms ease-out, transform 180ms ease-out, max-height 210ms ease-out, margin 210ms ease-out;
}

.home-header img {
  display: block;
  height: auto;
  max-height: clamp(72px, 15vw, 130px);
  max-width: min(380px, 88vw);
  object-fit: contain;
  width: 100%;
}

.app-shell.search-active .search-zone {
  pointer-events: none;
  top: 14px;
  transform: translate(-50%, 0);
}

.app-shell.search-active .home-header {
  margin-bottom: 0;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-12px);
}

.app-shell.search-active .menu-button {
  opacity: 0;
  pointer-events: none;
}

.search-row {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 0 1fr 0;
  transition: grid-template-columns 200ms ease-out;
}

.app-shell.search-active .search-row {
  grid-template-columns: 44px 1fr 44px;
  pointer-events: auto;
}

.back-button,
.home-button {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-10px);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.home-button {
  transform: translateX(10px);
}

.app-shell.search-active .back-button,
.app-shell.search-active .home-button {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.search-box {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(22, 22, 19, 0.08);
  display: grid;
  gap: 8px;
  grid-template-columns: 28px 1fr 40px;
  height: 54px;
  padding: 0 6px 0 16px;
}

.search-box:focus-within {
  border-color: rgba(45, 102, 90, 0.45);
  box-shadow: 0 12px 36px rgba(45, 102, 90, 0.14);
}

.search-icon {
  color: var(--muted);
}

.search-box input {
  background: transparent;
  border: 0;
  color: var(--ink);
  min-width: 0;
  outline: 0;
  width: 100%;
}

.search-box input::placeholder {
  color: #8a867d;
}

.clear-button {
  height: 40px;
  opacity: 0;
  pointer-events: none;
  width: 40px;
}

.clear-button.visible {
  opacity: 1;
  pointer-events: auto;
}

.home-actions {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 22px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 160ms ease-out, transform 160ms ease-out;
}

.app-shell.search-active .home-actions {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.action-tile {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 26px rgba(24, 22, 18, 0.08);
  color: var(--ink);
  display: grid;
  gap: 8px;
  grid-template-rows: 32px auto;
  height: 98px;
  justify-items: center;
  padding: 14px;
}

.action-tile:hover,
.action-tile:focus-visible {
  border-color: rgba(45, 102, 90, 0.45);
  outline: 0;
  transform: translateY(-1px);
}

.action-tile [data-icon] svg {
  height: 30px;
  width: 30px;
}

.results-panel {
  display: none;
  left: 50%;
  max-height: calc(100vh - 100px);
  max-width: 620px;
  overflow: auto;
  padding: 84px 16px 28px;
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  width: 100%;
  z-index: 2;
}

.app-shell.search-active .results-panel {
  display: block;
}

.result-row {
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  display: grid;
  gap: 12px;
  grid-template-columns: 54px 1fr;
  min-height: 78px;
  padding: 11px;
  text-align: left;
  width: 100%;
}

.result-row + .result-row {
  margin-top: 8px;
}

.result-row:hover,
.result-row:focus-visible {
  background: var(--surface);
  border-color: var(--line);
  outline: 0;
}

.result-image {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 7px;
  object-fit: cover;
  width: 54px;
}

.result-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.result-copy strong,
.result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-copy small {
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  padding: 26px 8px;
  text-align: center;
}

.drawer {
  background: rgba(25, 25, 23, 0.18);
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 180ms ease-out;
  z-index: 20;
}

.drawer.open {
  opacity: 1;
  pointer-events: auto;
}

.drawer-panel {
  background: var(--surface);
  box-shadow: var(--shadow);
  height: 100%;
  margin-left: auto;
  max-width: 360px;
  padding: 20px;
  transform: translateX(100%);
  transition: transform 190ms ease-out;
  width: min(88vw, 360px);
}

.drawer.open .drawer-panel {
  transform: translateX(0);
}

.drawer-header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0 0 5px;
  text-transform: uppercase;
}

.drawer h2 {
  font-size: 1.22rem;
  line-height: 1.15;
  margin: 0;
}

.drawer-link {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  display: block;
  padding: 16px 0;
  text-align: left;
  width: 100%;
}

.view-sheet {
  background: var(--bg);
  display: none;
  inset: 0;
  overflow: auto;
  padding: 0 16px 40px;
  position: fixed;
  z-index: 12;
}

.view-sheet.open {
  display: block;
}

.sheet-inner {
  margin: 0 auto;
  max-width: 980px;
}

.sheet-header {
  align-items: center;
  background: rgba(250, 248, 242, 0.96);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 18px 0 14px;
  position: sticky;
  top: 0;
  z-index: 6;
}

.sheet-header .icon-button {
  flex: 0 0 48px;
  height: 48px;
  width: 48px;
}

.sheet-title {
  flex: 1;
  margin: 0;
  min-width: 0;
  text-align: center;
}

.grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.movie-card,
.person-card,
.settings-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.person-card.clickable {
  cursor: pointer;
}

.person-card.clickable:hover,
.person-card.clickable:focus-within {
  border-color: rgba(45, 102, 90, 0.45);
}

.movie-card img {
  aspect-ratio: 2 / 3;
  background: var(--surface-2);
  object-fit: cover;
  width: 100%;
}

.detail-movie-card {
  margin: 0 auto;
  max-width: 720px;
}

.detail-person-card {
  margin: 0 auto;
  max-width: 720px;
}

.detail-movie-card > img {
  border-radius: calc(var(--radius) - 2px);
  display: block;
  margin: 16px auto 0;
  width: 80%;
}

.poster-button {
  background: transparent;
  border: 0;
  cursor: pointer;
  display: block;
  padding: 0;
  text-align: left;
  width: 100%;
}

.poster-button:focus-visible {
  outline: 2px solid rgba(44, 121, 168, 0.65);
  outline-offset: 3px;
}

.poster-button:hover img {
  filter: brightness(0.96);
}

.list-movie-card .card-body {
  gap: 0;
}

.list-movie-card h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.card-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.card-body h3,
.card-body p {
  margin: 0;
}

.card-body p {
  color: var(--muted);
  line-height: 1.45;
}

.team-list {
  display: grid;
  gap: 8px;
}

.credit-section {
  display: grid;
  gap: 8px;
}

.credit-section h4 {
  font-size: 0.92rem;
  margin: 4px 0 0;
}

.credit-actions {
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.credit-note {
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.team-pill {
  align-items: center;
  background: #f4f2ec;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 36px;
  padding: 7px 9px;
}

.credit-image-button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  display: block;
  height: 42px;
  overflow: hidden;
  padding: 0;
  width: 42px;
}

.credit-image-button img {
  aspect-ratio: 1;
  background: var(--surface-2);
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.credit-image-button:hover,
.credit-image-button:focus-visible {
  outline: 2px solid rgba(45, 102, 90, 0.28);
  outline-offset: 2px;
}

.credit-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.credit-role::before {
  content: " · ";
}

.credit-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.person-link {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: inherit;
  font-weight: 650;
  min-height: 28px;
  overflow-wrap: anywhere;
  padding: 2px 4px;
  text-align: left;
}

.person-link:hover,
.person-link:focus-visible {
  background: rgba(45, 102, 90, 0.11);
  outline: 0;
}

.team-pill > button[data-action="toggle-follow"],
.small-button,
.primary-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 44px;
  padding: 8px 11px;
  touch-action: manipulation;
}

.team-pill > button[data-action="toggle-follow"],
.small-button {
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-align: center;
  white-space: nowrap;
}

.small-button[data-action="toggle-like"],
.small-button[data-action="toggle-dislike"],
.small-button[data-action="toggle-watched"] {
  min-width: 92px;
}

.small-button[data-action="toggle-watch-later"] {
  min-width: 138px;
}

.small-button[data-action="toggle-notify-release"] {
  min-width: 158px;
}

.movie-action-button.selected {
  font-weight: 800;
}

.movie-action-button.liked.selected {
  background: rgba(45, 102, 90, 0.14);
  border-color: rgba(45, 102, 90, 0.42);
  color: var(--accent);
}

.movie-action-button.seen.selected {
  background: rgba(70, 67, 62, 0.1);
  border-color: rgba(70, 67, 62, 0.28);
  color: var(--ink);
}

.movie-action-button.passed.selected {
  background: rgba(136, 71, 56, 0.12);
  border-color: rgba(136, 71, 56, 0.32);
  color: #7a3f33;
}

.movie-action-button.watch-later.selected,
.movie-action-button.release.selected {
  background: rgba(146, 103, 39, 0.14);
  border-color: rgba(146, 103, 39, 0.34);
  color: #75531f;
}

.team-pill > button[data-action="toggle-follow"],
.small-button[data-action="toggle-follow"] {
  min-width: 102px;
}

.person-film-list {
  display: grid;
  gap: 10px;
}

.person-film {
  align-items: center;
  background: #f4f2ec;
  border-radius: 8px;
  display: grid;
  gap: 11px;
  grid-template-columns: 52px minmax(0, 1fr) 150px;
  min-height: 72px;
  padding: 10px;
}

.person-film img {
  aspect-ratio: 1;
  border-radius: 6px;
  object-fit: cover;
  width: 52px;
}

.state-chip-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.state-chip {
  background: rgba(45, 102, 90, 0.1);
  border: 1px solid rgba(45, 102, 90, 0.18);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.person-film .result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.film-state-chip-row {
  align-self: center;
  flex-wrap: nowrap;
  justify-content: flex-end;
  max-width: none;
  min-width: 0;
  overflow: hidden;
  width: 100%;
}

.film-state-chip-row .state-chip {
  border-radius: 7px;
  font-size: 0.68rem;
  flex: 0 0 auto;
  padding: 5px 7px;
}

.state-chip.passed {
  background: rgba(70, 67, 62, 0.08);
  border-color: rgba(70, 67, 62, 0.16);
  color: var(--muted);
}

.state-chip.seen {
  background: rgba(70, 67, 62, 0.08);
  border-color: rgba(70, 67, 62, 0.16);
  color: var(--muted);
}

.state-chip.followed {
  background: rgba(45, 102, 90, 0.1);
  border-color: rgba(45, 102, 90, 0.18);
  color: var(--accent);
}

.state-chip.watch-later,
.state-chip.release {
  background: rgba(146, 103, 39, 0.1);
  border-color: rgba(146, 103, 39, 0.18);
  color: #75531f;
}

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

.evidence-chip {
  background: rgba(45, 102, 90, 0.08);
  border: 1px solid rgba(45, 102, 90, 0.16);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  min-height: 30px;
  padding: 7px 9px;
  text-align: left;
}

.evidence-chip:hover,
.evidence-chip:focus-visible {
  background: rgba(45, 102, 90, 0.14);
  outline: 0;
}

.evidence-chip.is-liked {
  background: rgba(45, 102, 90, 0.18);
  border-color: rgba(45, 102, 90, 0.34);
  color: #224f46;
}

.recommendation-connection-evidence {
  align-items: flex-start;
  gap: 7px;
}

.connection-prefix,
.connection-from {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 30px;
}

.evidence-connection {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 5px;
}

.person-evidence-chip {
  background: rgba(37, 78, 110, 0.08);
  border-color: rgba(37, 78, 110, 0.16);
  color: #254e6e;
}

.evidence-text-link {
  background: transparent;
  border: 0;
  border-radius: 3px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
  min-height: 30px;
  padding: 2px 1px;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.evidence-text-link:hover,
.evidence-text-link:focus-visible {
  color: var(--ink);
  outline: 0;
}

.evidence-text-link.is-liked {
  color: #224f46;
}

.person-evidence-link {
  color: #254e6e;
}

.person-evidence-link.is-followed {
  color: #224f46;
}

.why-button {
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  margin-top: 4px;
  min-height: 30px;
  padding: 4px 0;
  text-align: left;
}

.why-button:hover,
.why-button:focus-visible {
  color: var(--ink);
  outline: 0;
}

.recommendation-detail-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 18px;
  margin: 0 auto;
  max-width: 760px;
  padding: 16px;
}

.recommendation-detail-hero {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: 132px minmax(0, 1fr);
}

.recommendation-detail-hero img {
  aspect-ratio: 2 / 3;
  border-radius: 7px;
  object-fit: cover;
  width: 100%;
}

.recommendation-detail-copy {
  display: grid;
  gap: 10px;
}

.recommendation-detail-copy h2 {
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0;
}

.recommendation-detail-copy h2 span {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

.recommendation-detail-copy p,
.recommendation-note {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

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

.score-breakdown div {
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 10px;
}

.score-breakdown strong {
  color: var(--accent-2);
  font-size: 1.1rem;
}

.score-breakdown span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.recommendation-evidence-list {
  display: grid;
  gap: 8px;
}

.recommendation-evidence-row {
  align-items: start;
  background: #f4f2ec;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr);
  min-height: 62px;
  padding: 8px 10px;
}

.recommendation-evidence-image {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: 8px;
  object-fit: cover;
  width: 42px;
}

.recommendation-evidence-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.recommendation-evidence-row small {
  color: var(--muted);
  font-size: 0.78rem;
}

.recommendation-evidence-source {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.recommendation-evidence-source .state-chip-row {
  display: inline-flex;
  justify-content: flex-start;
}

.primary-button {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

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

.list-footer {
  display: flex;
  justify-content: center;
  margin-top: 14px;
}

.team-pill > button[data-action="toggle-follow"]:disabled,
.small-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.team-pill > button[data-action="toggle-follow"][data-saving="true"],
.small-button[data-saving="true"] {
  padding-right: 28px;
}

.team-pill > button[data-action="toggle-follow"][data-saving="true"]::after,
.small-button[data-saving="true"]::after {
  animation: button-saving-spin 0.8s linear infinite;
  border: 2px solid rgba(45, 102, 90, 0.2);
  border-top-color: var(--accent);
  border-radius: 999px;
  content: "";
  height: 12px;
  margin-top: -6px;
  position: absolute;
  right: 9px;
  top: 50%;
  width: 12px;
}

.hydrating-region[data-hydrating="true"] {
  pointer-events: none;
}

.hydrating-region[data-hydrating="false"][data-arrived="true"] {
  animation: hydrated-content-arrive 220ms ease-out both;
}

.person-film-list.hydrating-region[data-hydrating="false"][data-arrived="true"] .person-film,
.detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-section,
.detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-actions,
.detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-note {
  animation: hydrated-item-arrive 260ms ease-out both;
}

.person-film-list.hydrating-region[data-hydrating="false"][data-arrived="true"] .person-film:nth-child(2),
.detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-section:nth-child(2) {
  animation-delay: 35ms;
}

.person-film-list.hydrating-region[data-hydrating="false"][data-arrived="true"] .person-film:nth-child(3),
.detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-actions,
.detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-note {
  animation-delay: 65ms;
}

.view-sheet[data-traversal-locked="true"] .hydrating-region,
.view-sheet[data-traversal-locked="true"] .team-pill .person-link,
.view-sheet[data-traversal-locked="true"] .team-pill .credit-image-button,
.view-sheet[data-traversal-locked="true"] .person-film,
.view-sheet[data-traversal-locked="true"] .poster-button,
.view-sheet[data-traversal-locked="true"] .evidence-chip,
.view-sheet[data-traversal-locked="true"] .role-filter {
  pointer-events: none;
}

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

@keyframes hydrated-content-arrive {
  from {
    opacity: 0.72;
  }
  to {
    opacity: 1;
  }
}

@keyframes hydrated-item-arrive {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hydrating-region[data-hydrating="false"][data-arrived="true"],
  .person-film-list.hydrating-region[data-hydrating="false"][data-arrived="true"] .person-film,
  .detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-section,
  .detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-actions,
  .detail-movie-card .hydrating-region[data-hydrating="false"][data-arrived="true"] .credit-note {
    animation: none;
  }
}

.status-toast {
  background: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  bottom: 18px;
  box-shadow: 0 18px 40px rgba(25, 25, 23, 0.22);
  color: var(--bg);
  font-size: 0.9rem;
  left: 50%;
  max-width: min(420px, calc(100vw - 32px));
  opacity: 0;
  padding: 12px 14px;
  pointer-events: none;
  position: fixed;
  text-align: center;
  transform: translate(-50%, 12px);
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 30;
}

.status-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.status-toast.error {
  background: #3a1f1b;
}

.list-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.list-tab {
  align-items: center;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  min-height: 38px;
  padding: 8px 11px;
}

.list-tab:hover,
.list-tab:focus-visible {
  background: rgba(45, 102, 90, 0.1);
  color: var(--ink);
  outline: 0;
}

.list-tab.selected {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 700;
}

.list-tab-count {
  background: rgba(45, 102, 90, 0.1);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  min-width: 1.6em;
  padding: 4px 6px;
  text-align: center;
}

.list-tab.selected .list-tab-count {
  background: rgba(45, 102, 90, 0.16);
  color: var(--ink);
}

.list-tab-panel {
  margin-top: 16px;
}

.role-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2px;
}

.role-filter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 34px;
  padding: 7px 10px;
}

.role-filter.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.score {
  color: var(--accent-2);
  font-weight: 800;
}

.section {
  margin-top: 28px;
}

.section h2 {
  margin: 0 0 12px;
}

.settings-card {
  padding: 18px;
}

.settings-card + .settings-card {
  margin-top: 12px;
}

.auth-form {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.auth-form input {
  background: #f4f2ec;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 11px;
}

.auth-message {
  color: var(--accent);
  font-weight: 650;
}

.auth-note {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 10px;
}

.settings-card code {
  background: #ece8dc;
  border-radius: 6px;
  display: block;
  margin-top: 10px;
  overflow: auto;
  padding: 10px;
}

.brand-line {
  color: var(--muted);
  font-size: clamp(0.92rem, 2vw, 1.02rem);
  line-height: 1.4;
  margin: -2px 0 18px;
  text-align: center;
}

.app-shell.search-active .brand-line {
  display: none;
}

.search-box {
  backdrop-filter: blur(14px);
}

.app-shell.search-active .search-zone {
  max-width: 680px;
}

.results-panel {
  max-width: 680px;
  padding-top: 92px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.result-row {
  background: rgba(250, 248, 242, 0.78);
  border-color: rgba(216, 212, 200, 0.72);
  box-shadow: none;
  grid-template-columns: 58px minmax(0, 1fr);
  min-height: 82px;
  padding: 10px;
}

.result-row.has-state-chips {
  grid-template-columns: 58px minmax(0, 1fr) 150px;
}

.result-row:hover,
.result-row:focus-visible {
  background: #fffefa;
  border-color: rgba(45, 102, 90, 0.3);
}

.result-copy strong {
  font-size: 1rem;
  letter-spacing: 0;
}

.result-copy small,
.meta-text {
  color: var(--muted);
  font-weight: 500;
}

.result-row.person-film {
  grid-template-columns: 52px minmax(0, 1fr) 150px;
  min-height: 72px;
}

.search-empty {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
}

.sheet-inner {
  max-width: 980px;
}

.sheet-header {
  backdrop-filter: blur(14px);
  margin-bottom: 22px;
}

.sheet-title,
.card-body h3,
.recommendation-detail-copy h2,
.section h2 {
  letter-spacing: 0;
}

.sheet-title {
  font-size: clamp(1.6rem, 4vw, 2.35rem);
  line-height: 1;
}

.view-sheet .grid {
  gap: 10px;
  grid-template-columns: 1fr;
  margin: 0 auto;
  max-width: 820px;
}

.list-grid:not(.list-grid-follows) {
  align-items: start;
  gap: 18px 14px;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  max-width: 980px;
}

.movie-card,
.person-card,
.settings-card,
.recommendation-detail-card {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(216, 212, 200, 0.82);
  box-shadow: none;
}

.movie-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
}

.movie-card .poster-button {
  align-self: start;
}

.movie-card > img {
  align-self: stretch;
}

.movie-card .poster-button img,
.movie-card > img {
  aspect-ratio: 2 / 3;
  display: block;
  min-height: 158px;
  object-fit: cover;
  width: 100%;
}

.movie-card .poster-button img {
  height: auto;
  min-height: 0;
}

.movie-card > img {
  height: 100%;
}

.list-movie-card .card-body,
.recommendation-card .card-body {
  align-content: center;
  gap: 9px;
  padding: 16px 18px;
}

.list-grid:not(.list-grid-follows) .list-movie-card {
  background: transparent;
  border: 0;
  display: block;
  overflow: visible;
}

.list-grid:not(.list-grid-follows) .list-movie-card .poster-button {
  border-radius: var(--radius);
  overflow: visible;
}

.list-grid:not(.list-grid-follows) .list-movie-card .poster-button img {
  border: 1px solid rgba(216, 212, 200, 0.92);
  border-radius: var(--radius);
  box-shadow: 0 10px 26px rgba(24, 22, 18, 0.08);
  min-height: 0;
}

.list-grid:not(.list-grid-follows) .list-movie-card .card-body {
  display: block;
  padding: 8px 0 0;
}

.list-grid:not(.list-grid-follows) .list-movie-card .record-kicker {
  display: none;
}

.list-grid:not(.list-grid-follows) .list-movie-card h3 {
  font-size: 0.92rem;
  line-height: 1.25;
}

.list-grid:not(.list-grid-follows) .list-movie-card .meta-text {
  white-space: nowrap;
}

.record-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.card-body h3 {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.18;
}

.recommendation-card .card-body {
  grid-template-columns: minmax(0, 1fr);
}

.recommendation-card .card-body > p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.recommendation-evidence {
  margin-top: 8px;
}

.evidence-chip,
.state-chip {
  border-radius: 7px;
}

.why-button {
  width: fit-content;
}

.button-row {
  gap: 7px;
}

.small-button,
.primary-button,
.team-pill > button[data-action="toggle-follow"] {
  border-color: rgba(25, 25, 23, 0.16);
  font-weight: 700;
}

.small-button:hover,
.small-button:focus-visible,
.team-pill > button[data-action="toggle-follow"]:hover,
.team-pill > button[data-action="toggle-follow"]:focus-visible {
  border-color: rgba(45, 102, 90, 0.42);
  outline: 0;
}

.detail-movie-card,
.detail-person-card {
  background: transparent;
  border: 0;
  display: grid;
  gap: 22px;
  max-width: 960px;
  overflow: visible;
}

.detail-movie-card {
  grid-template-columns: minmax(170px, 240px) minmax(0, 1fr);
}

.detail-person-card {
  max-width: 820px;
}

.detail-movie-card > img {
  align-self: start;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  height: auto;
  min-height: 0;
  margin: 0;
  object-fit: cover;
  width: 100%;
}

.detail-movie-card > .card-body,
.detail-person-card > .card-body {
  background: rgba(255, 255, 255, 0.54);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
}

.detail-movie-card .hydrating-region[data-hydrating="false"] {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
}

.detail-movie-card .credit-actions,
.detail-movie-card .credit-note {
  grid-column: 1 / -1;
}

.credit-section {
  align-content: start;
  background: rgba(244, 242, 236, 0.56);
  border: 1px solid rgba(216, 212, 200, 0.72);
  border-radius: var(--radius);
  padding: 12px;
}

.credit-section h4 {
  color: var(--accent-2);
  font-size: 0.78rem;
  letter-spacing: 0;
  margin: 0 0 4px;
  text-transform: uppercase;
}

.team-pill,
.person-film,
.recommendation-evidence-row {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 212, 200, 0.7);
}

.team-pill {
  gap: 11px;
  grid-template-columns: 50px minmax(0, 1fr) minmax(92px, auto);
  min-height: 70px;
  padding: 10px;
}

.credit-image-button {
  height: 50px;
  width: 50px;
}

.credit-copy {
  gap: 3px;
}

.credit-role::before {
  content: "";
}

.list-tabs {
  margin-left: auto;
  margin-right: auto;
  max-width: 820px;
  scrollbar-width: thin;
}

.results-panel::-webkit-scrollbar,
.list-tabs::-webkit-scrollbar {
  height: 0;
  width: 0;
}

.list-tab {
  border-radius: 7px;
}

.empty-state {
  line-height: 1.45;
}

@media (max-width: 520px) {
  .top-bar {
    height: 58px;
  }

  .home {
    min-height: calc(100vh - 58px);
  }

  .search-zone {
    top: 43%;
  }

  .action-tile {
    height: 92px;
  }

  .brand-line {
    margin-bottom: 14px;
  }

  .app-shell.search-active .search-zone {
    top: 12px;
  }

  .app-shell.search-active .search-row {
    gap: 4px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
  }

  .app-shell.search-active .icon-button {
    height: 38px;
    width: 38px;
  }

  .search-box {
    height: 52px;
    padding-left: 12px;
  }

  .results-panel {
    max-height: calc(100vh - 84px);
    padding: 82px 16px 24px;
  }

  .result-row {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .result-row.has-state-chips {
    grid-template-columns: 52px minmax(0, 1fr) 78px;
    min-height: 76px;
  }

  .result-row.has-state-chips .film-state-chip-row {
    gap: 4px;
    grid-column: auto;
    justify-content: flex-end;
    width: 78px;
  }

  .result-row.has-state-chips .film-state-chip-row .state-chip {
    font-size: 0.65rem;
    padding: 4px 6px;
  }

  .view-sheet {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sheet-header {
    gap: 8px;
  }

  .sheet-title {
    text-align: left;
  }

  .movie-card {
    grid-template-columns: 92px minmax(0, 1fr);
  }

  .list-grid:not(.list-grid-follows) {
    gap: 16px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movie-card .poster-button img,
  .movie-card > img {
    min-height: 138px;
  }

  .list-grid:not(.list-grid-follows) .list-movie-card {
    display: block;
  }

  .list-grid:not(.list-grid-follows) .list-movie-card .poster-button img {
    min-height: 0;
  }

  .list-movie-card .card-body,
  .recommendation-card .card-body {
    padding: 14px;
  }

  .list-grid:not(.list-grid-follows) .list-movie-card .card-body {
    padding: 8px 0 0;
  }

  .detail-movie-card {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .detail-movie-card > img {
    justify-self: center;
    margin-left: auto;
    margin-right: auto;
    max-width: 176px;
    width: min(100%, 176px);
  }

  .detail-movie-card > .card-body {
    width: 100%;
  }

  .detail-movie-card .hydrating-region[data-hydrating="false"] {
    grid-template-columns: 1fr;
  }

  .team-pill {
    align-items: center;
    gap: 8px;
    grid-template-columns: 44px minmax(0, 1fr) 76px;
    padding: 10px;
  }

  .team-pill .credit-image-button {
    height: 44px;
    width: 44px;
  }

  .team-pill > button[data-action="toggle-follow"] {
    font-size: 0.9rem;
    justify-self: end;
    margin-top: 2px;
    min-height: 40px;
    min-width: 76px;
    padding: 7px 9px;
  }

  .result-copy strong,
  .result-copy small {
    white-space: normal;
  }

  .person-film .result-copy strong,
  .person-film .result-copy small {
    white-space: nowrap;
  }

  .result-row.person-film {
    grid-template-columns: 52px minmax(0, 1fr) 78px;
    min-height: 76px;
  }

  .person-film .film-state-chip-row {
    gap: 4px;
    grid-column: auto;
    justify-content: flex-end;
    width: 78px;
  }

  .person-film .film-state-chip-row .state-chip {
    font-size: 0.65rem;
    padding: 4px 6px;
  }

  .movie-card .button-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movie-card .button-row .small-button {
    min-width: 0;
    width: 100%;
  }

  .movie-card .button-row .small-button[data-action="toggle-notify-release"] {
    grid-column: 1 / -1;
  }

  .state-chip-row {
    grid-column: 2;
    justify-content: flex-start;
  }

  .person-film .film-state-chip-row {
    grid-column: auto;
    justify-content: flex-end;
  }

  .recommendation-detail-hero,
  .score-breakdown {
    grid-template-columns: 1fr;
  }

  .recommendation-detail-hero .poster-button {
    max-width: 170px;
  }
}

@media (max-width: 360px) {
  .team-pill {
    grid-template-columns: 52px minmax(0, 1fr);
  }

  .team-pill > button[data-action="toggle-follow"] {
    grid-column: 2;
    justify-self: start;
  }
}
