:root {
  --bg: #0e0f13;
  --bg-2: #15171d;
  --card: #1b1e26;
  --line: #2a2e39;
  --text: #ecedf1;
  --muted: #9097a6;
  --accent: #ff6b57;
  --accent-2: #ffb547;
  --good: #4fd18b;
  /* list status colours */
  --st-completed: #3ecf7a;
  --st-watching: #f5c542;
  --st-dropped: #ef4b4b;
  --st-plan_to_watch: #8a909c;
  --st-on_hold: #5b9cf5;
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 24px;
  padding: 12px 28px;
  background: var(--topbar-bg, rgba(14, 15, 19, 0.88)); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; letter-spacing: -0.02em; text-decoration: none; font-size: 19px; white-space: nowrap; }
.brand-mark { color: var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a { text-decoration: none; color: var(--muted); padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 14px; }
.nav a:hover { color: var(--text); background: var(--bg-2); }
.nav a.active { color: var(--text); background: var(--card); }
.search { position: relative; margin-left: auto; width: min(360px, 40vw); }
.search input, .input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); outline: none;
}
.search input:focus, .input:focus { border-color: var(--accent); }
.dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  max-height: 420px; overflow-y: auto; box-shadow: 0 16px 40px rgba(0,0,0,.45);
}
.dd-item { display: flex; gap: 10px; align-items: center; padding: 8px 10px; cursor: pointer; }
.dd-item:hover, .dd-item.active { background: var(--bg-2); }
.dd-item img { width: 34px; height: 48px; object-fit: cover; border-radius: 4px; background: var(--line); }
.dd-item .t { font-weight: 600; font-size: 14px; }
.dd-item .m { color: var(--muted); font-size: 12px; }
.dd-empty { padding: 12px; color: var(--muted); font-size: 14px; }

main { padding: 28px; max-width: 1400px; margin: 0 auto; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 36px;
  min-height: 300px; display: flex; align-items: flex-end;
  background: linear-gradient(120deg, #2a1420, #121826);
}
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .45; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg) 0%, rgba(14,15,19,.55) 45%, rgba(14,15,19,.1) 100%); }
.hero-content { position: relative; z-index: 1; padding: 32px; max-width: 720px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--accent-2); font-weight: 700; }
.hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 8px 0 10px; letter-spacing: -0.02em; line-height: 1.05; }
.hero p { color: var(--soft, #c9ccd6); margin: 0 0 18px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- sections & grids ---------- */
.section { margin-bottom: 40px; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.row-head h2 { margin: 0; font-size: 21px; letter-spacing: -0.01em; }
.row-head a { color: var(--muted); font-size: 14px; text-decoration: none; }
.row-head a:hover { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.grid.scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 160px; grid-template-columns: none; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; }
.grid.scroll .card { scroll-snap-align: start; }

.card { cursor: pointer; border-radius: var(--radius); transition: transform .15s ease; min-width: 0; }
.card:hover { transform: translateY(-3px); }
.poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius); overflow: hidden; background: var(--card); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,.72); font-size: 12px; font-weight: 700; color: var(--accent-2);
}
.mine {
  position: absolute; bottom: 8px; left: 8px; padding: 3px 8px; border-radius: 999px;
  background: var(--accent); color: #1a0d0a; font-size: 11px; font-weight: 800;
}
.card h3 { font-size: 14px; margin: 8px 0 2px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { color: var(--muted); font-size: 12px; margin: 0; }
.card .why { font-size: 13px; color: var(--soft, #c9ccd6); margin: 6px 0 0; line-height: 1.45; }
.card.wide { display: grid; grid-template-columns: 110px 1fr; gap: 14px; background: var(--bg-2); padding: 12px; border: 1px solid var(--line); }
.card.wide .poster { aspect-ratio: 2/3; }
.card.wide h3 { font-size: 16px; margin-top: 0; }
.results-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; }

.skeleton { aspect-ratio: 2/3; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), var(--bg-2), var(--card)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- controls ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.chip {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2);
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.chip:hover { color: var(--text); }
.chip.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .x { margin-left: 6px; opacity: .7; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: #1a0d0a; font-weight: 700; border: 0; cursor: pointer; text-decoration: none;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.small { padding: 6px 10px; font-size: 13px; }
/* dropdowns: our own chevron instead of the browser's arrow box (which turns white/grey on hover on Windows) */
.select, select {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  padding: 9px 36px 9px 12px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer;
  background-color: var(--bg-2);
  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 1.5l5 5 5-5' fill='none' stroke='%239097a6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px;
  transition: border-color .15s, background-color .15s;
}
.select:hover, select:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background-color: var(--card); }
.select:focus-visible, select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
select::-ms-expand { display: none; }
/* the open list itself follows the theme */
select option { background: var(--bg-2); color: var(--text); }
.center { display: flex; justify-content: center; margin-top: 22px; }
.muted { color: var(--muted); }
.notice { padding: 16px 18px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); color: var(--soft, #c9ccd6); line-height: 1.55; }
.notice code { background: var(--card); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
/* ---------- status colours ---------- */
.s-completed { --st: var(--st-completed); }
.s-watching { --st: var(--st-watching); }
.s-dropped { --st: var(--st-dropped); }
.s-plan_to_watch { --st: var(--st-plan_to_watch); }
.s-on_hold { --st: var(--st-on_hold); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px;
  background: var(--st, var(--muted)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, var(--muted)) 22%, transparent); }
.chip .dot { width: 7px; height: 7px; margin-right: 7px; box-shadow: none; }
.stat[class*="s-"] { border-left: 3px solid var(--st); }
.stat[class*="s-"] b { color: var(--st); }
.stat span .dot { width: 6px; height: 6px; margin-right: 5px; box-shadow: none; vertical-align: 1px; }
.list-table tr[class*="s-"] .cover-strip { box-shadow: -4px 0 0 var(--st); }
.mine[class*="s-"] { background: var(--st); color: #111; }

.avatar { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: var(--card); border: 2px solid var(--line); text-decoration: none; font-weight: 800; }
.avatar:hover { border-color: var(--accent); }
.avatar img, .profile-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-card { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(120deg, #24161d, var(--bg-2)); border: 1px solid var(--line); }
.profile-pic { width: 72px; height: 72px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: var(--card); border: 3px solid var(--accent); font-size: 28px; font-weight: 800; }
.profile-info { flex: 1; min-width: 200px; }
.profile-name { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 2px; }
.profile-info a { color: var(--accent-2); }
.mal-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.notice.warn { border-color: #6b4a1f; background: #1f1810; }

/* ---------- recommend page ---------- */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 30px; }
.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.panel h2 { margin: 0 0 6px; font-size: 19px; }
.panel p.sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
.picker { position: relative; margin-bottom: 12px; }
.panel-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
textarea.input { min-height: 92px; resize: vertical; line-height: 1.5; }
.examples { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.chat-intro { font-size: 17px; margin: 0 0 6px; }
.chat-meta { color: var(--muted); font-size: 13px; margin: 0 0 16px; }

/* ---------- recommend: sub-tabs ---------- */
.subtabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); }
.subtabs a { padding: 8px 14px; border-radius: 9px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; }
.subtabs a:hover { color: var(--text); }
.subtabs a.active { background: var(--card); color: var(--text); }
/* Pick tab: same centred hero + pill box as Ask */
.pick.empty { min-height: calc(100vh - var(--topbar-h, 67px) - 150px); display: flex; align-items: center; justify-content: center; }
.pick-box { position: relative; align-items: center; cursor: text; }
.pick-box .dropdown { top: calc(100% + 8px); text-align: left; }
.pick-field { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0; }
.pick-field input { flex: 1; min-width: 180px; border: 0; outline: none; background: transparent; font-size: 16px; padding: 8px 0; }
.pick-chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 260px; padding: 4px 10px 4px 4px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.pick-chip span:not(.x) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-chip img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; flex: none; }
.pick-chip .x { font-size: 11px; opacity: .6; }
.pick-chip:hover .x { opacity: 1; color: var(--accent); }
.pick-options { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 14px; }
.pick-options .link-btn { padding: 0; }
.switch { display: inline-flex; align-items: center; gap: 9px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--text); transition: transform .2s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--text); outline-offset: 2px; }
.quick-picks { margin-top: 30px; }
.quick-label { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.quick-picks .examples { justify-content: center; }
.chip.quick { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px 4px 4px; }
.chip.quick img { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.pick-top { max-width: 760px; margin: 0 auto 30px; }
.pick-top .pick-options { justify-content: flex-start; padding-left: 18px; }
.pick-results-head h2 { font-size: 20px; margin: 0 0 16px; letter-spacing: -0.01em; }

/* sticky bar with the tabs + chat buttons */
.rec-bar {
  position: sticky; top: var(--topbar-h, 67px); z-index: 15;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -12px -28px 18px; padding: 12px 28px;
  background: var(--topbar-bg, rgba(14, 15, 19, 0.92)); backdrop-filter: blur(10px); border-bottom: 1px solid transparent;
}
.rec-actions { display: flex; gap: 8px; }
.rec-actions .btn:disabled { opacity: .45; }
.hist-toggle { display: none; }

/* history sidebar + chat */
.chat-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.chat-history {
  position: sticky; top: calc(var(--topbar-h, 67px) + 76px);
  max-height: calc(100vh - var(--topbar-h, 67px) - 100px); overflow-y: auto;
  padding-right: 4px; border-right: 1px solid var(--line);
}
.hist-head { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 4px 10px 8px; }
.hist-item { display: flex; align-items: center; gap: 6px; padding: 9px 10px; margin-right: 8px; border-radius: 10px; cursor: pointer; }
.hist-item:hover, .hist-item:focus-visible { background: var(--bg-2); outline: none; }
.hist-item.active { background: var(--card); }
.hist-text { flex: 1; min-width: 0; }
.hist-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-when { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hist-del { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 6px; opacity: 0; font-size: 12px; }
.hist-item:hover .hist-del, .hist-item.active .hist-del, .hist-del:focus-visible { opacity: 1; }
.hist-del:hover { color: var(--st-dropped); background: var(--bg); }
.hist-empty { color: var(--muted); font-size: 13px; margin: 6px 10px; line-height: 1.5; }

/* ---------- recommend: chat ---------- */
.chat.empty { min-height: calc(100vh - var(--topbar-h, 67px) - 150px); display: flex; align-items: center; justify-content: center; }
.chat-hero { width: min(760px, 100%); text-align: center; }
.chat-hero h1 { font-size: clamp(28px, 4vw, 40px); letter-spacing: -0.02em; margin: 0 0 6px; }
.chat-hero > p:not(.composer-note) { margin: 0 0 24px; }
.chat-hero .examples { justify-content: center; margin-top: 22px; }

.composer {
  display: flex; align-items: flex-end; gap: 10px; text-align: left;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 22px; padding: 10px 10px 10px 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: border-color .15s;
}
.composer:focus-within { border-color: var(--accent); }
.composer textarea {
  flex: 1; resize: none; border: 0; outline: none; background: transparent; line-height: 1.5;
  font-size: 16px; padding: 8px 0; max-height: 200px; min-height: 24px;
}
.send {
  width: 40px; height: 40px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--accent); color: #1a0d0a; font-size: 20px; font-weight: 800; line-height: 1;
}
.send:disabled { opacity: .4; cursor: default; }
.composer-note { color: var(--muted); font-size: 12px; text-align: center; margin: 14px 0 0; line-height: 1.4; }

.thread { display: flex; flex-direction: column; gap: 18px; padding-bottom: 24px; }
.msg { display: flex; gap: 12px; align-items: flex-end; max-width: 860px; scroll-margin-top: calc(var(--topbar-h, 67px) + 80px); }
.msg.user { align-self: flex-end; justify-content: flex-end; }
.msg.bot { align-self: flex-start; }
.bubble { padding: 12px 16px; border-radius: 18px; line-height: 1.5; font-size: 15px; white-space: pre-wrap; }
.msg.user .bubble { background: var(--accent); color: #1a0d0a; border-bottom-right-radius: 6px; font-weight: 500; }
.msg.bot .bubble { background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble.error { border-color: #6b2a2a; color: #ffb3b3; }
.bubble-meta { color: var(--muted); font-size: 12px; margin-top: 6px; }
.writing { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; margin-top: 8px; }
.mini-dots { display: inline-flex; gap: 3px; }
.mini-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent-2); animation: blink 1.2s infinite both; }
.mini-dots span:nth-child(2) { animation-delay: .2s; }
.mini-dots span:nth-child(3) { animation-delay: .4s; }
.bot-avatar { width: 32px; height: 32px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1a0d0a; font-size: 14px; }
.typing { display: flex; gap: 5px; padding: 16px 18px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite both; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin: -4px 0 8px 44px; }
.rec-grid .card.wide { grid-template-columns: 120px 1fr; }
.composer-dock { position: sticky; bottom: 0; padding: 18px 0 16px; margin-top: 8px;
  background: linear-gradient(180deg, transparent, var(--bg) 35%); }
.composer-dock .composer, .composer-dock .composer-note { max-width: 860px; margin-left: auto; margin-right: auto; }

/* ---------- my list ---------- */
.list-table { width: 100%; border-collapse: collapse; }
.list-table td, .list-table th { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.list-table th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.list-table img { width: 42px; height: 60px; object-fit: cover; border-radius: 6px; display: block; }
.list-table .title-cell { cursor: pointer; font-weight: 600; }
.list-table .title-cell:hover { color: var(--accent); }
.list-table input[type=number] { width: 70px; }
.stat-row { display: flex; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.stat { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 120px; }
.stat b { display: block; font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }

/* ---------- modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.7); }
.modal-body { position: relative; width: min(920px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.modal-close { position: absolute; top: 10px; right: 12px; z-index: 2; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); font-size: 22px; cursor: pointer; }
.detail-banner { height: 180px; background-size: cover; background-position: center; background-color: #21182a; position: relative; }
.detail-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2), transparent 70%); }
.detail-main { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 24px; padding: 0 28px 28px; margin-top: -90px; position: relative; z-index: 1; }
.detail-main .poster { box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.detail-main h2 { margin: 96px 0 4px; font-size: 28px; letter-spacing: -0.02em; line-height: 1.1; }
.detail-sub { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.detail-members { color: var(--muted); font-size: 13px; margin: -8px 0 14px; cursor: help; }
.scores { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0; }
.score-box { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 92px; text-decoration: none; }
.score-box b { display: block; font-size: 20px; }
.score-box span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.score-box.main { border-color: var(--accent); }
.score-box.main b { color: var(--accent-2); }
.synopsis { line-height: 1.65; color: var(--soft-2, #d4d7df); white-space: pre-line; overflow-wrap: anywhere; }
.h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 22px 0 10px; font-weight: 700; }
.watch-links { display: flex; flex-wrap: wrap; gap: 8px; }
.watch-link { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: var(--card); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 14px; }
.watch-logo { width: 18px; height: 18px; border-radius: 4px; object-fit: contain; flex: none; background: #fff; padding: 1px; }
.watch-link:hover { border-color: var(--good); color: var(--good); }
.log-form { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.log-form label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.log-form input { width: 80px; padding: 8px; border-radius: 8px; background: var(--bg-2); border: 1px solid var(--line); }
.detail-more { padding: 0 28px 28px; }

/* ---------- seasons & related ---------- */
.h4-count { text-transform: none; letter-spacing: 0; font-weight: 500; margin-left: 6px; color: var(--muted); }
.series-list { display: flex; flex-direction: column; gap: 6px; }
.series-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); cursor: pointer; }
.series-row:hover { border-color: var(--accent); }
.series-row.here { cursor: default; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--card)); }
.series-num { width: 24px; height: 24px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--bg-2); font-size: 12px; font-weight: 800; color: var(--muted); }
.series-row.here .series-num { background: var(--accent); color: #1a0d0a; }
.series-row img, .series-noimg { width: 34px; height: 48px; object-fit: cover; border-radius: 5px; flex: none; background: var(--line); }
.series-text { flex: 1; min-width: 0; }
.series-title { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.series-meta { font-size: 12px; }
.series-rel { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--bg-2); color: var(--muted); white-space: nowrap; }
.series-rel.here { background: var(--accent); color: #1a0d0a; }
.link-btn { background: none; border: 0; color: var(--accent-2); cursor: pointer; padding: 8px 2px 0; font-weight: 600; font-size: 13px; }
.next-chip { display: inline-block; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--st-completed); cursor: pointer; text-decoration: none; }
.next-chip:hover { text-decoration: underline; }

.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 60; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 10px; }
  .search { width: 100%; margin-left: 0; order: 3; }
  .avatar { order: 2; margin-left: auto; }
  main { padding: 16px; }
  .panels { grid-template-columns: 1fr; }
  .pick-field input { min-width: 120px; }
  .rec-grid { margin-left: 0; grid-template-columns: 1fr; }
  .rec-bar { margin: -8px -16px 14px; padding: 10px 16px; }
  .msg { max-width: 100%; }
  .detail-main { grid-template-columns: minmax(0, 1fr); margin-top: -60px; }
  .detail-main .poster { width: 140px; }
  .detail-main h2 { margin-top: 10px; }
  .results-list { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  .list-table .hide-sm { display: none; }
}

@media (max-width: 1000px) {
  .hist-toggle { display: inline-flex; }
  .chat-layout { grid-template-columns: 1fr; }
  .chat-history { display: none; position: static; max-height: 50vh; border-right: 0;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 8px; }
  .chat-history.open { display: block; }
}

/* ---------- scrollbars: thin and dark everywhere (rows, dropdowns, chat history, the page) ---------- */
:root { color-scheme: dark; }
* { scrollbar-width: thin; scrollbar-color: #3a3d4a transparent; }
*:hover { scrollbar-color: #555a6b transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #3a3d4a; border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #5a5f72; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }

/* keep everything inside the anime page's right-hand column */
.detail-main > * { min-width: 0; }
.detail-main h2, .detail-sub { overflow-wrap: anywhere; }
.watch-link { max-width: 100%; overflow-wrap: anywhere; }
.log-form > * { min-width: 0; }
.log-form select { max-width: 100%; }
.series-row { min-width: 0; }

/* ---------- top 10 ---------- */
.top10 { position: relative; display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 32px; align-items: start; }
.top10-glow {
  --g1: var(--accent); --g2: #6b5cff;
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40vmax 40vmax at 62% 30%, color-mix(in srgb, var(--g1) 30%, transparent), transparent 70%),
    radial-gradient(35vmax 35vmax at 82% 78%, color-mix(in srgb, var(--g2) 22%, transparent), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate;
  transition: background 1s ease;
}
@keyframes drift { from { transform: translate3d(-2%, -1%, 0) scale(1); } to { transform: translate3d(2%, 2%, 0) scale(1.06); } }

.top10-list { position: sticky; top: calc(var(--topbar-h, 67px) + 20px); max-height: calc(100vh - var(--topbar-h, 67px) - 40px);
  display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-2) 85%, transparent);
  border: 1px solid var(--line); border-radius: 16px; padding: 14px; backdrop-filter: blur(6px); }
.top10-list-head { display: flex; align-items: center; gap: 10px; }
.top10-list-head h2 { margin: 0; font-size: 16px; white-space: nowrap; }
.top10-list-head .input { padding: 7px 10px; font-size: 13px; }
.top10-hint { font-size: 12px; margin: 10px 2px; line-height: 1.45; }
.top10-items { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; min-height: 120px; border-radius: 10px; }
.top10-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; cursor: grab; text-align: left; width: 100%; }
.top10-item:hover { background: var(--card); border-color: var(--line); }
.top10-item:active { cursor: grabbing; }
.top10-item img { width: 32px; height: 46px; object-fit: cover; border-radius: 5px; background: var(--line); flex: none; }
.top10-item .t { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top10-item .s { font-size: 12px; color: var(--accent-2); font-weight: 700; }
.top10-item.placed { opacity: .45; }
.top10-item.placed .s { color: var(--muted); }
.top10-item.dragging { opacity: .3; }
.top10-items.over { outline: 2px dashed var(--accent); outline-offset: 2px; }

.top10-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 0 0 30px; }
.top10-head h1 { margin: 0; font-size: clamp(28px, 3.4vw, 40px); letter-spacing: -0.02em; }

.pyramid { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-bottom: 40px; }
.pyr-row { display: flex; justify-content: center; gap: 18px; }
.pyr-row.r1 .slot { width: 172px; }
.pyr-row.r2 .slot { width: 146px; }
.pyr-row.r3 .slot { width: 118px; }
.pyr-row.r4 .slot { width: 106px; }

.slot { --glow: var(--accent); position: relative; aspect-ratio: 2 / 3; border-radius: 14px; overflow: hidden;
  transition: transform .18s ease, box-shadow .3s ease, border-color .2s ease; }
.slot.empty { border: 2px dashed var(--line); background: color-mix(in srgb, var(--bg-2) 70%, transparent);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.slot.empty .slot-rank { position: static; font-size: 30px; width: auto; height: auto; background: none; color: var(--line); box-shadow: none; }
.slot-plus { font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.top10.is-dragging .slot.empty { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.top10.is-dragging .slot-plus { opacity: 1; }
.slot.filled { cursor: grab; background: var(--card); border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 18px 50px -14px var(--glow), 0 0 28px -10px var(--glow); }
.slot.filled:hover { transform: translateY(-4px); box-shadow: 0 24px 60px -12px var(--glow), 0 0 36px -8px var(--glow); }
.slot.filled img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slot.over { transform: scale(1.04); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent), 0 18px 50px -14px var(--accent); }
.slot.dragging { opacity: .35; }
.slot.landed { animation: land .45s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes land { 0% { transform: scale(.85); } 100% { transform: none; } }
.slot-rank { position: absolute; top: 8px; left: 8px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; background: rgba(0,0,0,.75); color: #fff; }
.slot-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 9px;
  background: linear-gradient(0deg, rgba(0,0,0,.85), transparent); display: flex; flex-direction: column; gap: 2px; }
.slot-title { font-size: 12.5px; font-weight: 700; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pyr-row.r1 .slot-title { font-size: 14px; }
.slot-score { font-size: 11px; color: var(--accent-2); font-weight: 700; }
.slot-remove { position: absolute; top: 8px; right: 8px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 0;
  background: rgba(0,0,0,.7); color: #fff; cursor: pointer; opacity: 0; transition: opacity .15s; font-size: 12px; }
.slot.filled:hover .slot-remove, .slot-remove:focus-visible { opacity: 1; }

@media (max-width: 1000px) {
  .top10 { grid-template-columns: 1fr; }
  .top10-list { position: static; max-height: 320px; }
  .pyr-row { gap: 10px; }
  .pyr-row.r1 .slot { width: 150px; } .pyr-row.r2 .slot { width: 120px; }
  .pyr-row.r3 .slot { width: 100px; } .pyr-row.r4 .slot { width: 80px; }
  .slot-title { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) { .top10-glow { animation: none; } .slot.landed { animation: none; } }

/* ---- the big 3: gold, silver, bronze ---- */
.slot.m1 { --medal: #ffc93c; --medal-hi: #fff2b3; --medal-lo: #b07a12; }
.slot.m2 { --medal: #cfd6e4; --medal-hi: #ffffff; --medal-lo: #7d8699; }
.slot.m3 { --medal: #e0965a; --medal-hi: #ffd2a8; --medal-lo: #8a4a1e; }
.slot.empty.m1, .slot.empty.m2, .slot.empty.m3 { border-color: color-mix(in srgb, var(--medal) 45%, var(--line)); }
/* empty top-3 spots: a proper round medal (the empty-slot number had no fixed size, so it stretched into an oval) */
.slot.empty.m1 .slot-rank, .slot.empty.m2 .slot-rank, .slot.empty.m3 .slot-rank {
  width: 52px; height: 52px; flex: none; display: grid; place-items: center; line-height: 1;
  font-size: 24px; color: #16120a; opacity: .55;
}
.slot.empty.m1 .slot-rank { width: 60px; height: 60px; font-size: 28px; }
/* metallic frame + the poster glow mixed with the medal colour */
.slot.filled.m1, .slot.filled.m2, .slot.filled.m3 {
  border: 2px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
              linear-gradient(135deg, var(--medal-hi), var(--medal) 35%, var(--medal-lo) 70%, var(--medal-hi)) border-box;
  box-shadow: 0 20px 55px -12px var(--glow), 0 0 34px -6px color-mix(in srgb, var(--medal) 70%, transparent);
}
.slot.filled.m1 { box-shadow: 0 24px 70px -10px var(--glow), 0 0 60px -4px color-mix(in srgb, var(--medal) 80%, transparent); }
.slot.filled.m1:hover, .slot.filled.m2:hover, .slot.filled.m3:hover {
  box-shadow: 0 28px 70px -10px var(--glow), 0 0 60px -2px color-mix(in srgb, var(--medal) 85%, transparent);
}
/* medal badges */
.slot.m1 .slot-rank, .slot.m2 .slot-rank, .slot.m3 .slot-rank {
  background: linear-gradient(135deg, var(--medal-hi), var(--medal) 50%, var(--medal-lo)); color: #16120a;
  box-shadow: 0 0 14px color-mix(in srgb, var(--medal) 70%, transparent), inset 0 1px 0 rgba(255,255,255,.6);
}
.slot.filled.m1 .slot-rank { width: 40px; height: 40px; font-size: 19px; }
.slot.filled.m2 .slot-rank, .slot.filled.m3 .slot-rank { width: 34px; height: 34px; font-size: 16px; }
/* a light sweep across the medal cards now and then */
.slot.filled.m1::after, .slot.filled.m2::after, .slot.filled.m3::after {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, rgba(255,255,255,.28) 50%, transparent 62%);
  transform: translateX(-130%); animation: medal-shine 6s ease-in-out infinite;
}
.slot.filled.m2::after { animation-delay: 1.2s; }
.slot.filled.m3::after { animation-delay: 2.4s; }
@keyframes medal-shine { 0%, 70% { transform: translateX(-130%); } 100% { transform: translateX(130%); } }
/* crown over #1 */
.pyr-row.r1 { position: relative; padding-top: 30px; }
.pyr-row.r1::before {
  content: "♛"; position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  font-size: 34px; line-height: 1; color: #ffc93c; text-shadow: 0 0 18px rgba(255, 201, 60, .8);
}
@media (prefers-reduced-motion: reduce) { .slot.filled.m1::after, .slot.filled.m2::after, .slot.filled.m3::after { animation: none; display: none; } }
@media (max-width: 1000px) { .pyr-row.r1 .slot { width: 160px; } .pyr-row.r2 .slot { width: 128px; } }

/* chat notes (e.g. "can't filter by dub") */
.bubble-note { margin-top: 8px; padding: 7px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  background: rgba(255, 170, 60, .08); border: 1px solid rgba(255, 170, 60, .22); color: var(--muted, #a9b0c0); }
/* detail page: studio and source */
.detail-prod { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; font-size: 13.5px; }
.detail-prod .muted { margin-right: 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.src-status { margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  background: rgba(255, 255, 255, .06); color: var(--muted, #a9b0c0); }
.src-status.ok { background: rgba(70, 200, 120, .12); color: #6fdc9a; }

/* Top 10: Anime / Characters tabs and character labels */
.top10-tabs { display: flex; width: max-content; margin: 0 auto 18px; }
.top10-item .t small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.slot-sub { display: block; font-size: 10.5px; color: rgba(255, 255, 255, .7); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top10-items code { font-size: 12px; background: var(--card); padding: 1px 5px; border-radius: 5px; }

/* chat: "where is X from" */
.char-hit { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.char-hit img { width: 54px; height: 72px; object-fit: cover; border-radius: 9px; background: var(--line); flex: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.char-hit b { font-size: 16px; }
.char-from { display: block; font-size: 12.5px; color: var(--accent-2); margin-top: 3px; }

/* detail: cast */
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 12px; margin: 4px 0 6px; }
.cast-item { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cast-item img, .cast-ph { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--line); display: block; }
.cast-item.main img { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
.cast-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cast-role { font-size: 11px; color: var(--muted); }

/* ---- ranks 11+ side panel ---- */
.xpanel-tab { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 30;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 9px 14px 11px;
  border: 1px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; cursor: pointer;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); color: var(--text); font-weight: 800; font-size: 14px;
  backdrop-filter: blur(8px); box-shadow: -8px 0 30px -12px rgba(0, 0, 0, .6); transition: right .3s ease, background .2s; }
.xpanel-tab:hover { background: var(--card); }
.xpanel-tab small { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: #1a0d08;
  font-size: 11px; text-align: center; }
.xpanel-tab small:empty { display: none; }
.top10.panel-open .xpanel-tab { right: 340px; }

.xpanel { position: fixed; right: 0; top: var(--topbar-h, 67px); bottom: 0; width: 340px; z-index: 29;
  display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg-2) 96%, transparent);
  border-left: 1px solid var(--line); backdrop-filter: blur(10px); box-shadow: -20px 0 50px -20px rgba(0, 0, 0, .7);
  transform: translateX(100%); visibility: hidden; transition: transform .3s ease, visibility 0s linear .3s; }
.top10.panel-open .xpanel { transform: none; visibility: visible; transition: transform .3s ease; }
.xpanel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 8px; }
.xpanel-head h2 { margin: 0; font-size: 18px; }
.xpanel-head p { margin: 4px 0 0; font-size: 12.5px; }
.xpanel-close { border: 0; background: transparent; color: var(--muted); font-size: 15px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.xpanel-close:hover { color: var(--text); background: var(--card); }
.xpanel-size { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 6px 18px 14px; border-bottom: 1px solid var(--line); }
.xpanel-size label { font-size: 13px; color: var(--muted); }
.xpanel-size .input { width: 78px; padding: 6px 8px; font-size: 13px; }
.xpanel-quick { display: flex; gap: 4px; }
.chip-btn { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { color: var(--text); border-color: var(--muted); }
.chip-btn.active { background: var(--card); color: var(--text); border-color: var(--accent); }
.xpanel-rows { flex: 1; overflow-y: auto; padding: 10px 12px 24px; display: flex; flex-direction: column; gap: 4px; }
.xpanel-empty { padding: 10px 6px; font-size: 13px; }
.xrow { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 5px 8px; border-radius: 10px;
  border: 1px solid transparent; transition: background .15s, border-color .15s, transform .15s; }
.xrow.filled { background: color-mix(in srgb, var(--card) 70%, transparent); cursor: grab; }
.xrow.filled:hover { border-color: var(--line); background: var(--card); }
.xrow.empty { border: 1px dashed color-mix(in srgb, var(--line) 80%, transparent); }
.top10.is-dragging .xrow.empty { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.xrow.over { border-color: var(--accent); box-shadow: inset 0 3px 0 var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.xrow.dragging { opacity: .35; }
.xrow.landed { animation: land .45s cubic-bezier(.2, 1.4, .4, 1); }
.xrank { width: 34px; flex: none; text-align: right; font-weight: 800; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.xrow img { width: 30px; height: 42px; object-fit: cover; border-radius: 5px; background: var(--line); flex: none; }
.xt { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xt small { display: block; font-size: 11.5px; font-weight: 500; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.xs { font-size: 12px; color: var(--accent-2); font-weight: 700; }
.xrm { border: 0; background: transparent; color: var(--muted); cursor: pointer; opacity: 0; font-size: 12px; padding: 4px; }
.xrow:hover .xrm, .xrm:focus-visible { opacity: 1; }
/* on wide screens the pyramid moves over to make room instead of being covered */
@media (min-width: 1300px) { .top10.panel-open { padding-right: 340px; } }
@media (max-width: 600px) { .xpanel { width: 88vw; } .top10.panel-open .xpanel-tab { right: 88vw; } }

/* ---------- profile (top of My List) ---------- */
.profile-hero { position: relative; margin: -28px -28px 26px; }
.ph-banner { --tint: #6b5cff; position: relative; height: 250px; background-size: cover; background-position: center;
  background-color: #1a1626; }
.ph-banner.no-banner {
  background:
    radial-gradient(60% 120% at 75% 0%, color-mix(in srgb, var(--tint) 55%, transparent), transparent 70%),
    radial-gradient(50% 110% at 15% 10%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 70%),
    #15131c;
}
/* fade the bottom of the banner into the page, like the banners on show pages */
.ph-banner::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 30%, transparent 75%),
              linear-gradient(90deg, color-mix(in srgb, var(--bg) 45%, transparent), transparent 30%, transparent 70%, color-mix(in srgb, var(--bg) 45%, transparent)); }
.ph-banner-btn { position: absolute; top: 14px; right: 18px; z-index: 2; cursor: pointer; padding: 7px 12px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: #fff; background: rgba(0, 0, 0, .45); border: 1px solid rgba(255, 255, 255, .18);
  backdrop-filter: blur(6px); opacity: .0; transition: opacity .2s; }
.profile-hero:hover .ph-banner-btn, .ph-banner-btn:focus-within, .ph-banner.no-banner .ph-banner-btn { opacity: 1; }

.ph-body { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  gap: 24px; padding: 0 28px; margin-top: -120px; }
.ph-me { display: flex; align-items: flex-end; gap: 20px; min-width: 0; padding-bottom: 6px; }
.ph-avatar { position: relative; width: 120px; height: 120px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), #6b5cff); font-size: 46px; font-weight: 800;
  border: 4px solid var(--bg); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.ph-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph-avatar-btn { position: absolute; inset: 0; display: grid; place-items: center; cursor: pointer; font-size: 13px; font-weight: 700;
  background: rgba(0, 0, 0, .55); opacity: 0; transition: opacity .2s; }
.ph-avatar.editable:hover .ph-avatar-btn, .ph-avatar-btn:focus-within { opacity: 1; }
.ph-id { min-width: 0; }
.ph-id h1 { margin: 0 0 4px; font-size: clamp(26px, 3vw, 36px); letter-spacing: -0.02em; overflow-wrap: anywhere;
  text-shadow: 0 2px 16px rgba(0, 0, 0, .5); }
.ph-bio { margin: 0 0 6px; max-width: 52ch; line-height: 1.45; }
.ph-meta { margin: 0 0 12px; font-size: 13px; }
.ph-meta a { color: var(--accent-2); }
.ph-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* top 3 on a podium */
.ph-top3 { display: flex; flex-direction: column; align-items: center; }
.ph-top3-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; width: 100%; margin-bottom: 6px;
  font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ph-top3-head a { color: var(--accent-2); text-transform: none; letter-spacing: 0; font-weight: 600; text-decoration: none; }
.podium { display: flex; align-items: flex-end; gap: 6px; }
.pod { --medal: #cfd6e4; --medal-hi: #fff; --medal-lo: #7d8699; display: flex; flex-direction: column; align-items: center; width: 112px; }
.pod.p1 { --medal: #ffc93c; --medal-hi: #fff2b3; --medal-lo: #b07a12; width: 128px; }
.pod.p3 { --medal: #e0965a; --medal-hi: #ffd2a8; --medal-lo: #8a4a1e; }
.pod-poster { position: relative; display: block; width: 86px; aspect-ratio: 2 / 3; padding: 0; border-radius: 10px; overflow: visible;
  border: 2px solid var(--medal); background: var(--card); cursor: pointer;
  box-shadow: 0 12px 30px -10px color-mix(in srgb, var(--medal) 70%, transparent); transition: transform .2s; }
.pod.p1 .pod-poster { width: 104px; }
.pod-poster:hover { transform: translateY(-4px); }
.pod-poster img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.pod-poster.empty { display: grid; place-items: center; border-style: dashed; border-color: color-mix(in srgb, var(--medal) 50%, var(--line));
  color: var(--muted); font-size: 26px; font-weight: 800; text-decoration: none; box-shadow: none; background: color-mix(in srgb, var(--bg-2) 70%, transparent); }
.pod-crown { position: absolute; top: -26px; left: 50%; transform: translateX(-50%); font-size: 26px; line-height: 1;
  color: #ffc93c; text-shadow: 0 0 14px rgba(255, 201, 60, .8); }
.pod-title { width: 100%; margin: 7px 0 6px; text-align: center; font-size: 12px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
/* the steps: 1st tallest, then 2nd, then 3rd */
.pod-step { width: 100%; display: grid; place-items: start center; padding-top: 8px; border-radius: 8px 8px 2px 2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 34%, var(--card)), var(--bg-2) 95%);
  border-top: 3px solid var(--medal); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--medal-hi) 50%, transparent); }
.pod.p1 .pod-step { height: 74px; }
.pod.p2 .pod-step { height: 52px; }
.pod.p3 .pod-step { height: 36px; }
.pod-step span { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px;
  color: #16120a; background: linear-gradient(135deg, var(--medal-hi), var(--medal) 50%, var(--medal-lo)); }
.pod.p3 .pod-step { padding-top: 4px; }

@media (max-width: 860px) {
  .profile-hero { margin: -28px -16px 22px; }
  .ph-body { grid-template-columns: 1fr; padding: 0 16px; margin-top: -90px; }
  .ph-banner { height: 200px; }
  .ph-avatar { width: 92px; height: 92px; font-size: 36px; }
  .ph-top3 { align-items: center; }
}

/* profile editor (in the modal) */
.prof-edit { padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.prof-edit h2 { margin: 0 0 4px; }
.pe-banner { position: relative; height: 150px; border-radius: 12px; background-size: cover; background-position: center;
  background-color: #1a1626; overflow: hidden; border: 1px solid var(--line); }
.pe-banner.no-banner { background: repeating-linear-gradient(135deg, #17151f 0 12px, #1b1924 12px 24px); }
.pe-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, var(--bg-2), transparent 65%); }
.pe-banner-actions { position: absolute; right: 12px; bottom: 12px; z-index: 1; display: flex; gap: 8px; }
.pe-hint { margin: -6px 0 0; font-size: 12px; }
.pe-row { display: flex; align-items: center; gap: 16px; }
.pe-avatar { width: 84px; height: 84px; font-size: 32px; border-width: 3px; }
.pe-avatar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pe-avatar-actions p { margin: 0; font-size: 13px; max-width: 40ch; }
.pe-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.pe-field textarea { resize: vertical; font: inherit; }
.pe-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.prof-edit label.btn { cursor: pointer; }

/* podium: one solid block of three steps */
.podium { gap: 0; }
.pod-step { border-radius: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 42%, #20222b), #191b22 90%);
  border-left: 1px solid rgba(255, 255, 255, .05); border-right: 1px solid rgba(0, 0, 0, .35); }
.pod.p2 .pod-step { border-top-left-radius: 8px; }
.pod.p3 .pod-step { border-top-right-radius: 8px; }
.pod.p1 .pod-step { border-radius: 8px 8px 0 0; height: 96px; box-shadow: 0 -10px 30px -12px color-mix(in srgb, var(--medal) 70%, transparent),
  inset 0 1px 0 color-mix(in srgb, var(--medal-hi) 50%, transparent); }
.pod.p2 .pod-step { height: 68px; }
.pod.p3 .pod-step { height: 48px; padding-top: 8px; }
.pod.p1 .pod-step span { width: 34px; height: 34px; font-size: 17px; }

/* banner keeps the uploaded image's shape: full width, height from its ratio, kept between 200 and 460px */
.ph-banner:not(.no-banner) { width: 100%; height: auto; aspect-ratio: var(--ratio, 4 / 1); min-height: 200px; max-height: min(460px, 55vh); }
.ph-banner::after { background: linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 60%, transparent) 16%, transparent 45%),
  linear-gradient(90deg, color-mix(in srgb, var(--bg) 40%, transparent), transparent 18%, transparent 82%, color-mix(in srgb, var(--bg) 40%, transparent)); }
.ph-banner-tools { position: absolute; top: 14px; right: 18px; z-index: 2; display: flex; gap: 8px; }
.ph-banner-tools .ph-banner-btn { position: static; }
button.ph-banner-btn { font: inherit; font-size: 12.5px; font-weight: 600; }
.ph-move-bar { display: none; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 3; align-items: center; gap: 10px;
  padding: 6px 8px 6px 14px; border-radius: 999px; background: rgba(0, 0, 0, .65); backdrop-filter: blur(6px); font-size: 13px; font-weight: 600; color: #fff; }
.ph-banner.moving { cursor: grab; touch-action: none; }
.ph-banner.moving:active { cursor: grabbing; }
.ph-banner.moving::after { opacity: .35; }
.ph-banner.moving .ph-move-bar { display: flex; }
.ph-banner.moving .ph-banner-tools { display: none; }

/* ---------- light mode ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f4f8;
  --bg-2: #ffffff;
  --card: #ffffff;
  --line: #dcdfe7;
  --text: #16181f;
  --muted: #5d6475;
  --accent: #e5503c;
  --accent-2: #b86e00;
  --good: #1f9d5a;
  --topbar-bg: rgba(255, 255, 255, 0.86);
}
:root[data-theme="light"] * { scrollbar-color: #c3c7d1 transparent; }
:root[data-theme="light"] *:hover { scrollbar-color: #a6abb8 transparent; }
:root[data-theme="light"] .dropdown { box-shadow: 0 16px 40px rgba(20, 24, 40, .14); }
:root[data-theme="light"] .ph-banner.no-banner { background:
    radial-gradient(60% 120% at 75% 0%, color-mix(in srgb, var(--tint) 35%, transparent), transparent 70%),
    radial-gradient(50% 110% at 15% 10%, color-mix(in srgb, var(--accent) 20%, transparent), transparent 70%), #e9e7f1; }
:root[data-theme="light"] .ph-id h1 { text-shadow: 0 2px 16px rgba(255, 255, 255, .6); }
:root[data-theme="light"] .pod-step { background: linear-gradient(180deg, color-mix(in srgb, var(--medal) 45%, #fff), #eceef3 90%); }
:root[data-theme="light"] .pod-poster.empty { background: #fff; }
:root[data-theme="light"] .pe-banner.no-banner { background: repeating-linear-gradient(135deg, #eceef3 0 12px, #e4e7ee 12px 24px); }
:root[data-theme="light"] .detail-banner { background-color: #e7e3ef; }
:root[data-theme="light"] .slot.empty .slot-rank { color: #c9cdd6; }
:root[data-theme="light"] .xpanel { box-shadow: -20px 0 50px -20px rgba(20, 24, 40, .25); }

/* the toggle */
.theme-toggle { position: relative; flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--text); cursor: pointer; transition: border-color .2s, transform .2s; }
.theme-toggle:hover { border-color: var(--accent); transform: rotate(-12deg); }
.theme-toggle:disabled { cursor: progress; opacity: .7; transform: none; }
.theme-toggle svg { position: absolute; width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round;
  transition: opacity .3s, transform .4s cubic-bezier(.2, 1.4, .4, 1); }
.theme-toggle .ic-sun circle { fill: currentColor; }
.theme-toggle .ic-moon { fill: currentColor; stroke: none; }
/* dark mode shows the sun (switch to light); light mode shows the moon */
.theme-toggle .ic-moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
:root[data-theme="light"] .theme-toggle .ic-sun { opacity: 0; transform: rotate(60deg) scale(.6); }
:root[data-theme="light"] .theme-toggle .ic-moon { opacity: 1; transform: none; }

/* the full-screen switch effect */
.theme-fx { position: fixed; inset: 0; z-index: 9999; pointer-events: none; visibility: hidden; }
.theme-fx.on { visibility: visible; pointer-events: all; } /* also blocks clicks while it runs */
.theme-fx[data-to="dark"] { --fx: #050507; --ring: #ffffff; }
.theme-fx[data-to="light"] { --fx: #ffffff; --ring: #0b0b0f; }
.tfx-fill { position: absolute; inset: 0; background: var(--fx); clip-path: circle(0 at var(--cx) var(--cy)); }
.theme-fx.cover .tfx-fill { animation: tfx-cover .48s cubic-bezier(.55, 0, .3, 1) forwards; }
.theme-fx.reveal .tfx-fill { animation: tfx-reveal .56s ease-out forwards; clip-path: circle(150vmax at var(--cx) var(--cy)); }
@keyframes tfx-cover { from { clip-path: circle(0 at var(--cx) var(--cy)); } to { clip-path: circle(150vmax at var(--cx) var(--cy)); } }
@keyframes tfx-reveal { from { opacity: 1; } to { opacity: 0; } }
.tfx-wave { position: absolute; left: var(--cx); top: var(--cy); width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
  border: 2px solid var(--accent); box-shadow: 0 0 30px var(--accent), inset 0 0 18px var(--accent); opacity: 0; }
.tfx-wave.w2 { border-color: var(--ring); box-shadow: 0 0 24px var(--ring); }
.theme-fx.cover .tfx-wave { animation: wave .8s cubic-bezier(.1, .8, .2, 1) both; }
.theme-fx.cover .tfx-wave.w2 { animation-delay: .08s; }
@keyframes wave { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(70); opacity: 0; } }
body.theme-jolt .topbar { animation: tfx-jolt .3s ease both; }
@keyframes tfx-jolt { 0% { transform: none; } 30% { transform: translate(-6px, 2px); } 60% { transform: translate(5px, -2px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .theme-fx.cover .tfx-fill { animation: none; clip-path: none; }
  .theme-fx.cover .tfx-wave, body.theme-jolt .topbar { animation: none; }
}

/* light mode: text that sat on dark backgrounds, and the home banner */
:root[data-theme="light"] { --soft: #3d4352; --soft-2: #2c313d; }
.slot-info { color: #fff; } /* titles over posters stay white in both modes */
:root[data-theme="light"] .hero { background: linear-gradient(120deg, #f7e4e8, #e2e8f5); }
:root[data-theme="light"] .hero-bg { opacity: .35; }
:root[data-theme="light"] .hero::after { background: linear-gradient(0deg, var(--bg) 0%, rgba(243, 244, 248, .7) 45%, rgba(243, 244, 248, .2) 100%); }
:root[data-theme="light"] .notice.warn { border-color: #e7c48a; background: #fff6e6; }
:root[data-theme="light"] .bubble.error { border-color: #f0b4b4; color: #b42318; }
/* badges and scores drawn on top of posters keep their bright gold in light mode */
.badge, .slot-score { color: #ffb547; }

/* ---------- airing schedule ---------- */
.sched-sub { font-size: 13px; }
.sched { border: 1px solid var(--line); border-radius: 16px; background: var(--bg-2); overflow: hidden; }
.sched-days { display: flex; gap: 6px; align-items: stretch; padding: 10px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.sched-day { flex: 1 0 92px; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px;
  text-align: left; padding: 8px 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; }
.sched-day b { font-size: 13.5px; color: var(--text); }
.sched-day span { font-size: 11.5px; grid-row: 2; }
.sched-day i { grid-row: 1 / span 2; grid-column: 2; font-style: normal; font-size: 11px; font-weight: 700; min-width: 22px; text-align: center;
  padding: 2px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); }
.sched-day:hover { background: var(--card); }
.sched-day.active { background: var(--card); border-color: var(--accent); }
.sched-day.active i { background: var(--accent); color: #1a0d08; border-color: var(--accent); }
.sched-day.is-today b { color: var(--accent); }
.sched-only { flex: none; display: flex; align-items: center; gap: 6px; padding: 0 8px; font-size: 13px; color: var(--muted); white-space: nowrap; cursor: pointer; }
.sched-body { max-height: 520px; overflow-y: auto; padding: 8px 14px 16px; position: relative; }
.sched-msg { padding: 22px 18px; margin: 0; }

/* the timeline: times down the left, a line joining them, episodes to the right */
.timeline { position: relative; }
.timeline::before { content: ""; position: absolute; left: 77px; top: 6px; bottom: 6px; width: 2px; background: var(--line); border-radius: 2px; }
.tl-group { position: relative; display: grid; grid-template-columns: 64px 1fr; gap: 26px; padding: 8px 0; }
.tl-group::before { content: ""; position: absolute; left: 72px; top: 19px; width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg-2); border: 2px solid var(--accent); }
.tl-group.past::before { border-color: var(--line); background: var(--line); }
.tl-time { padding-top: 10px; text-align: right; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.tl-group.past .tl-time { color: var(--muted); font-weight: 600; }
.tl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; min-width: 0; }
.tl-item { display: flex; align-items: center; gap: 11px; min-width: 0; padding: 7px 10px 7px 7px; border-radius: 12px; text-align: left;
  border: 1px solid var(--line); background: var(--card); cursor: pointer; transition: border-color .15s, transform .15s; }
.tl-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.tl-item.tl-mine { border-left: 3px solid var(--st); }
.tl-group.past .tl-item { opacity: .6; }
.tl-group.past .tl-item:hover { opacity: 1; }
.tl-item img { width: 38px; height: 54px; object-fit: cover; border-radius: 6px; background: var(--line); flex: none; }
.tl-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tl-title { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-title .dot { margin-right: 6px; }
.tl-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tl-tag { font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; text-transform: uppercase; letter-spacing: .03em; }
.tl-tag.prem { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); }
.tl-tag.fin { background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.tl-tag.new { background: color-mix(in srgb, #6b5cff 22%, transparent); color: #8f84ff; }
.tl-when { flex: none; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.tl-when.soon { color: var(--accent-2); }
.tl-now { position: relative; display: flex; align-items: center; margin: 6px 0 6px 52px; height: 22px; }
.tl-now::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); }
.tl-now span { position: relative; padding: 2px 10px; border-radius: 999px; background: var(--accent); color: #1a0d08; font-size: 11.5px; font-weight: 800; }
@media (max-width: 640px) {
  .timeline::before { left: 57px; }
  .tl-group { grid-template-columns: 46px 1fr; gap: 22px; }
  .tl-group::before { left: 52px; }
  .tl-now { margin-left: 34px; }
  .tl-items { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  /* theme button and avatar sit together at the end of the first row */
  .theme-toggle { order: 2; margin-left: auto; width: 34px; height: 34px; }
  .theme-toggle + .avatar { margin-left: 0; }
  .nav { overflow-x: auto; }
}
@media (max-width: 640px) {
  .tl-time { font-size: 11px; padding-top: 11px; }
  .timeline::before { left: 61px; }
  .tl-group { grid-template-columns: 50px 1fr; gap: 22px; }
  .tl-group::before { left: 56px; }
  .tl-now { margin-left: 38px; }
}
@media (max-width: 560px) {
  /* phones: logo + theme + avatar on top, the page links below, then search */
  .nav { order: 4; width: 100%; }
  .search { order: 5; }
}

:root[data-theme="light"] .select, :root[data-theme="light"] select {
  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 1.5l5 5 5-5' fill='none' stroke='%235d6475' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* number boxes (scores): hide the spinner arrows, which have the same grey-box problem */
input[type=number] { -moz-appearance: textfield; appearance: textfield; }
input[type=number]::-webkit-outer-spin-button, input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* open dropdowns: the chevron flips up */
.select.is-open, select.is-open {
  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 6.5l5-5 5 5' fill='none' stroke='%23ff6b57' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  border-color: var(--accent);
}
:root[data-theme="light"] .select.is-open, :root[data-theme="light"] select.is-open {
  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 6.5l5-5 5 5' fill='none' stroke='%23e5503c' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- schedule: dots centred exactly on the timeline line ---- */
.timeline { --tl-x: 78px; }
.timeline::before { left: calc(var(--tl-x) - 1px); width: 2px; }
.tl-group::before { box-sizing: border-box; left: calc(var(--tl-x) - 6px); width: 12px; height: 12px; }
.tl-now { margin-left: calc(var(--tl-x) - 26px); }
@media (max-width: 640px) {
  .timeline { --tl-x: 62px; }
  .timeline::before { left: calc(var(--tl-x) - 1px); }
  .tl-group::before { left: calc(var(--tl-x) - 6px); }
}

/* ---- checkboxes (e.g. "My shows only") in the app's style ---- */
input[type=checkbox] {
  -webkit-appearance: none; appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 17px; height: 17px; border-radius: 5px; border: 1.5px solid var(--line); background: var(--bg-2);
  display: inline-grid; place-items: center; transition: background .15s, border-color .15s;
}
input[type=checkbox]:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
input[type=checkbox]::after {
  content: ""; width: 9px; height: 5px; border: 2px solid #1a0d08; border-top: 0; border-right: 0;
  transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .15s ease;
}
input[type=checkbox]:checked { background: var(--accent); border-color: var(--accent); }
input[type=checkbox]:checked::after { transform: translateY(-1px) rotate(-45deg) scale(1); }
input[type=checkbox]:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.sched-only:hover { color: var(--text); }

/* ---- Top 10: the 11+ count is a quiet neutral pill, not a red alert ---- */
.xpanel-tab small { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text);
  border: 1px solid color-mix(in srgb, var(--text) 14%, transparent); font-weight: 700; }

/* ---------- predicted score ("For you") ---------- */
.score-box.pred { border-color: color-mix(in srgb, #6b5cff 55%, var(--line)); background: color-mix(in srgb, #6b5cff 10%, var(--bg-2)); }
.score-box.pred b { color: #9d93ff; }
:root[data-theme="light"] .score-box.pred b { color: #5a4ae0; }

/* ---------- taste stats ---------- */
.taste > summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.taste > summary::-webkit-details-marker { display: none; }
.taste > summary h2::after { content: "▾"; display: inline-block; margin-left: 8px; font-size: 14px; color: var(--muted); transition: transform .2s; }
.taste:not([open]) > summary h2::after { transform: rotate(-90deg); }
.ts-sub { font-size: 13px; }
.ts-note { margin: 0; padding: 14px 16px; border: 1px dashed var(--line); border-radius: 12px; }
.ts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.ts-bottom { margin-top: 16px; }
.ts-card { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.ts-card h3 { margin: 0 0 4px; font-size: 15px; }
.ts-card > p.muted { margin: 0 0 12px; font-size: 12.5px; line-height: 1.45; }
.ts-head, .ts-row { display: grid; grid-template-columns: 34px minmax(0, 1fr) 46px 86px; align-items: center; gap: 10px; }
.ts-head { grid-template-columns: minmax(0, 1fr) 46px 86px; padding: 0 8px 6px 52px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.ts-head span:not(:first-child), .ts-num, .ts-eff { text-align: right; }
.ts-row { width: 100%; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.ts-row:hover { background: var(--card); }
.ts-row img { width: 34px; height: 48px; object-fit: cover; border-radius: 5px; background: var(--line); }
.ts-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ts-num { font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.ts-eff { font-size: 12.5px; font-weight: 700; color: var(--good); }
.ts-eff.away { color: var(--st-dropped); }
.ts-diff { font-style: normal; font-size: 11.5px; margin-left: 4px; padding: 1px 6px; border-radius: 999px; }
.ts-diff.up { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.ts-diff.down { color: var(--st-dropped); background: color-mix(in srgb, var(--st-dropped) 14%, transparent); }
.ts-bars { display: grid; grid-template-columns: repeat(10, 1fr); gap: 6px; align-items: end; height: 120px; margin-top: 10px; }
.ts-bar { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.ts-bar i { width: 100%; min-height: 2px; border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, var(--accent-2), var(--accent)); }
.ts-bar span { font-size: 11.5px; color: var(--muted); }
.ts-card .chips { margin: 0; }
.ts-card .chip b { font-weight: 600; margin-left: 4px; }
@media (max-width: 900px) { .ts-grid { grid-template-columns: 1fr; } }

/* "Your taste" sits under My List: give it room so it doesn't run into the last row */
#tasteStats { margin-top: 56px; }
#tasteStats .taste > summary { margin-bottom: 18px; }

/* Recommended for you: Best match / Hidden gems */
.fy-tools { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.seg button { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--text); color: var(--bg); }
/* "Not interested" on a recommendation */
.card { position: relative; }
.not-int {
  position: absolute; top: 6px; right: 6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.72); color: #fff; font-size: 12px; line-height: 26px; padding: 0; cursor: pointer;
  opacity: 0; transition: opacity .15s, background .15s;
}
.card:hover .not-int, .not-int:focus-visible { opacity: 1; }
.not-int:hover { background: var(--accent); color: #1a0d0a; }
@media (hover: none) { .not-int { opacity: .85; } }
.card.gone { opacity: 0; transform: scale(.92); transition: opacity .3s, transform .3s; pointer-events: none; }
.toast-act { margin-left: 10px; border: 0; background: none; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; cursor: pointer; padding: 0; }
.ts-hidden:not(:empty) { margin-top: 16px; }
.ts-hidden .chips { margin-bottom: 0; }

/* 👍 / 👎 under chat replies */
.fb { display: flex; align-items: center; gap: 6px; margin: 8px 0 4px 44px; }
.fb-btn {
  width: 32px; height: 32px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s;
}
.fb-btn:hover { color: var(--text); border-color: var(--muted); }
.fb-btn.down svg { transform: rotate(180deg); }
.fb-btn.on { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fb-thanks { font-size: 13px; margin-left: 4px; }
.fb-form { margin: 6px 0 8px 44px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-2); max-width: 640px; }
.fb-form p { margin: 0 0 8px; font-size: 14px; }
.fb-form .chips { margin-bottom: 10px; }
.fb-row { display: flex; gap: 8px; }
.fb-row .input { flex: 1; min-width: 0; }

/* Seasons page */
.sz-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.sz-bar .seg { flex-wrap: wrap; }
.sz-now { font-style: normal; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-left: 4px; }
.seg button.active .sz-now { color: inherit; opacity: .7; }
.sz-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 18px; }
.sz-filters .chips { margin: 0; }
.sz-filters .select { margin-left: auto; width: auto; }
.sz-yours { margin: -4px 0 14px; font-size: 14px; }
.sz-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; }
.sz-card {
  display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 12px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .15s, transform .15s;
}
.sz-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); }
.sz-card.sz-yes { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.sz-card .poster { aspect-ratio: 2 / 3; align-self: start; }
.sz-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sz-body h3 { margin: 0; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sz-body .meta { margin: 0; font-size: 12.5px; color: var(--muted); }
.sz-follows { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); }
.sz-follows.yes { color: var(--accent); font-weight: 700; }
.sz-genres { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 2px; }
.sz-genres span { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.sz-syn { margin: 4px 0 0; font-size: 13px; line-height: 1.45; color: var(--soft, var(--muted)); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.sz-actions { margin-top: auto; padding-top: 6px; }
.sz-plan { padding: 6px 12px; font-size: 13px; }
.sz-onlist { font-size: 12.5px; font-weight: 700; color: var(--accent); }
@media (max-width: 600px) {
  .sz-grid { grid-template-columns: 1fr; }
  .sz-card { grid-template-columns: 96px 1fr; }
  .sz-filters .select { margin-left: 0; }
}

/* five tabs: keep each on one line; on phones the row scrolls sideways instead of wrapping */
.nav a { white-space: nowrap; }
@media (max-width: 860px) {
  .nav { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .nav::-webkit-scrollbar { display: none; }
}

/* My List number tiles are filters */
button.stat { font: inherit; color: var(--text); text-align: left; cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
button.stat:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--st, var(--accent)) 55%, var(--line)); }
button.stat:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--st, var(--accent)) 30%, transparent); }
button.stat.active { background: color-mix(in srgb, var(--st, var(--accent)) 14%, var(--bg-2)); border-color: var(--st, var(--accent)); }

/* thumbs line up with the cards above them (cards lose their indent on narrow screens) */
.fb-btn svg { display: block; }
@media (max-width: 860px) {
  .fb, .fb-form { margin-left: 0; }
}

/* usernames: live check + suggestions; verified MAL link */
.pe-name-status { font-size: 12.5px; margin-top: 4px; }
.pe-name-status.ok { color: #3ecf8e; }
.pe-name-status.bad { color: #ff6b6b; }
.pe-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.pe-suggest:empty { display: none; }
.pe-suggest .chip { padding: 3px 10px; font-size: 12.5px; }
.mal-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font-size: 12.5px; }
.mal-badge a { color: inherit; font-weight: 700; }

/* trailers */
.detail-poster-col { display: flex; flex-direction: column; gap: 10px; }
.detail-main .poster { position: relative; }
.poster-play {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(0,0,0,.6); color: #fff; font-size: 22px; padding-left: 4px; backdrop-filter: blur(4px);
  opacity: 0; transition: opacity .2s, transform .2s, background .2s;
}
.poster:hover .poster-play, .poster-play:focus-visible { opacity: 1; }
.poster-play:hover { background: var(--accent); color: #1a0d0a; transform: scale(1.06); }
@media (hover: none) { .poster-play { opacity: .9; } }
.trailer-btn { width: 100%; }
.sz-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trailer-box { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; padding: 16px; animation: fadein .15s ease; }
.trailer-inner { width: min(1100px, 100%); }
.trailer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #fff; font-weight: 700; margin-bottom: 10px; }
.trailer-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid rgba(255,255,255,.3); background: transparent; color: #fff; cursor: pointer; flex: none; }
.trailer-close:hover { background: rgba(255,255,255,.12); }
.trailer-frame { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.trailer-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 860px) { .detail-poster-col { width: 140px; } }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

/* My List: search + sort */
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -6px 0 14px; }
.list-tools #listSearch, .list-tools #fpSearch { flex: 1 1 220px; max-width: 320px; }
.list-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
.list-sort .select { width: auto; }
.list-dir { white-space: nowrap; }
.list-table th.sortable { cursor: pointer; user-select: none; }
.list-table th.sortable:hover { color: var(--text); }
.list-table th.sorted { color: var(--accent); }
.list-table th i { font-style: normal; font-size: 10px; }
@media (max-width: 600px) { .list-tools #listSearch, .list-tools #fpSearch { max-width: none; flex-basis: 100%; } }

/* "already in your list" */
.dd-item { position: relative; }
.dd-owned { margin-left: auto; flex: none; align-self: center; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  color: var(--st, var(--accent)); border: 1px solid color-mix(in srgb, var(--st, var(--accent)) 50%, transparent); white-space: nowrap; }
.list-table tr.flash td { animation: rowflash 1.8s ease; }
@keyframes rowflash { 0%, 30% { background: color-mix(in srgb, var(--accent) 22%, transparent); } 100% { background: transparent; } }

/* ================= Anime / Manga switch ================= */
.media-toggle { display: inline-flex; flex: none; padding: 3px; gap: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); margin-left: auto; }
.media-toggle button { border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: background .2s, color .2s; }
.media-toggle button:hover { color: var(--text); }
.media-toggle button.active { background: var(--accent); color: #fff; }
.media-toggle + .search { margin-left: 12px; }
.brand-side { display: none; margin-left: 8px; padding: 2px 7px; border-radius: 6px; font-size: 10px; font-weight: 800; letter-spacing: .12em;
  text-transform: uppercase; vertical-align: 3px; color: var(--accent); border: 1.5px solid var(--accent); }
#view.mode-swap { animation: modeswap .35s ease; }
@keyframes modeswap { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .media-toggle { order: 2; margin-left: auto; }
  .media-toggle + .search { margin-left: 0; }
}

/* The manga side: the same app in "ink" — a cool blue accent instead of coral, and a faint screentone (halftone dots)
   on the top bar and banners, so you always know which side you're on without anything looking different to use. */
body.mode-manga { --accent: #7c8bff; --manga-dot: rgba(124, 139, 255, .10); }
:root[data-theme="light"] body.mode-manga { --accent: #4f5bd5; --manga-dot: rgba(79, 91, 213, .09); }
body.mode-manga .brand-side { display: inline-block; }
body.mode-manga .topbar { background-image: radial-gradient(var(--manga-dot) 1px, transparent 1.4px); background-size: 6px 6px; }
body.mode-manga .hero::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .07) 1px, transparent 1.5px); background-size: 5px 5px; mix-blend-mode: overlay; }
body.mode-manga .hero-content { z-index: 2; }
body.mode-manga .ph-banner::before, body.mode-manga .detail-banner::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1.5px); background-size: 5px 5px; }
body.mode-manga .poster { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
body.mode-manga .card .poster img { filter: saturate(.92) contrast(1.03); }

/* ================= Manga palettes, colour waves and the side badge ================= */
body.mode-manga { --on-accent: #fff; --manga-dot: color-mix(in srgb, var(--accent) 11%, transparent); }
body.mode-manga[data-palette="ink"] { --accent: #7c8bff; }
body.mode-manga[data-palette="jade"] { --accent: #34d399; --on-accent: #052e1c; }
body.mode-manga[data-palette="ocean"] { --accent: #38bdf8; --on-accent: #062236; }
body.mode-manga[data-palette="aurora"] { --accent: #5eead4; --on-accent: #042f2a; }
body.mode-manga[data-palette="sakura"] { --accent: #f472b6; --on-accent: #3b0a24; }
:root[data-theme="light"] body.mode-manga { --on-accent: #fff; }
:root[data-theme="light"] body.mode-manga[data-palette="ink"] { --accent: #4f5bd5; }
:root[data-theme="light"] body.mode-manga[data-palette="jade"] { --accent: #0f9d6b; }
:root[data-theme="light"] body.mode-manga[data-palette="ocean"] { --accent: #0284c7; }
:root[data-theme="light"] body.mode-manga[data-palette="aurora"] { --accent: #0d9488; }
:root[data-theme="light"] body.mode-manga[data-palette="sakura"] { --accent: #db2777; }
body.mode-manga .media-toggle button.active, body.mode-manga .btn:not(.ghost), body.mode-manga .chat .send { color: var(--on-accent); }

/* a slow colour wave along the bottom of the top bar, and a palette tint on the home banner */
body.mode-manga .topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--c1), var(--c2), var(--c3), var(--c1)); background-size: 300% 100%; animation: mwave 10s linear infinite; }
@keyframes mwave { from { background-position: 0% 0; } to { background-position: 300% 0; } }
body.mode-manga .hero { background: linear-gradient(120deg, color-mix(in srgb, var(--c1) 22%, var(--bg-2)), color-mix(in srgb, var(--c2) 18%, var(--bg-2)) 60%, color-mix(in srgb, var(--c3) 14%, var(--bg-2))); }
:root[data-theme="light"] body.mode-manga .hero { background: linear-gradient(120deg, color-mix(in srgb, var(--c1) 18%, #fff), color-mix(in srgb, var(--c2) 14%, #fff) 60%, color-mix(in srgb, var(--c3) 12%, #fff)); }
@media (prefers-reduced-motion: reduce) { body.mode-manga .topbar::after { animation: none; } }

/* palette picker (only on the manga side) */
.palette-wrap { position: relative; display: none; flex: none; }
body.mode-manga .palette-wrap { display: block; }
.palette-btn { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--bg-2); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.palette-btn:hover { box-shadow: 0 0 0 2px var(--accent); }
.palette-pop { position: absolute; top: calc(100% + 10px); right: -8px; z-index: 40; width: 170px; padding: 8px; border-radius: 14px;
  background: var(--bg-2); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0, 0, 0, .35); }
.palette-pop p { margin: 4px 8px 8px; font-size: 11px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.palette-pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 8px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-weight: 600; font-size: 14px; text-align: left; }
.palette-pop button:hover { background: var(--card); }
.palette-pop button.active { background: var(--card); box-shadow: inset 0 0 0 1px var(--accent); }
.palette-pop i { width: 22px; height: 22px; border-radius: 50%; flex: none; }
.media-toggle + .palette-wrap { margin-left: 8px; }
.palette-wrap + .search { margin-left: 12px; }

/* the switch: colour wave + badge */
.side-fx { position: fixed; inset: 0; z-index: 9998; pointer-events: all; }
.sfx-flood { position: absolute; inset: 0; clip-path: circle(0 at var(--cx) var(--cy));
  background: radial-gradient(circle at var(--cx) var(--cy), var(--w1), var(--w2) 55%, var(--w3)); }
.sfx-flood::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(0, 0, 0, .22) 1.2px, transparent 1.7px); background-size: 7px 7px; }
.side-fx.go .sfx-flood { animation: sfx-cover .45s cubic-bezier(.55, 0, .3, 1) forwards; }
.side-fx.out .sfx-flood { animation: sfx-fade .48s ease-out forwards; clip-path: circle(150vmax at var(--cx) var(--cy)); }
@keyframes sfx-cover { to { clip-path: circle(150vmax at var(--cx) var(--cy)); } }
@keyframes sfx-fade { to { opacity: 0; } }
.sfx-ring { position: absolute; left: var(--cx); top: var(--cy); width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; opacity: 0;
  border: 3px solid var(--w1); box-shadow: 0 0 26px var(--w1); }
.sfx-ring.r2 { border-color: var(--w2); box-shadow: 0 0 26px var(--w2); }
.sfx-ring.r3 { border-color: #fff; box-shadow: 0 0 20px #fff; }
.side-fx.go .sfx-ring { animation: wave .9s cubic-bezier(.1, .8, .2, 1) both; }
.side-fx.go .sfx-ring.r2 { animation-delay: .08s; }
.side-fx.go .sfx-ring.r3 { animation-delay: .16s; }
/* the badge: like the MANGA tag — screentone, rounded outline, spaced capitals */
.sfx-badge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.6); opacity: 0;
  padding: 18px 44px; border-radius: 20px; border: 3px solid #fff;
  background-color: #0d0e14; background-image: radial-gradient(color-mix(in srgb, var(--w1) 45%, transparent) 1.2px, transparent 1.7px); background-size: 6px 6px;
  box-shadow: 0 0 0 3px var(--w1), 0 0 40px color-mix(in srgb, var(--w2) 70%, transparent), 0 20px 60px rgba(0, 0, 0, .45); }
.sfx-badge span { display: block; font-size: clamp(34px, 7vw, 64px); font-weight: 900; letter-spacing: .32em; margin-right: -.32em; text-transform: uppercase;
  color: #fff; -webkit-text-stroke: 1.5px var(--w1); text-shadow: 0 0 22px var(--w1), 3px 3px 0 var(--w2); }
.side-fx.go .sfx-badge { animation: sfx-badge .42s cubic-bezier(.2, 1.4, .4, 1) .3s forwards; }
.side-fx.out .sfx-badge { animation: sfx-badge-out .4s ease-in forwards; }
@keyframes sfx-badge { from { opacity: 0; transform: translate(-50%, -50%) scale(.6) rotate(-4deg); } to { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); } }
@keyframes sfx-badge-out { from { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-2deg); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.15) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) {
  .side-fx.go .sfx-flood { animation: none; clip-path: none; opacity: .9; }
  .side-fx.go .sfx-ring { animation: none; }
  .side-fx.go .sfx-badge { animation: none; opacity: 1; transform: translate(-50%, -50%); }
}
@media (max-width: 860px) { .palette-wrap { order: 2; } }
body.mode-manga .eyebrow { color: var(--accent); }

/* Settings window */
.settings { padding: 28px 32px; }
.settings h2 { margin: 0 0 6px; }
.settings section { border-top: 1px solid var(--line); padding: 14px 0 6px; margin-top: 12px; }
.settings h3 { margin: 0 0 6px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; }
.set-row > div:first-child { min-width: 0; }
.set-row b { font-size: 15px; }
.set-row p { margin: 3px 0 0; font-size: 13px; line-height: 1.45; }
.set-seg { flex: none; }
.set-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.set-note { font-size: 12.5px; text-align: right; }
@media (max-width: 600px) { .set-row { flex-direction: column; align-items: flex-start; } .set-btns { justify-content: flex-start; } }

/* "Reduced" animations (Settings) */
.reduce-motion body.mode-manga .topbar::after { animation: none; }
.reduce-motion #view.mode-swap { animation: none; }
.reduce-motion .side-fx .sfx-flood { animation: none !important; clip-path: none; opacity: .85; }
.reduce-motion .side-fx .sfx-ring { display: none; }
.reduce-motion .side-fx .sfx-badge { animation: none !important; opacity: 1; transform: translate(-50%, -50%); }

/* ===== the anime/manga switch, subtle version ===== */
/* the accent eases from coral to ocean (and back) instead of snapping */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #ff6b57; }
body { transition: --accent .6s ease; }
.side-fx2 { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
.sfx2-glow { position: absolute; left: var(--cx); top: var(--cy); width: 720px; height: 720px; margin: -360px 0 0 -360px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--w1) 45%, transparent), color-mix(in srgb, var(--w2) 18%, transparent) 40%, transparent 70%);
  opacity: 0; transform: scale(.3); }
.side-fx2.go .sfx2-glow { animation: sfx2-glow .9s ease-out forwards; }
@keyframes sfx2-glow { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: .55; } 100% { opacity: 0; transform: scale(1.6); } }
.sfx2-sweep { position: absolute; left: 0; right: 0; top: calc(var(--topbar-h, 67px) - 2px); height: 2px; transform-origin: var(--cx) 50%;
  background: linear-gradient(90deg, transparent, var(--w1), var(--w2), var(--w3), transparent); transform: scaleX(0); opacity: 0; }
.side-fx2.go .sfx2-sweep { animation: sfx2-sweep .9s cubic-bezier(.2, .8, .2, 1) forwards; }
@keyframes sfx2-sweep { 0% { transform: scaleX(0); opacity: 1; } 60% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
/* the small tag: the same style as the MANGA tag next to the logo */
.sfx2-tag { position: absolute; transform: translate(-50%, -6px); opacity: 0; padding: 4px 10px; border-radius: 7px;
  font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: #fff;
  border: 1.5px solid var(--w1); box-shadow: 0 0 14px color-mix(in srgb, var(--w1) 45%, transparent), 0 8px 20px rgba(0, 0, 0, .35);
  background-color: #0d0e14; background-image: radial-gradient(color-mix(in srgb, var(--w1) 35%, transparent) 1px, transparent 1.4px); background-size: 5px 5px; }
.side-fx2.go .sfx2-tag { animation: sfx2-tag 1.25s ease forwards; }
@keyframes sfx2-tag { 0% { opacity: 0; transform: translate(-50%, -6px); } 18%, 75% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, 4px); } }
.side-fx2.still .sfx2-glow, .side-fx2.still .sfx2-sweep { display: none; }
.side-fx2.still .sfx2-tag { animation: none; opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { body { transition: none; } }

/* ---------- FRIENDS ---------- */
.nav a { position: relative; }
.nav-badge { display: inline-grid; place-items: center; min-width: 17px; height: 17px; padding: 0 5px; margin-left: 6px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent, #0b0c10); font-size: 10.5px; font-weight: 800; vertical-align: 1px; }
.nav-badge[hidden] { display: none; }
.friends-page { max-width: 1100px; margin: 0 auto; }
.fr-head h1 { margin: 6px 0 16px; font-size: 30px; letter-spacing: -0.02em; }
.fr-add { display: grid; gap: 10px; max-width: 560px; margin-bottom: 34px; }
.fr-add .seg { justify-self: start; }
.fr-add-row { display: flex; gap: 8px; }
.fr-add-row .input { flex: 1; min-width: 0; }
.fr-hint { margin: 0; font-size: 13px; }
.fr-empty { margin: 0; }
.row-head h2 small { font-size: 14px; font-weight: 600; margin-left: 4px; }

.fr-pic { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #6b5cff); color: #fff; font-weight: 800; font-size: 18px; }
.fr-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fr-who { display: grid; gap: 2px; min-width: 0; }
.fr-who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fr-who .muted { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fr-rows { display: grid; gap: 10px; max-width: 720px; }
.fr-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fr-row .fr-who { flex: 1; }
.fr-acts { display: flex; gap: 6px; flex: none; }

.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.fr-card { position: relative; display: grid; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card);
  color: inherit; text-decoration: none; transition: transform .15s, border-color .15s; }
.fr-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.fr-card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.fr-top3 { display: grid; grid-template-columns: repeat(3, minmax(0, 80px)); gap: 6px; }
.fr-top3 img, .fr-top3 i { display: block; width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; background: var(--bg-2); }
.fr-none { margin: 0; font-size: 13px; }
.mal-tag { justify-self: start; font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 1px 7px; border-radius: 6px;
  background: #2e51a2; color: #fff; }
.fr-x { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--bg-2);
  color: var(--muted); cursor: pointer; opacity: 0; transition: opacity .15s; }
.fr-card:hover .fr-x, .fr-x:focus-visible { opacity: 1; }
.fr-x:hover { color: var(--text); }
@media (hover: none) { .fr-x { opacity: 1; } }

.fr-back { display: inline-block; color: var(--muted); text-decoration: none; font-size: 14px; margin: 4px 0 14px; }
.fr-back:hover { color: var(--accent); }
.fr-hero { margin-bottom: 26px; }
.fr-hero-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fr-hero-pic { width: 88px; height: 88px; font-size: 34px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), #6b5cff); color: #fff; font-weight: 800; }
.fr-hero-id { flex: 1; min-width: 200px; }
.fr-hero-id h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; }
.fr-hero-id .ph-bio { margin: 4px 0 0; }
.fr-hero-id .ph-meta { margin: 6px 0 0; }
.fr-top10 { margin-bottom: 40px; }
.fr-top10 h2 { margin: 0 0 4px; font-size: 21px; text-align: center; }
.fr-sub { text-align: center; margin: 0 0 6px; font-size: 13px; }
.fr-top10 .fr-empty { text-align: center; padding: 30px 0; }

.pyramid.readonly { padding-top: 10px; }
.pyramid.readonly .slot.filled { cursor: pointer; padding: 0; font: inherit; color: inherit; text-align: left; }
.pyramid.readonly .slot.empty { opacity: .5; }
.slot-both { position: absolute; top: 8px; right: 8px; z-index: 2; padding: 2px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 700;
  background: rgba(10, 10, 14, .72); color: #ff8fab; backdrop-filter: blur(4px); }
.their-score { display: block; margin-top: 2px; font-size: 12px; font-weight: 700; color: var(--accent-2); }
@media (max-width: 600px) {
  .fr-add-row { flex-direction: column; }
  .fr-hero-pic { width: 68px; height: 68px; font-size: 26px; }
  .fr-hero-id h1 { font-size: 24px; }
  .slot-both { font-size: 0; padding: 3px 6px; } .slot-both::before { content: '♥'; font-size: 11px; }
}
a.card { color: inherit; text-decoration: none; }

/* a friend's profile */
.friend-profile { max-width: 1240px; margin: 0 auto; }
.friend-profile .fr-back { margin-top: 0; }
.fp-compare { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 22px; }
.fp-chip { display: flex; align-items: baseline; gap: 8px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.fp-chip b { font-size: 20px; }
.fp-chip span { color: var(--muted); font-size: 13px; }
.fp-chip.big { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--card)); }
.fp-chip.big b { color: var(--accent); }
.fp-tabs { margin-bottom: 20px; }
.fp-tabs small { color: var(--muted); font-weight: 600; margin-left: 2px; }
.fp-score { font-weight: 700; color: var(--accent-2); white-space: nowrap; }
.fp-you { font-size: 13px; font-weight: 600; white-space: nowrap; }
.fp-table .stat { cursor: default; }
@media (max-width: 600px) { .fp-chip { flex: 1 1 100%; } }
/* smaller slots: just the heart, so it never covers the rank number */
.pyr-row.r3 .slot-both, .pyr-row.r4 .slot-both { font-size: 0; padding: 3px 6px; }
.pyr-row.r3 .slot-both::before, .pyr-row.r4 .slot-both::before { content: '♥'; font-size: 11px; }

/* =====================================================================
   PHONES: everything fits the screen width, nothing scrolls sideways.
   (On phones one element that's too wide makes the browser widen the whole page, which is what cut off the
   toggle, chips and buttons and left areas with no background. So: fix the wide parts, and clip as a safety net.)
   ===================================================================== */
html, body { max-width: 100%; overflow-x: clip; }
.grid > *, .card, .card h3, .slot-title, .pod-title, .fr-who b { min-width: 0; overflow-wrap: anywhere; }
.top10 { grid-template-columns: 300px minmax(0, 1fr); }
.top10 > * { min-width: 0; }

@media (max-width: 1000px) {
  .top10 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 600px) {
  main { padding: 16px; }

  /* top bar: logo · Anime/Manga · theme · avatar, then the page links, then search. It scrolls away with the
     page here so it doesn't take a fifth of the screen. */
  .topbar { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "brand toggle theme avatar" "nav nav nav nav" "search search search search";
    align-items: center; gap: 8px; padding: 10px 16px 12px; }
  .brand { grid-area: brand; font-size: 18px; }
  .brand-side { display: none !important; }        /* the toggle already says which side you're on */
  .media-toggle { grid-area: toggle; justify-self: end; margin: 0; order: 0; }
  .media-toggle button { padding: 6px 9px; font-size: 12.5px; }
  .theme-toggle { grid-area: theme; margin: 0; order: 0; width: 34px; height: 34px; }
  .avatar { grid-area: avatar; margin: 0; order: 0; }
  .nav { grid-area: nav; order: 0; width: 100%; margin: 0 -4px; }
  .search { grid-area: search; order: 0; width: 100%; margin: 0; }
  .media-toggle + .search { margin-left: 0; }

  /* home hero */
  .hero { min-height: 240px; margin-bottom: 26px; }
  .hero-content { padding: 20px; max-width: 100%; min-width: 0; }
  .hero h1 { overflow-wrap: anywhere; }
  .grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(140px, 42vw), 1fr)); }

  /* profile (yours and friends'): podium shrinks to fit */
  .profile-hero { margin: -16px -16px 22px; }
  .friend-profile .profile-hero { margin-top: 0; }
  .ph-body { gap: 18px; }
  .ph-me { gap: 14px; }
  .ph-avatar { width: 80px; height: 80px; font-size: 32px; }
  .ph-top3 { width: 100%; }
  .podium { width: 100%; max-width: 360px; gap: 4px; margin: 0 auto; }
  .pod { width: auto; flex: 1 1 0; min-width: 0; }
  .pod.p1 { width: auto; flex: 1.2 1 0; }
  .pod-poster { width: min(86px, 82%); }
  .pod.p1 .pod-poster { width: min(104px, 86%); }
  .pod-title { max-width: 100%; font-size: 11.5px; }

  /* Top 10 pyramid: rows sized from the screen width */
  .pyramid { gap: 10px; }
  .pyr-row { width: 100%; gap: 8px; }
  .pyr-row .slot { flex: none; min-width: 0; }
  .pyr-row.r1 .slot { width: min(150px, 44%); }
  .pyr-row.r2 .slot { width: min(124px, 36%); }
  .pyr-row.r3 .slot { width: min(104px, calc((100% - 16px) / 3)); }
  .pyr-row.r4 .slot { width: min(90px, calc((100% - 24px) / 4)); }
  .pyr-row.r1 { padding-top: 26px; }
  .slot-rank, .slot.m1 .slot-rank, .slot.m2 .slot-rank, .slot.m3 .slot-rank,
  .slot.filled.m2 .slot-rank, .slot.filled.m3 .slot-rank { width: 26px; height: 26px; font-size: 13px; top: 6px; left: 6px; }
  .slot.filled.m1 .slot-rank { width: 32px; height: 32px; font-size: 16px; }
  .slot-info { padding: 20px 7px 7px; }
  .slot-title { font-size: 10.5px; }
  .pyr-row.r1 .slot-title { font-size: 12.5px; }
  .slot-sub { font-size: 9.5px; }
  .slot-score { font-size: 10px; }
  .slot-remove { opacity: 1; width: 22px; height: 22px; top: 6px; right: 6px; font-size: 10px; }  /* no hover on phones */
  .top10-head { gap: 10px; margin-bottom: 18px; }
  .top10-list { max-height: 280px; padding: 12px; }
  .top10-list-head .input { min-width: 0; }

  /* My List: each show is a small card instead of a wide table row */
  .list-table, .list-table tbody { display: block; }
  .list-table thead { display: none; }
  .list-table tr { display: grid; grid-template-columns: 46px minmax(0, 1fr) 76px auto; grid-template-areas:
      "cover title title title" "cover status score remove"; gap: 6px 10px; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--line); }
  .list-table td { padding: 0; border: 0; min-width: 0; }
  .list-table td:nth-child(1) { grid-area: cover; align-self: start; }
  .list-table td.title-cell { grid-area: title; overflow-wrap: anywhere; }
  .list-table td:nth-child(3) { grid-area: status; }
  .list-table td:nth-child(4) { grid-area: score; }
  .list-table td:nth-child(6) { grid-area: remove; }
  .list-table td:nth-child(3) .select { width: 100%; }
  .list-table input[type=number] { width: 100%; }
  .list-table img { width: 46px; height: 66px; }
  .list-table .hide-sm { display: none; }
  /* a friend's list: cover · title, then their score and yours */
  .fp-table tr { grid-template-columns: 46px minmax(0, 1fr) auto; grid-template-areas: "cover title title" "cover their you"; }
  .fp-table td:nth-child(4) { grid-area: their; }
  .fp-table td:nth-child(5) { grid-area: you; justify-self: end; }
  .fp-table td:nth-child(4)::before { content: 'Theirs '; color: var(--muted); font-weight: 500; font-size: 12px; }
  .fp-table td:nth-child(5)::before { content: 'You '; color: var(--muted); font-size: 12px; }

  .list-tools { margin-top: 0; }
  .stat-row { gap: 8px; }
  .stat-row .stat { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .chips { gap: 6px; }
  .row-head { gap: 10px; }
  .row-head > * { min-width: 0; }
  .fr-hero-row { gap: 14px; }
  .modal-body { max-width: calc(100vw - 16px); }
}

@media (max-width: 388px) {
  .brand { font-size: 0; }                 /* just the ◆ on very small phones */
  .brand .brand-mark { font-size: 22px; }
  .media-toggle button { padding: 6px 10px; }
}
@media (max-width: 600px) {
  .nav { scroll-padding-inline: 24px; }
  .list-table tr { grid-template-columns: 46px minmax(0, 1fr) 58px auto; }
  .list-table td:nth-child(3) .select { font-size: 13px; padding: 8px 26px 8px 10px; background-position: right 9px center; }
  .list-table input[type=number] { padding: 8px 10px; }
  .list-table [data-remove] { padding: 7px 9px; font-size: 12.5px; }
  .ph-top3-head { margin-bottom: 30px; }
  .fp-chip { flex: 1 1 calc(50% - 5px); flex-wrap: wrap; row-gap: 0; }
  .fp-chip.big { flex-basis: 100%; }
  .xpanel-tab { top: auto; bottom: 18px; transform: none; }   /* the "11+" tab: bottom corner, off the list */
}

/* touch screens have no hover: the remove buttons on the Top 10 and ranks 11+ are always shown */
@media (hover: none), (max-width: 600px) {
  .xrm, .slot-remove { opacity: 1; }
  .xrm { width: 30px; height: 30px; font-size: 13px; }
}

/* phones: the banner stays a banner; your picture overlaps it, and your name and buttons sit below it on the
   page background, so a bright banner can't drown them out */
@media (max-width: 600px) {
  .ph-banner { height: 150px; }
  .ph-body { margin-top: -44px; }
  .ph-me { flex-direction: column; align-items: flex-start; gap: 10px; padding-bottom: 0; }
  .ph-avatar { width: 84px; height: 84px; box-shadow: 0 0 0 4px var(--bg); }
  .ph-id h1 { text-shadow: none; }
  .ph-meta .mal-badge { margin-bottom: 2px; }
}

/* Top 3: no heading on top of the banner (it got lost on busy pictures); "Edit Top 10" sits under the podium
   as a solid button that reads on anything */
.ph-top3-head { display: none; }
.ph-top3 { padding-top: 26px; }   /* room for the crown */
.pod-edit { margin-top: 10px; padding: 6px 14px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line);
  color: var(--accent-2); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.pod-edit:hover { border-color: var(--accent-2); }

/* banner: "Reposition" only when some of the picture is cut off; the drag bar always fits inside the banner */
.ph-banner.fits #bannerMove { display: none; }
.ph-move-bar { left: 12px; right: 12px; width: max-content; max-width: calc(100% - 24px); margin: 0 auto; transform: none;
  flex-wrap: wrap; justify-content: center; row-gap: 6px; padding: 6px 8px 6px 14px; }
.ph-move-bar span { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) {
  .ph-top3-head { margin-bottom: 0; }
  .ph-top3 { padding-top: 30px; }
  .ph-move-bar { font-size: 12px; padding: 6px 6px 6px 12px; }
}
.fr-note { margin: -8px 0 22px; font-size: 13px; }
.fr-loading { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.fp-seg { display: flex; width: max-content; margin: 0 auto 8px; }
.fr-note { font-size: 13px; margin: 18px 0 0; }
.fr-note:empty { display: none; }
.fr-note .btn { margin-left: 6px; }
.list-table .title-cell a.mal-link { color: inherit; text-decoration: none; }   /* a friend's MAL-only show */
.list-table .title-cell a.mal-link:hover { color: var(--accent); }

/* a MAL user you follow who's on Anime Log */
.fr-joined { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.fr-joined b { color: var(--text); }
.fr-joined span { color: var(--muted); }
.fr-joined-note { font-size: 12.5px; }
.fr-joined-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin: -6px 0 20px; padding: 12px 16px; border-radius: 14px; font-size: 14px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.fr-joined-banner .muted { font-size: 13px; }
.fr-grid { align-items: start; }

/* manga side: the open dropdown's arrow is the manga blue, not the anime orange (the arrow is a picture, so it
   can't follow the accent colour by itself) */
body.mode-manga .select.is-open, body.mode-manga select.is-open {
  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 6.5l5-5 5 5' fill='none' stroke='%2338bdf8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
:root[data-theme="light"] body.mode-manga .select.is-open, :root[data-theme="light"] body.mode-manga select.is-open {
  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 6.5l5-5 5 5' fill='none' stroke='%230284c7' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* the "Edit Top 10 →" button follows the side's colour too */
body.mode-manga .pod-edit { color: var(--accent); }
body.mode-manga .pod-edit:hover { border-color: var(--accent); }

/* manga: release day line on a manga's page, and "Your reading schedule" on My List */
.release-line { margin: 6px 0 0; font-size: 13.5px; color: var(--soft, var(--muted)); }
.release-line.hiatus { color: var(--accent-2); }
.rs-week { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 18px; }
.rs-day { border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 12px; display: grid; gap: 8px; align-content: start; }
.rs-day.today { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.rs-day h3, .rs-group h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.rs-day.today h3 { color: var(--accent); }
.rs-item { display: flex; align-items: center; gap: 10px; padding: 0; border: 0; background: none; color: inherit; font: inherit;
  text-align: left; cursor: pointer; min-width: 0; }
.rs-item img { width: 34px; height: 48px; object-fit: cover; border-radius: 5px; background: var(--line); flex: none; }
.rs-item span { display: grid; min-width: 0; }
.rs-item b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-item small { font-size: 12px; color: var(--muted); }
.rs-item:hover b { color: var(--accent); }
.rs-group { margin: 0 0 16px; }
.rs-group > .muted { margin: 4px 0 0; font-size: 12.5px; }
.rs-list { display: grid; gap: 8px; margin-top: 8px; }
.rs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rs-row > .muted { font-size: 12.5px; text-align: right; }
.rs-note { font-size: 12.5px; margin: 6px 0 0; }
@media (max-width: 600px) { .rs-row { flex-wrap: wrap; } .rs-row > .muted { text-align: left; } }

.rs-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin-top: 8px; }
.rs-tile { padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.rs-tile[hidden] { display: none; }
.rs-tile small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-group h3 { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.rs-count { color: var(--text); opacity: .6; font-weight: 700; }
.rs-sub { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px; }
.rs-toggle { margin-top: 8px; border: 0; background: none; color: var(--accent); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 2px 0; }
.rs-toggle:hover { text-decoration: underline; }
.rs-day .rs-item small { white-space: normal; }
.rs-today { margin-left: 4px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; letter-spacing: .04em;
  background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.rs-day.today h3 { color: var(--muted); }
/* status dots inside one-line titles (cut off with "…"): room for the dot's soft ring on the left */
.series-title .dot, .tl-title .dot { margin-left: 3px; }

/* ---------- accounts: sign in / create account ---------- */
.signin-btn { flex: none; }
@media (max-width: 600px) { .signin-btn { grid-area: avatar; margin: 0; padding: 6px 10px; font-size: 12.5px; white-space: nowrap; } }
.auth-box { padding: 28px 26px 24px; display: flex; flex-direction: column; gap: 12px; max-width: 420px; margin: 0 auto; }
.auth-box h2 { margin: 0 0 4px; font-size: 24px; letter-spacing: -0.01em; text-align: center; }
.auth-brand { font-weight: 800; font-size: 15px; color: var(--muted); text-align: center; }
.auth-brand .brand-mark { color: var(--accent); }
.auth-google { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 14px; font-weight: 600; }
.auth-google svg { width: 18px; height: 18px; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12.5px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-submit { padding: 11px 14px; font-weight: 700; display: flex; justify-content: center; text-align: center; }
.auth-msg { margin: 0; font-size: 13.5px; min-height: 0; }
.auth-msg:empty { display: none; }
.auth-msg.bad { color: #ff7a7a; }
.auth-msg.ok { color: var(--good); }
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.auth-links a { color: var(--muted); }
.auth-links a:hover { color: var(--accent); }
.modal-body:has(.auth-box) { width: min(460px, 100%); }
.modal.modal-center .modal-body, .modal:has(.auth-box) .modal-body { margin: auto 0; }  /* sign-in sits in the middle (auto margins: never cut off on short screens) */

.signin-wall { max-width: 520px; margin: 9vh auto; text-align: center; display: grid; gap: 12px; justify-items: center; }
.signin-wall h1 { margin: 0; font-size: clamp(24px, 4vw, 32px); letter-spacing: -0.02em; }
.signin-wall p { margin: 0; }
.signin-wall .small { font-size: 13px; margin-top: 10px; }
.signin-wall .brand-mark.big { font-size: 44px; color: var(--accent); line-height: 1; }
.signin-wall-btns { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

.set-row.danger b { color: #ff7a7a; }
.btn.danger { color: #ff7a7a; border-color: color-mix(in srgb, #ff7a7a 45%, var(--line)); }

/* a page that waits for its parts before showing (My List / profile): fades in once everything is there */
#view { transition: opacity .18s ease; }
#view.page-hold { opacity: 0; transition: none; }
.auth-box > p.muted { text-align: center; margin: 0; }
