:root {
  --bg: #fafaf8;
  --card: #ffffff;
  --text: #1c1c1a;
  --muted: #5f5f5a;
  --line: #e4e3de;
  --accent: #1f5f8b;
  --ours: #e6f3ea;
  --ours-text: #1d5c33;
  --watched: #fdf1dc;
  --watched-text: #7a4b00;
  --other: #eef0f3;
  --other-text: #3a4250;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

main { max-width: 720px; margin: 0 auto; padding: 1.5rem 1rem 3rem; }

header { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
h1 { font-size: 1.5rem; margin: 0 0 1rem; }

button { font: inherit; cursor: pointer; }
button.primary {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px; padding: .7rem 1.2rem;
}
button.link { background: none; border: 0; color: var(--accent); padding: 0; }

input[type="search"] {
  width: 100%; font-size: 1.1rem; padding: .8rem 1rem;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card);
}
input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#status { color: var(--muted); min-height: 1.5em; margin: .6rem 0; }

#results { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }

.card {
  display: grid; grid-template-columns: 70px 1fr; gap: .9rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem;
}
.card img, .card .noposter { width: 70px; height: 105px; border-radius: 6px; object-fit: cover; background: var(--line); }
.card h2 { font-size: 1.05rem; margin: 0; }
.meta { color: var(--muted); font-size: .9rem; margin: .1rem 0 .5rem; }

.group { margin: .25rem 0; display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.group .label { font-size: .8rem; color: var(--muted); min-width: 7.5rem; }
.chip { font-size: .85rem; border-radius: 999px; padding: .1rem .6rem; }
.chip.ours { background: var(--ours); color: var(--ours-text); font-weight: 600; }
.chip.watched { background: var(--watched); color: var(--watched-text); }
.chip.other { background: var(--other); color: var(--other-text); }
.none { color: var(--muted); font-size: .9rem; }
.card a { font-size: .85rem; color: var(--accent); }

footer { margin-top: 2.5rem; color: var(--muted); font-size: .85rem; }
footer a { color: inherit; }
.small { font-size: .75rem; }

@media (max-width: 480px) {
  .group .label { min-width: 100%; }
}
