:root {
  --bg: #0f1117; --panel: #181b25; --panel2: #20242f; --line: #2a2f3c;
  --text: #eef0f5; --soft: #b3b9c7; --muted: #7c8396; --accent: #ffb547; --love: #ff6b6b; --ok: #5ad1a0;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body {
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: env(safe-area-inset-top) 0 calc(72px + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}
main { max-width: 560px; margin: 0 auto; padding: 12px 14px; }
h1 { font-size: 26px; margin: 8px 0; }
h2 { font-size: 21px; margin: 0 0 2px; line-height: 1.2; }
h3 { font-size: 15px; margin: 22px 0 6px; color: var(--accent); text-transform: uppercase; letter-spacing: 1px; }
a { color: var(--accent); }
button { font: inherit; color: inherit; cursor: pointer; }
input[type=text], input[type=search] {
  font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; width: 100%;
}
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; padding-top: 18vh; }
[hidden] { display: none !important; }

/* chips */
.chips { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 7px 13px;
  white-space: nowrap; font-size: 14px;
}
.chip.on { background: var(--accent); color: #1a1205; border-color: var(--accent); font-weight: 600; }
.chip.type { margin-left: auto; }
.chip.danger { border-color: #6b2b2b; color: #ff9a9a; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 6px; background: var(--panel2); }
.pill.imdb { background: #f5c518; color: #111; }
.matchpill { background: var(--love); color: #fff; }

/* card (Bedøm) */
.card { background: var(--panel); border-radius: 18px; overflow: hidden; }
.poster { display: block; width: 100%; border: 0; padding: 0; background: #000; }
.poster img { display: block; width: 100%; max-height: 52vh; object-fit: cover; object-position: top; }
.noposter { height: 40vh; display: grid; place-items: center; font-size: 22px; color: var(--muted); }
.body { padding: 12px 14px 4px; }
.meta { color: var(--soft); font-size: 14px; }
.scores { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.logo { width: 24px; height: 24px; border-radius: 6px; }
.match { font-size: 14px; color: var(--soft); margin: 4px 0; }
.match strong { color: var(--accent); }
.match strong.low { color: var(--muted); }
.warn { color: #ff9a9a; }
.ban { font-size: 13px; color: #ff9a9a; margin: 4px 0; }
.others { display: flex; flex-wrap: wrap; gap: 10px; font-size: 14px; margin: 4px 0; }
.overview { color: var(--soft); font-size: 14px; margin: 8px 0; }
.overview.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.skip { display: block; margin: 0 auto; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px; }
.rate { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px 10px 12px; }
.rate button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 2px 8px;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; min-height: 64px;
}
.rate button:active { transform: scale(.94); }
.rate .emoji { font-size: 26px; line-height: 1; }
.rate .label { font-size: 11px; color: var(--soft); }
.rate button.chosen { border-color: var(--accent); background: #3a2d14; }
.rate.busy { opacity: .5; pointer-events: none; }
.empty { text-align: center; padding: 15vh 10px; }

/* lists */
.list { display: flex; flex-direction: column; gap: 10px; }
.item {
  display: flex; gap: 12px; text-align: left; background: var(--panel); border: 0; border-radius: 14px; padding: 10px;
}
.item img, .item .thumb { width: 76px; height: 114px; object-fit: cover; border-radius: 8px; flex: none; background: var(--panel2); }
.item .info { min-width: 0; flex: 1; }
.item .row { display: flex; justify-content: space-between; gap: 8px; }
.pct { color: var(--accent); font-weight: 700; }
.verdicts { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; margin-top: 4px; }
.verdicts .v { color: var(--muted); }
.verdicts .v.rated { color: var(--text); }
.searchbar { position: sticky; top: 0; background: var(--bg); padding: 4px 0 10px; z-index: 2; }

/* detail sheet */
#sheet { position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 20; display: flex; align-items: flex-end; }
.panel {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto; max-height: 92vh; overflow-y: auto;
  background: var(--panel); border-radius: 20px 20px 0 0; padding: 16px 14px calc(16px + env(safe-area-inset-bottom));
}
.close { position: absolute; right: 10px; top: 10px; background: var(--panel2); border: 0; border-radius: 50%; width: 34px; height: 34px; }
.detail { display: flex; gap: 12px; padding-right: 36px; }
.detail img { width: 110px; border-radius: 10px; align-self: flex-start; }
.watched { display: block; margin: 10px 4px; color: var(--soft); font-size: 14px; }

/* Mig */
section { border-top: 1px solid var(--line); margin-top: 14px; }
.switch { display: block; margin: 8px 0 2px; font-weight: 600; }
.inline { display: flex; gap: 8px; margin: 8px 0; }
.inline input { flex: 1; }
.providers { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.prov { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px; font-size: 13px; }
.prov.on { border-color: var(--accent); }
.prov img { width: 22px; height: 22px; border-radius: 5px; }
.prov input { display: none; }
.people { display: flex; flex-direction: column; gap: 8px; }
.person { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.person > span:first-child { flex: 1; }
footer { margin: 30px 0 10px; }

/* tabs + toast */
#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(4, 1fr);
  background: rgba(15,17,23,.96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); z-index: 10;
}
#tabs button { background: none; border: 0; padding: 8px 0 10px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; }
#tabs button span { font-size: 20px; }
#tabs button.active { color: var(--accent); }
#toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: var(--panel2); border: 1px solid var(--line); padding: 9px 16px; border-radius: 999px; z-index: 30; font-size: 14px;
}
