/* Watchlist — shared styles for index.html and admin.html.
   Brand: CLIENTS/TS/Branding (the TechSteff Pulse look). Tokens copied from brand-palette.css;
   components from brand-app-patterns.md. Dark only. */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0a0f; --deep: #07060b; --surface: #0f0f1a; --surface-2: #13131f;
  --head: #f5f2fb; --text: #e2e2f0; --body: #a9a7c0; --muted: #8a8aa8; --faint: #76769a;
  --ac: #9b5de5; --ac-br: #b47cf7; --ac-dim: #7c3aed; --lav: #c4a0ff;
  --line: rgba(255,255,255,.08); --line-2: rgba(255,255,255,.10); --line-3: rgba(255,255,255,.18);
  --line-ac: rgba(180,124,247,.45); --grid-line: rgba(255,255,255,.035);
  --glass: rgba(15,15,26,.58); --glass-light: rgba(245,242,251,.07);
  --shadow-glass: 0 30px 80px rgba(0,0,0,.45), 0 0 70px rgba(124,58,237,.12), inset 0 1px 0 rgba(255,255,255,.08);
  --glow-btn: 0 20px 35px -14px rgba(155,93,229,.4); --glow-btn-hi: 0 22px 40px -12px rgba(155,93,229,.62);
  --green: #22c55e; --green-txt: #4ade80; --amber: #f59e0b; --amber-txt: #fbbf24; --red-txt: #fca5a5;
  --grad-text: linear-gradient(90deg, #f5f2fb 0%, #b47cf7 55%, #7c3aed 100%);
  --grad-word: linear-gradient(90deg, #c4a0ff 0%, #b47cf7 45%, #7c3aed 100%);
  --r-sm: 13px; --r-glass-btn: 16px; --r-card: 18px; --r-pill: 999px;
  --ease: cubic-bezier(.4,0,.2,1);
  --sans: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, monospace;
  --nav-h: 64px; --app-w: 1100px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body { min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body.locked { overflow: hidden; }
/* Grid + still app atmosphere */
body::before { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 64px 64px; }
html::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(55% 50% at 78% 18%, rgba(124,58,237,.18) 0%, rgba(10,10,15,0) 70%),
              radial-gradient(60% 45% at 12% 105%, rgba(155,93,229,.12) 0%, rgba(10,10,15,0) 70%); }
body::after { content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(rgba(180,124,247,.5) 1px, transparent 1.6px); background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(50% 55% at 80% 12%, #000 0%, transparent 72%);
          mask-image: radial-gradient(50% 55% at 80% 12%, #000 0%, transparent 72%); }
:focus-visible { outline: 2px solid var(--ac-br); outline-offset: 3px; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
img { display: block; }

/* Icons (sprite injected by boot.js) */
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round; }
.i-16 { width: 16px; height: 16px; }
.i-24 { width: 24px; height: 24px; }

/* ── Nav ── */
.nav { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(10,10,15,.66);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding-top: env(safe-area-inset-top, 0px); }
.nav-inner { max-width: var(--app-w); margin: 0 auto; height: var(--nav-h); padding: 0 24px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 12px; min-height: 44px; min-width: 0; text-decoration: none; }
.brand img { width: 30px; height: 30px; flex: none; }
.brand-word { font: 600 19px/1 var(--sans); letter-spacing: -.03em; color: var(--head); white-space: nowrap; }
.brand-word b { font-weight: 600; background: var(--grad-word); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand-app { font: 500 12px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  padding-left: 12px; border-left: 1px solid var(--line-3); white-space: nowrap; }
.nav .spacer { flex: 1; }
.nav-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 44px; height: 44px; padding: 0 12px;
  cursor: pointer; background: rgba(255,255,255,.03); border: 1px solid var(--line-2); border-radius: var(--r-sm); color: var(--body);
  text-decoration: none; font: 500 12px/16px var(--sans); letter-spacing: .1em; text-transform: uppercase;
  transition: color .2s var(--ease), border-color .2s var(--ease); }
.nav-btn:hover { color: var(--head); border-color: var(--line-ac); }
.nav-btn .i { color: var(--ac-br); }
#user-btn { display: flex; align-items: center; min-width: 28px; min-height: 28px; }
@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; gap: 8px; }
  .brand-app, .nav-btn .lbl { display: none; }
}

/* ── Framed column ── */
main { position: relative; z-index: 1; max-width: var(--app-w); margin: 0 auto; padding: 32px 24px 48px;
  border-inline: 1px solid var(--line); min-height: calc(100dvh - var(--nav-h)); }
@media (max-width: 640px) { main { padding: 24px 16px 40px; border-inline: none; } }
.label { display: inline-flex; align-items: center; gap: 10px; font: 500 12px/16px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.label-ac::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--ac-br); box-shadow: 0 0 10px rgba(180,124,247,.8); }
.grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-title { margin-top: 14px; font: 400 clamp(36px, 6vw, 56px)/1 var(--sans); letter-spacing: -.05em; color: var(--head); }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* Animate the heading text, not .page-head itself: a transformed ancestor would pin the
   phone action bar (position: fixed, inside .page-head) to the heading instead of the screen. */
.js-motion .page-head > :first-child, .js-motion .panel { animation: fade-up .7s cubic-bezier(.16,1,.3,1) both; }

/* ── Glass + panels ── */
.glass { position: relative; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.012)), var(--glass);
  border: 1px solid var(--line-2); border-radius: var(--r-card); box-shadow: var(--shadow-glass);
  backdrop-filter: blur(18px) saturate(120%); -webkit-backdrop-filter: blur(18px) saturate(120%); }
.panel { padding: 24px; }
.panel.featured { border-color: var(--line-ac);
  background: radial-gradient(120% 70% at 50% 115%, rgba(155,93,229,.26) 0%, rgba(124,58,237,.08) 40%, rgba(10,10,15,0) 70%),
    linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)), var(--glass);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), 0 0 90px rgba(124,58,237,.22), inset 0 1px 0 rgba(255,255,255,.1); }
@media (max-width: 640px) { .panel { padding: 16px 14px; } }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-title { font: 400 24px/1.1 var(--sans); letter-spacing: -.04em; color: var(--head); }

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 20px; cursor: pointer;
  white-space: nowrap; font: 500 12px/16px var(--sans); letter-spacing: .1em; text-transform: uppercase; text-decoration: none;
  border: 1px solid transparent; border-radius: var(--r-sm);
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.btn-primary { background: #0a0a0f; color: var(--head); border-color: rgba(255,255,255,.16); box-shadow: var(--glow-btn), inset 0 1px 0 rgba(255,255,255,.08); }
.btn-primary .i { color: var(--ac-br); }
.btn-primary:hover { border-color: var(--line-ac); box-shadow: var(--glow-btn-hi), inset 0 1px 0 rgba(255,255,255,.1); }
.btn-glass { background: var(--glass-light); color: var(--body); border-color: var(--line-2); border-radius: var(--r-glass-btn);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn-glass .i { color: var(--ac-br); }
.btn-glass:hover { color: var(--head); background: rgba(245,242,251,.11); border-color: var(--line-3); }
.btn-danger { color: var(--red-txt); }
.btn-sm { min-height: 44px; padding: 0 14px; }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; cursor: pointer; border-radius: var(--r-sm);
  background: rgba(255,255,255,.03); border: 1px solid var(--line-2); color: var(--body); transition: color .2s var(--ease), border-color .2s var(--ease); }
.icon-btn:hover { color: var(--head); border-color: var(--line-ac); }
.icon-btn.danger:hover { color: var(--red-txt); border-color: rgba(239,68,68,.45); }

/* ── Chips, pills, avatars ── */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line-2);
  background: rgba(255,255,255,.03); font: 500 12px/18px var(--sans); letter-spacing: .04em; color: var(--body); white-space: nowrap; }
.chip-ac { color: var(--lav); border-color: var(--line-ac); background: rgba(155,93,229,.1); }
.chip-ok { color: var(--green-txt); border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.1); }
/* Toggle pills: pick one (radio) or several (checkbox). Input stays focusable. */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }  /* the label is the tap target */
.pill span { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--body); font: 500 14px/1 var(--sans);
  transition: color .2s var(--ease), border-color .2s var(--ease), background-color .2s var(--ease), box-shadow .2s var(--ease); }
.pill span .i { display: none; width: 16px; height: 16px; color: var(--ac-br); }
.pill input:checked + span { color: var(--lav); border-color: var(--line-ac); background: rgba(155,93,229,.14); box-shadow: 0 0 24px -8px rgba(155,93,229,.6); }
.pill input:checked + span .i { display: block; }
.pill input:focus-visible + span { outline: 2px solid var(--ac-br); outline-offset: 3px; }
.pill:hover span { color: var(--head); }
.av { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 999px; font: 600 10px/1 var(--sans);
  letter-spacing: .02em; color: var(--lav); background: #1a1530; border: 1px solid var(--line-ac); }
.avs { display: flex; }
.avs .av + .av { margin-left: -7px; }

/* ── Forms ── */
.field { margin-bottom: 20px; }
.field > label, .field-label { display: block; margin-bottom: 8px; font: 500 12px/16px var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--text); }
.input, .select { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2);
  background: rgba(255,255,255,.03); color: var(--head); font: 400 16px/1.4 var(--sans); outline: none; appearance: none;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease), background-color .2s var(--ease); }
.input::placeholder { color: var(--faint); }
.input:hover, .select:hover { border-color: var(--line-3); }
.input:focus, .select:focus { border-color: var(--line-ac); background: rgba(255,255,255,.045); box-shadow: 0 0 0 3px rgba(155,93,229,.18); }
.select { padding-right: 42px; background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23b47cf7' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; }
.select option { background: var(--surface-2); }
input[type="date"].input { color-scheme: dark; }
.form-error { margin-top: 10px; font-size: 14px; color: var(--red-txt); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* ── Sheets (bottom sheet on phones, centred dialog on desktop) ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(5,5,10,.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.sheet { width: 100%; max-width: 680px; max-height: calc(100dvh - 48px); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.015)), #10101b; }
.sheet-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 14px 14px 22px; border-bottom: 1px solid var(--line); background: rgba(16,16,27,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.sheet-title { font: 400 22px/1.2 var(--sans); letter-spacing: -.03em; color: var(--head); }
.sheet-body { padding: 22px; }
.sheet-foot { position: sticky; bottom: 0; z-index: 2; display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px calc(14px + var(--safe-b));
  border-top: 1px solid var(--line); background: rgba(16,16,27,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.js-motion .sheet-wrap:not([hidden]) .sheet { animation: sheet-up .32s cubic-bezier(.16,1,.3,1) both; }
@media (max-width: 640px) {
  .sheet-wrap { align-items: flex-end; padding: 0; padding-top: 32px; }
  .sheet { max-height: calc(100dvh - 32px); border-radius: var(--r-card) var(--r-card) 0 0; border-bottom: none; }
  .sheet-body { padding: 18px 16px calc(18px + var(--safe-b)); }
  .sheet-foot { padding: 12px 16px calc(12px + var(--safe-b)); }
  .sheet-foot .btn { flex: 1; }
  .sheet-head { padding-left: 16px; }
}

/* ── Sign-in / who-are-you gate ── */
#gate { position: fixed; inset: 0; z-index: 90; overflow-y: auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 32px 16px calc(32px + var(--safe-b)); text-align: center; background: var(--bg); }
#gate::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(55% 50% at 78% 18%, rgba(124,58,237,.18) 0%, rgba(10,10,15,0) 70%),
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0/64px 64px, linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0/64px 64px; }
.gate-lede { max-width: 560px; }
.gate-brand { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 26px; }
#gate-box { width: 100%; display: flex; justify-content: center; }
.gate-brand img { width: 36px; height: 36px; }
.gate-lede h1 { margin: 14px 0 16px; font: 400 clamp(34px, 6vw, 56px)/1.02 var(--sans); letter-spacing: -.05em; color: var(--head); text-wrap: balance; }
.gate-lede p { max-width: 46ch; margin: 0 auto; font-size: 16px; line-height: 1.6; color: var(--body); }
.who { width: 100%; max-width: 420px; padding: 20px; text-align: left; }
.who-list { display: grid; gap: 8px; margin-top: 14px; }
.who-btn { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 14px; cursor: pointer; border-radius: var(--r-sm);
  border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); font: 500 16px/1 var(--sans);
  transition: border-color .2s var(--ease), background-color .2s var(--ease); }
.who-btn:hover { border-color: var(--line-ac); background: rgba(155,93,229,.08); }
.who-btn .av { width: 32px; height: 32px; font-size: 12px; }
.gate-msg { max-width: 340px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.gate-msg .btn { margin-top: 16px; }
.local-badge { display: inline-flex; align-items: center; gap: 8px; }

/* ── Toast ── */
#toast { position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 95; transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--line-ac); background: #15121f; color: var(--head); font-size: 14px;
  box-shadow: 0 20px 40px rgba(0,0,0,.5); transition: opacity .2s var(--ease), transform .2s var(--ease); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.err { border-color: rgba(239,68,68,.45); color: var(--red-txt); }
@media (min-width: 641px) { #toast { bottom: 32px; } }

/* ── Empty state ── */
.empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 16px; text-align: center; }
.empty-icon { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 14px; background: rgba(155,93,229,.1);
  border: 1px solid var(--line-2); color: var(--ac-br); }
.empty p { max-width: 38ch; color: var(--body); }

/* ── Footer (TMDB attribution, required by their terms) ── */
.foot { position: relative; z-index: 1; max-width: var(--app-w); margin: 0 auto; padding: 22px 24px calc(22px + var(--safe-b));
  border-inline: 1px solid var(--line); border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px;
  font-size: 12px; line-height: 1.5; color: var(--faint); }
.foot img { height: 12px; width: auto; flex: none; }
@media (max-width: 640px) { .foot { padding-inline: 16px; border-inline: none; } }

/* Mouse and trackpad only: a little denser (touch keeps 44/48px) */
@media (pointer: fine) and (min-width: 641px) {
  .btn { min-height: 42px; }
  .btn-sm, .icon-btn, .nav-btn { min-height: 38px; height: 38px; }
  .icon-btn { width: 38px; }
  .pill span { min-height: 38px; }
  .input, .select { min-height: 44px; font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
