:root {
  --bg: #0f1115;
  --panel: #181b22;
  --panel-2: #20242d;
  --line: #2b303b;
  --text: #eef0f4;
  --muted: #9aa3b2;
  --accent: #5b8cff;
  --yours: #2fbf71;
  --free: #3aa0ff;
  --other: #c59a3a;
  --none: #6b7280;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: var(--accent); }
button, input { font: inherit; }

.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: rgba(15, 17, 21, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.gear { color: var(--muted); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; }
.gear:hover, .gear.on { color: var(--text); background: var(--panel); }

main { max-width: 760px; margin: 0 auto; padding: 16px; }
.credit { max-width: 760px; margin: 24px auto 32px; padding: 0 16px; color: var(--muted); font-size: 12px; }
.credit a { color: var(--muted); }

h1 { font-size: 24px; margin: 4px 0 4px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 26px 0 10px; }
.muted { color: var(--muted); }

.search { position: relative; }
.search input {
  width: 100%; padding: 14px 16px 14px 46px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 17px; outline: none;
}
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.notice { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.notice a { font-weight: 600; }
.notice.err { border-color: #7a2e2e; color: #f1b0b0; }

.results { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.result a {
  display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: center;
  padding: 10px; border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none;
  border: 1px solid transparent;
}
.result a:hover { border-color: var(--line); background: var(--panel-2); }
.poster { width: 62px; aspect-ratio: 2/3; border-radius: 8px; background: var(--panel-2) center/cover; }
.result .t { font-weight: 650; }
.result .meta { color: var(--muted); font-size: 13px; }

.pill { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.v-yours { color: var(--yours); background: rgba(47, 191, 113, .12); }
.v-free { color: var(--free); background: rgba(58, 160, 255, .12); }
.v-other, .v-pay { color: var(--other); background: rgba(197, 154, 58, .12); }
.v-none, .v-unknown { color: var(--none); background: rgba(107, 114, 128, .15); }

.back { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); text-decoration: none; margin-bottom: 10px; background: none; border: 0; padding: 0; cursor: pointer; }
.hero { display: grid; grid-template-columns: 120px 1fr; gap: 16px; align-items: start; }
.hero .poster { width: 120px; border-radius: 12px; }
.facts { color: var(--muted); font-size: 14px; }
.verdict { margin: 18px 0 0; padding: 16px; border-radius: var(--radius); font-size: 18px; font-weight: 650; }
.verdict small { display: block; font-weight: 400; font-size: 14px; margin-top: 4px; opacity: .85; }
.verdict.v-yours { background: rgba(47, 191, 113, .14); }

.providers { display: grid; gap: 8px; }
.prov {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--panel);
}
.logo { width: 44px; height: 44px; border-radius: 10px; background: var(--panel-2) center/cover; }
.prov .n { font-weight: 600; }
.prov .k { font-size: 13px; color: var(--muted); }
.prov .open { font-size: 14px; font-weight: 600; text-decoration: none; padding: 7px 12px; border-radius: 9px; background: var(--panel-2); }
.overview { color: #cfd4dc; }

/* settings */
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14px; }
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.filter { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); outline: none; }
.filter:focus { border-color: var(--accent); }
.svc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 10px; }
.svc {
  display: grid; grid-template-columns: 36px 1fr 22px; gap: 10px; align-items: center;
  padding: 8px 10px; border-radius: 12px; background: var(--panel); cursor: pointer; border: 1px solid transparent;
  user-select: none;
}
.svc:hover { background: var(--panel-2); }
.svc.on { border-color: var(--yours); background: rgba(47, 191, 113, .08); }
.svc .logo { width: 36px; height: 36px; border-radius: 8px; }
.svc .n { font-size: 14px; font-weight: 600; line-height: 1.2; }
.svc .tag { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.svc input { width: 20px; height: 20px; accent-color: var(--yours); margin: 0; }
.saved { color: var(--yours); font-size: 13px; min-height: 18px; }

.login { max-width: 360px; margin: 40px auto; display: grid; gap: 12px; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.empty .big { font-size: 40px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 640px) {
  .hero { grid-template-columns: 170px 1fr; }
  .hero .poster { width: 170px; }
}
