/* puffin — phone first. No scripts; progress widths are the .pN classes at
   the bottom (inline styles are blocked by the CSP). */
:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #6b6b70;
  --line: #e3e1dc;
  --accent: #2f5fb3;
  --good: #1f7a45;   --good-bg: #e2f3e8;
  --busy: #2f5fb3;   --busy-bg: #e3ecfa;
  --wait: #6b5a1e;   --wait-bg: #f5efd9;
  --warn: #9a4d00;   --warn-bg: #fbe9d7;
  --bad: #a4262c;    --bad-bg: #fbe3e4;
  --idle: #55555a;   --idle-bg: #ecebe8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151517;
    --card: #202024;
    --text: #ececef;
    --muted: #a0a0a8;
    --line: #34343a;
    --accent: #8fb3ff;
    --good: #7fd6a0;   --good-bg: #1d3526;
    --busy: #9dbcff;   --busy-bg: #1f2b44;
    --wait: #e2cf8a;   --wait-bg: #37321c;
    --warn: #f4b27a;   --warn-bg: #3d2a18;
    --bad: #ff9aa0;    --bad-bg: #42201f;
    --idle: #b9b9c0;   --idle-bg: #2c2c31;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
main { max-width: 760px; margin: 0 auto; padding: 12px 16px 40px; }
main.narrow { max-width: 420px; padding-top: 40px; }
h1 { font-size: 1.5rem; margin: 0 0 8px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px;
  background: var(--card); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.signout { display: flex; align-items: center; gap: 10px; margin: 0; }
.who { color: var(--muted); font-size: .9rem; }
button.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer; }

.search { display: flex; gap: 8px; margin: 4px 0 12px; }
.search input { flex: 1; min-width: 0; }
input {
  font: inherit; font-size: 16px; /* 16px stops iOS zooming on focus */
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); width: 100%;
}
button {
  font: inherit; padding: 10px 16px; border-radius: 10px; border: 0;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer;
}
@media (prefers-color-scheme: dark) { button:not(.link) { color: #0d1526; } }

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none; }
.tabs a {
  flex: none; padding: 7px 12px; border-radius: 999px; text-decoration: none;
  background: var(--card); color: var(--text); border: 1px solid var(--line); font-size: .92rem;
}
.tabs a span { color: var(--muted); margin-left: 2px; }
.tabs a.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs a.on span { color: var(--bg); opacity: .75; }

.notice { background: var(--warn-bg); color: var(--warn); padding: 10px 12px; border-radius: 10px; font-size: .92rem; }
.empty { color: var(--muted); text-align: center; padding: 40px 0; }

.cards { display: grid; gap: 10px; }
.card {
  display: flex; gap: 12px; padding: 12px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text); text-decoration: none;
}
.poster { flex: none; width: 64px; height: 96px; border-radius: 8px; background: var(--idle-bg); overflow: hidden; }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster.big { width: 104px; height: 156px; }
.body { min-width: 0; flex: 1; }
.card h2 { font-size: 1.05rem; margin: 0 0 6px; line-height: 1.25; }
.year { color: var(--muted); font-weight: 400; }
.detail { margin: 6px 0 0; font-size: .92rem; }
.meta { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.foot { text-align: center; margin-top: 20px; }
.more { text-align: center; margin-top: 16px; }

.badge {
  display: inline-block; padding: 3px 9px; border-radius: 999px;
  font-size: .85rem; font-weight: 600; line-height: 1.35;
}
.badge.good { color: var(--good); background: var(--good-bg); }
.badge.busy { color: var(--busy); background: var(--busy-bg); }
.badge.wait { color: var(--wait); background: var(--wait-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad  { color: var(--bad);  background: var(--bad-bg); }
.badge.idle { color: var(--idle); background: var(--idle-bg); }

.seasons { list-style: none; margin: 6px 0 0; padding: 0; font-size: .88rem; }
.seasons li { padding: 1px 0; }
.seasons li.bad, .seasons li.warn { color: var(--warn); }

.bar { height: 6px; background: var(--busy-bg); border-radius: 3px; margin-top: 8px; overflow: hidden; max-width: 260px; }
.bar span { display: block; height: 100%; background: var(--busy); border-radius: 3px; }

.detail-head { display: flex; gap: 14px; margin: 8px 0 18px; }
.detail-head h1 { font-size: 1.3rem; }
.watch { display: inline-block; margin-top: 4px; font-weight: 600; }
.season { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.season summary { cursor: pointer; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style-position: inside; }
.season[open] summary { margin-bottom: 8px; }
.episodes { list-style: none; margin: 0; padding: 0; }
.episodes li {
  display: grid; grid-template-columns: 2.6em 1fr auto; align-items: center; gap: 8px;
  padding: 7px 0; border-top: 1px solid var(--line); font-size: .92rem;
}
.episodes .code { color: var(--muted); font-variant-numeric: tabular-nums; }
.episodes .title { min-width: 0; overflow-wrap: anywhere; }
.episodes .badge { font-size: .78rem; max-width: 11em; text-align: center; white-space: normal; }

.login { display: grid; gap: 12px; margin: 20px 0 8px; }
.login label { display: grid; gap: 4px; font-size: .92rem; color: var(--muted); }
.lede { color: var(--muted); }
.error { background: var(--bad-bg); color: var(--bad); padding: 10px 12px; border-radius: 10px; margin: 0; }
.p0{width:0%} .p1{width:1%} .p2{width:2%} .p3{width:3%} .p4{width:4%} .p5{width:5%} .p6{width:6%} .p7{width:7%} .p8{width:8%} .p9{width:9%} .p10{width:10%} .p11{width:11%} .p12{width:12%} .p13{width:13%} .p14{width:14%} .p15{width:15%} .p16{width:16%} .p17{width:17%} .p18{width:18%} .p19{width:19%} .p20{width:20%} .p21{width:21%} .p22{width:22%} .p23{width:23%} .p24{width:24%} .p25{width:25%} .p26{width:26%} .p27{width:27%} .p28{width:28%} .p29{width:29%} .p30{width:30%} .p31{width:31%} .p32{width:32%} .p33{width:33%} .p34{width:34%} .p35{width:35%} .p36{width:36%} .p37{width:37%} .p38{width:38%} .p39{width:39%} .p40{width:40%} .p41{width:41%} .p42{width:42%} .p43{width:43%} .p44{width:44%} .p45{width:45%} .p46{width:46%} .p47{width:47%} .p48{width:48%} .p49{width:49%} .p50{width:50%} .p51{width:51%} .p52{width:52%} .p53{width:53%} .p54{width:54%} .p55{width:55%} .p56{width:56%} .p57{width:57%} .p58{width:58%} .p59{width:59%} .p60{width:60%} .p61{width:61%} .p62{width:62%} .p63{width:63%} .p64{width:64%} .p65{width:65%} .p66{width:66%} .p67{width:67%} .p68{width:68%} .p69{width:69%} .p70{width:70%} .p71{width:71%} .p72{width:72%} .p73{width:73%} .p74{width:74%} .p75{width:75%} .p76{width:76%} .p77{width:77%} .p78{width:78%} .p79{width:79%} .p80{width:80%} .p81{width:81%} .p82{width:82%} .p83{width:83%} .p84{width:84%} .p85{width:85%} .p86{width:86%} .p87{width:87%} .p88{width:88%} .p89{width:89%} .p90{width:90%} .p91{width:91%} .p92{width:92%} .p93{width:93%} .p94{width:94%} .p95{width:95%} .p96{width:96%} .p97{width:97%} .p98{width:98%} .p99{width:99%} .p100{width:100%}
