:root {
  --bg: #141414;
  --panel: #1f1f1f;
  --panel-2: #2a2a2a;
  --text: #f2f2f2;
  --muted: #a3a3a3;
  --accent: #e50914;
  --accent-2: #ff3b45;
  --good: #46d369;
  --line: #333;
  --radius: 12px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
a { color: var(--accent-2); }
main, .top, .credit { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 20px; }
.top h1 { margin: 0; font-size: 28px; color: var(--accent); letter-spacing: -0.5px; }
.tag { margin: 2px 0 8px; color: var(--muted); }
h2 { font-size: 18px; margin: 0 0 8px; }
h2.q { margin-top: 20px; font-size: 16px; color: var(--muted); font-weight: 600; }
.opt { color: var(--muted); font-weight: 400; font-size: 14px; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 12px; }
.status { min-height: 1.4em; color: var(--muted); }
.error { color: #ff7a7a !important; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 13px; }

.callout { background: #3a1214; border: 1px solid var(--accent); border-radius: var(--radius); padding: 12px 14px; margin: 12px 0; }
.callout.soft { background: var(--panel); border-color: var(--line); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 15px; cursor: pointer;
}
.chip.on { background: var(--text); color: #000; border-color: var(--text); font-weight: 600; }

button, .file span, a.primary { font: inherit; cursor: pointer; }
.primary, .secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: 8px; padding: 10px 16px; border: 0; text-decoration: none; font-weight: 600;
}
.primary { background: var(--accent); color: #fff; }
.primary:hover { background: var(--accent-2); }
.primary:disabled { opacity: 0.6; cursor: wait; }
.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
.secondary:hover { background: #363636; }
.big { width: 100%; margin-top: 22px; padding: 14px; font-size: 17px; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; padding: 6px; }
.danger { color: #ff7a7a; margin-top: 12px; }
.mini {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 9px; font-size: 13px;
}
.mini.on { background: var(--good); color: #000; border-color: var(--good); }

input[type=search], input[type=text], input[type=password], textarea, select {
  width: 100%; background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font: inherit;
}
select { width: auto; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row input { flex: 1; min-width: 0; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file { position: relative; display: inline-block; }
.file:focus-within span { outline: 2px solid var(--accent-2); }

.panel { background: var(--panel); border-radius: var(--radius); padding: 16px; margin: 14px 0; }
details { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
summary { cursor: pointer; font-weight: 600; }

/* pick cards */
.picks { display: grid; gap: 14px; margin-top: 8px; }
.card { display: grid; grid-template-columns: 120px 1fr; gap: 14px; background: var(--panel); border-radius: var(--radius); padding: 12px; }
.poster { width: 120px; aspect-ratio: 2/3; object-fit: cover; border-radius: 8px; background: var(--panel-2); }
.poster.none, .thumb.none { display: grid; place-items: center; font-size: 28px; }
.card h3 { margin: 0 0 4px; font-size: 18px; }
.meta { color: var(--muted); font-weight: 400; font-size: 13px; }
.why { margin: 0 0 4px; color: var(--good); font-weight: 600; font-size: 14px; }
.rating { margin: 0 0 6px; font-size: 14px; }
.overview { margin: 0 0 10px; color: #d0d0d0; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.feedback { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; font-size: 14px; color: var(--muted); }
#more { width: 100%; margin-top: 14px; }

/* lists */
.results, .list { list-style: none; padding: 0; margin: 8px 0 0; }
.result, .list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.result img, .list img, .thumb { width: 40px; height: 60px; object-fit: cover; border-radius: 4px; flex: none; background: var(--panel-2); }
.thumb.none { font-size: 18px; }
.grow { flex: 1; min-width: 0; }
.grow b { overflow-wrap: anywhere; }
.btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.list select { padding: 5px 6px; font-size: 13px; }
.list.compact li { padding: 4px 0; justify-content: space-between; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.list-head h2 { margin: 0; }
.badges { display: flex; gap: 4px; margin-top: 2px; }
.badge { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: var(--panel-2); color: var(--muted); }
.badge.netflix { background: #3a1214; color: #ff9da2; }
#list-more { margin-top: 10px; width: 100%; }

/* bottom tabs */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; justify-content: center;
  background: rgba(20, 20, 20, 0.96); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); backdrop-filter: blur(8px);
}
.tabs a {
  flex: 1; max-width: 200px; display: flex; flex-direction: column; align-items: center;
  padding: 8px 0; color: var(--muted); text-decoration: none; font-size: 20px;
}
.tabs a span { font-size: 12px; margin-top: 2px; }
.tabs a.active { color: var(--text); }
.credit { color: #6f6f6f; font-size: 12px; padding: 20px 16px; }
.credit a { color: inherit; }

@media (max-width: 480px) {
  .card { grid-template-columns: 90px 1fr; gap: 10px; }
  .poster { width: 90px; }
  .result { flex-wrap: wrap; }
  .result .btns { width: 100%; justify-content: flex-start; padding-left: 50px; }
}
