/* RAYSTracker · Mint Navy. Mobile first, big touch targets, high contrast. */
:root {
  --mint: #64F4CC; --mint-light: #B3F9E6; --mint-tint: #1D3D4C;
  --navy: #101D35; --card: #172744; --raised: #1C2E50; --line: #23365C;
  --white: #FFFFFF; --muted: #A6B3C9; --amber: #F5B544; --amber-tint: #3A321E; --red: #FF7A7A;
  --radius: 16px; --tap: 48px;
  --head: 'Montserrat', system-ui, sans-serif; --body: 'Inter', system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--navy); color: var(--white); font: 16px/1.5 var(--body); min-height: 100vh; }
body.big { font-size: 19px; }
a { color: var(--mint); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--head); font-weight: 800; line-height: 1.15; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: 1.75em; } h2 { font-size: 1.25em; } h3 { font-size: 1.05em; font-weight: 700; }
p { margin: 0 0 .6em; }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--mint); outline-offset: 2px; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; position: sticky; top: 0; z-index: 5;
  background: rgba(16, 29, 53, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--white); }
.wordmark { font: 800 1.2rem/1 var(--head); letter-spacing: -.01em; }
.wordmark .rays { color: var(--mint); }
.mark { display: block; flex: none; }

.page { max-width: 720px; margin: 0 auto; padding: 20px 16px 120px; }
.v-public .page { padding-bottom: 40px; }
.foot { max-width: 720px; margin: 0 auto; padding: 8px 16px 110px; color: var(--muted); font-size: .8rem; text-align: center; }
.v-public .foot { padding-bottom: 30px; }
.foot p { margin: 2px 0; } .foot a { color: var(--muted); }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: var(--tap); justify-content: center;
  color: var(--muted); text-decoration: none; font-size: .72rem; font-weight: 600; border-radius: 12px; }
.tabbar a.on { color: var(--mint); }
.tabbar a[href="/search"] svg { background: var(--mint); color: var(--navy); border-radius: 50%; padding: 5px; width: 34px; height: 34px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 14px; }
.card.attention { border-color: var(--mint); }
.stack > * + * { margin-top: 12px; } .stack > * { margin-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; }
.narrow { max-width: 440px; margin: 24px auto; }
.muted { color: var(--muted); } .small { font-size: .875em; } .mint { color: var(--mint); }
.section { margin: 26px 0 10px; } .count { color: var(--muted); font-weight: 600; font-size: .8em; }
.greet { margin-top: 4px; }
.back { display: inline-block; margin-bottom: 12px; text-decoration: none; font-weight: 600; min-height: 32px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px;
  font: 700 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; border: 2px solid transparent; }
body.big .btn { font-size: 1.1rem; }
.btn-primary { background: var(--mint); color: var(--navy); }
.btn-primary:active { background: var(--mint-light); }
.btn-ghost { background: transparent; color: var(--mint); border-color: var(--mint); }
.btn-link { background: none; color: var(--mint); padding: 6px 4px; min-height: 36px; border: 0; font-weight: 600; }
.btn-danger { background: var(--red); color: var(--navy); }
.danger { color: var(--red) !important; }
.btn-lg { min-height: var(--tap); padding: 14px 22px; font-size: 1.05rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-block { display: flex; width: 100%; }

label { display: block; font-weight: 600; font-size: .9em; }
input, select { display: block; width: 100%; margin-top: 6px; min-height: var(--tap); padding: 10px 12px; font: 400 1rem var(--body);
  color: var(--white); background: var(--navy); border: 1px solid var(--line); border-radius: 12px; }
body.big input, body.big select { font-size: 1.1rem; }
input:focus, select:focus { border-color: var(--mint); outline: none; }
input::placeholder { color: #6F7E99; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.check input { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--mint); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 380px) { .two { grid-template-columns: 1fr; } }
fieldset.seg { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
fieldset.seg legend { font-weight: 600; font-size: .9em; margin-bottom: 6px; }
fieldset.seg label { display: flex; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; font-weight: 500; }
fieldset.seg input { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--mint); }
details > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '›'; color: var(--muted); transform: rotate(90deg); transition: transform .15s; }
details[open] > summary::after { transform: rotate(-90deg); }
details[open] > summary { margin-bottom: 10px; }
details.more { border-top: 1px solid var(--line); padding-top: 10px; }

.searchbar { display: flex; gap: 8px; margin-bottom: 8px; }
.searchbar input { margin: 0; }
.flash { background: var(--mint-tint); border: 1px solid var(--mint); color: var(--mint-light); padding: 12px 14px; border-radius: 12px; margin-bottom: 14px; font-weight: 600; }
.error { background: rgba(255, 122, 122, .12); border: 1px solid var(--red); color: #FFC2C2; padding: 10px 12px; border-radius: 12px; }
.tip { background: var(--amber-tint); border: 1px solid rgba(245, 181, 68, .5); color: #FBE3B6; padding: 12px 14px; border-radius: 12px; margin-bottom: 10px; }
.tip b { color: var(--amber); } .tip a { color: var(--amber); }
.testlink { background: var(--amber-tint); padding: 10px; border-radius: 10px; }
.pill { display: inline-block; background: var(--mint-tint); color: var(--mint); font-weight: 700; font-size: .8rem; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }

.poster { width: 64px; height: 92px; object-fit: cover; border-radius: 10px; background: var(--raised); flex: none; }
.poster.sm { width: 54px; height: 78px; } .poster.xs { width: 40px; height: 58px; border-radius: 8px; }
.poster-blank { display: flex; align-items: center; justify-content: center; font: 800 1.4rem var(--head); color: var(--mint); }
.bar { height: 8px; background: var(--raised); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; background: var(--mint); border-radius: 99px; }

.cw-top { display: flex; gap: 14px; text-decoration: none; color: inherit; margin-bottom: 14px; }
.cw-top > div { flex: 1; min-width: 0; }
.next { margin: 4px 0 0; }
.result { display: flex; gap: 12px; align-items: center; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); margin: 4px 0 0; }

.list { list-style: none; padding: 4px 0; }
.list li { border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list li > a, .list li.movie, .list.cph li { display: flex; align-items: center; gap: 12px; padding: 12px 18px; min-height: 60px; color: inherit; text-decoration: none; }
.chev { color: var(--muted); font-size: 1.4rem; }

.show-head { display: flex; gap: 16px; margin-bottom: 16px; align-items: flex-start; }
.show-head .poster { width: 96px; height: 138px; }
.show-head > div { flex: 1; min-width: 0; }
.next-card { background: linear-gradient(160deg, var(--raised), var(--card)); border-color: var(--mint-tint); }
.season summary b { font-family: var(--head); }
.eps { list-style: none; padding: 0; margin: 0; }
.eps li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); }
.ep-no { width: 32px; height: 32px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--raised); font-weight: 700; font-size: .85rem; }
.eps li.done .ep-no { background: var(--mint); color: var(--navy); }
.eps li.done .grow { color: var(--muted); }
.eps form { flex: none; }
.eps .btn-link { white-space: nowrap; font-size: .85rem; }
.cw-top > .poster, .show-head > .poster, .result > .poster, .list .poster { flex: none; }
.danger-zone { justify-content: space-between; margin-top: 18px; }

.money-snap { display: flex; justify-content: space-between; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.big-num { font: 800 2.2rem/1 var(--head); color: var(--mint); margin: 4px 0; }
.big-num.sm { font-size: 1.4rem; color: var(--white); }
.totals { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; justify-content: space-between; }
.budget { font-weight: 700; font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: var(--mint-tint); color: var(--mint); }
.budget.over { background: var(--amber-tint); color: var(--amber); }
.tabs { display: flex; gap: 4px; background: var(--card); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.tabs a { padding: 6px 10px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .85rem; }
.tabs a.on { background: var(--mint); color: var(--navy); }
.cph-panel { background: linear-gradient(160deg, var(--mint-tint), var(--card) 70%); border: 1px solid rgba(100, 244, 204, .35);
  border-radius: var(--radius); padding: 18px; margin: 26px 0 14px; }
.cph-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.cph-head h2 { margin: 0; }
.eyebrow-sm { margin: 0 0 2px; font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--mint); font-weight: 700; }
.cph-row { padding: 14px 0 4px; border-top: 1px solid rgba(100, 244, 204, .15); }
.cph-head + .cph-row { border-top: 0; }
.cph-row p { margin: 6px 0 0; }
.cph-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cph-top b { font-size: 1.05em; }
.meter { height: 10px; background: rgba(16, 29, 53, .7); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; min-width: 0; background: var(--mint); border-radius: 99px; }
.per-pill { font: 800 .95rem/1 var(--head); padding: 7px 12px; border-radius: 999px; white-space: nowrap; }
.per-pill.good { background: var(--mint); color: var(--navy); }
.per-pill.ok { background: var(--mint-light); color: var(--navy); }
.per-pill.high { background: var(--amber); color: var(--navy); }
.per-pill.add { background: transparent; color: var(--mint); border: 1px solid var(--mint); text-decoration: none; font-size: .85rem; }
.per-pill.free { background: var(--raised); color: var(--white); border: 1px solid var(--line); }
.per-pill.idle { background: var(--amber-tint); color: var(--amber); border: 1px solid rgba(245, 181, 68, .5); }
.cph-note { margin: 14px 0 0; }
.tabs { background: rgba(16, 29, 53, .6); }
.per { font-weight: 800; font-family: var(--head); white-space: nowrap; }
.per.good { color: var(--mint); } .per.high { color: var(--amber); } .per.idle { color: var(--muted); }
.danger-card summary { color: var(--red); font-weight: 600; }

/* Homepage */
.hero { padding: 30px 0 18px; }
.hero h1 { font-size: 2.6rem; }
.eyebrow { letter-spacing: .18em; font-size: .75rem; color: var(--muted); font-weight: 700; }
.eyebrow b { color: var(--mint); }
.lead { font-size: 1.1rem; color: #D5DDEA; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 20px 0; }
.grid-cards .card { margin: 0; }
.steps { padding-left: 1.2em; } .steps li { margin: 8px 0; }
.story { padding: 26px 0; } .story .mark { margin: 0 auto 12px; }
.prose p { color: #D5DDEA; }

@media (min-width: 720px) {
  .hero h1 { font-size: 3.4rem; }
  .page { padding-top: 32px; }
}

/* Watch next shelf: swipe sideways on phones */
.shelf { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; margin: 0 -16px 8px; padding-left: 16px; padding-right: 16px; }
.shelf-item { flex: none; width: 150px; margin: 0; padding: 12px; display: flex; flex-direction: column; gap: 10px; scroll-snap-align: start; }
.shelf-link { display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; flex: 1; }
.shelf-link b { line-height: 1.25; }
.poster.shelf-poster { width: 100%; height: 180px; margin-bottom: 6px; }
.shelf form { margin: 0; }
@media (min-width: 720px) { .shelf { margin: 0 0 8px; padding-left: 0; padding-right: 0; } }

/* Ratings */
.rate-card p { margin: 0; }
.stars { display: flex; gap: 6px; margin: 8px 0; }
.star { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--navy); color: #3A4D72;
  font-size: 30px; line-height: 1; cursor: pointer; padding: 0; }
.star.on { color: var(--amber); border-color: rgba(245, 181, 68, .5); background: var(--amber-tint); }
.mini-stars { color: var(--amber); font-size: .85em; letter-spacing: 1px; white-space: nowrap; }
@media (max-width: 360px) { .star { width: 44px; height: 44px; font-size: 26px; } }

/* Did I already watch it? */
.find label { font-family: var(--head); font-weight: 800; font-size: 1.1em; margin-bottom: 8px; }
.find .searchbar { margin: 0; }
.found .answer-dot { width: 32px; height: 32px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--raised); color: var(--muted); font-weight: 800; }
.found .answer-dot.yes { background: var(--mint); color: var(--navy); }

/* Sharing */
textarea { display: block; width: 100%; margin-top: 6px; padding: 10px 12px; font: 400 1rem var(--body); color: var(--white);
  background: var(--navy); border: 1px solid var(--line); border-radius: 12px; resize: vertical; }
textarea:focus { border-color: var(--mint); outline: none; }
.share-card h3 { margin-bottom: 10px; }
.share-url { display: flex; gap: 8px; align-items: center; }
.share-url input { margin: 0; font-size: .9rem; }
.share-btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 6px; }
.share-btns .btn { flex: 1 1 auto; }
.share-page { display: flex; gap: 20px; align-items: flex-start; margin: 10px 0 24px; flex-wrap: wrap; }
.share-page > div:not(.share-poster) { flex: 1 1 260px; }
.share-poster { width: 180px; height: 260px; object-fit: cover; border-radius: 16px; background: var(--raised); flex: none; font-size: 3rem; }
.share-page h1 { font-size: 2.2rem; }
.verdict { font-size: 1.15rem; font-weight: 600; }
.share-stars { color: var(--amber); font-size: 1.9rem; letter-spacing: 3px; }
.share-note { margin: 16px 0 0; padding: 14px 16px; border-left: 4px solid var(--mint); background: var(--card); border-radius: 0 12px 12px 0; font-size: 1.1rem; }
.share-note cite { display: block; margin-top: 6px; font-style: normal; color: var(--muted); font-size: .85rem; }
.share-note cite::before { content: '— '; }
