:root {
  color-scheme: dark;
  --bg: #101115;
  --sidebar: #131419;
  --panel: #181a20;
  --raised: #202229;
  --line: #292b34;
  --text: #f3f2f4;
  --muted: #a4a5af;
  --subtle: #83858f;
  --gold: #f6b859;
  --gold-hover: #ffc674;
  --ink: #1d150b;
  --side-width: 230px;
  font-family: 'Golos Text', system-ui, sans-serif;
  font-size: 100%;
  font-weight: 400;
  font-synthesis: none;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .4; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
button, a, input, select, textarea { transition: background-color .16s, color .16s, border-color .16s, opacity .16s; }
a { color: inherit; }
p, h1, h2, h3 { margin: 0; }
.shell { min-height: 100vh; }
.workspace { margin-left: var(--side-width); min-height: 100vh; display: flex; flex-direction: column; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: var(--side-width);
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 81px;
  flex: 0 0 81px;
  padding: 0 23px;
  text-decoration: none;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -.045em;
}
.brand img { flex: none; display: block; }
.brand-dot { color: var(--gold); }
.navigation { padding: 20px 13px; display: grid; gap: 4px; }
.nav-label { padding: 0 11px; color: var(--subtle); font-size: .75rem; font-weight: 700; letter-spacing: .092em; margin: 0 0 7px; }
.nav-label:not(:first-child) { margin-top: 24px; }
.nav-link {
  position: relative;
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 11px;
  border-radius: 7px;
  color: #b7b7c0;
  text-decoration: none;
  font-weight: 500;
  font-size: .89rem;
  white-space: nowrap;
}
.nav-link svg { flex: none; color: #92939e; }
.nav-link:hover { background: var(--raised); color: var(--text); }
.nav-link.active { background: #2b241c; color: var(--gold); }
.nav-link.active svg { color: var(--gold); }
.nav-link.active::before { content: ''; position: absolute; left: 0; top: 11px; bottom: 11px; width: 2px; border-radius: 2px; background: var(--gold); }
.nav-divider { height: 1px; margin: 13px 8px 8px; background: var(--line); }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 81px;
  padding: 0 34px;
  border-bottom: 1px solid var(--line);
  background: var(--sidebar);
}
.search { flex: 1; min-width: 0; position: relative; display: flex; align-items: center; height: 43px; color: var(--muted); }
.search > span { position: absolute; left: 13px; display: grid; place-items: center; pointer-events: none; }
.search input {
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #191b21;
  padding: 0 14px 0 41px;
  font-size: .88rem;
}
.search input::placeholder { color: #9a9ca7; }
.search input:focus { border-color: #8c6c40; outline-offset: 1px; }
.search input::-webkit-search-cancel-button { cursor: pointer; }
.button, .icon-button {
  display: inline-flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 600;
  font-size: .88rem;
  line-height: 1.1;
  color: var(--text);
  background: none;
  flex-shrink: 0;
}
.button { padding: 0 15px; min-height: 42px; }
.button svg, .icon-button svg { flex: none; }
.icon-button { padding: 0; width: 42px; height: 42px; }
.button-primary { background: var(--gold); color: var(--ink); }
.button-primary:hover { background: var(--gold-hover); }
.button-secondary { background: #23252d; border-color: #343640; }
.button-secondary:hover, .icon-button:hover { background: #30323d; }
.add-top { margin-left: auto; }
.add-top > span:first-child { display: flex; }
.account-top { background: var(--input-bg); border-color: var(--border-strong, var(--line)); color: var(--accent); }
.account-top:hover { background: var(--selected-bg); border-color: var(--accent); }
.account-initial { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--selected-bg); font-weight: 800; }
.mobile-menu { display: none; }
.main { flex: 1; padding: 28px 34px 0; width: 100%; max-width: 1650px; margin: 0 auto; }
.startup-skeleton { min-height: 72vh; padding-top: 4px; }
.startup-skeleton i, .skeleton-heading { display: block; border-radius: 8px; background: linear-gradient(100deg, var(--panel) 20%, var(--raised) 45%, var(--panel) 70%); background-size: 220% 100%; animation: skeleton-shimmer 1.4s ease-in-out infinite; }
.skeleton-heading { width: min(240px, 45%); height: 42px; margin-bottom: 24px; }
.skeleton-tabs, .skeleton-toolbar, .skeleton-cards { display: flex; gap: 9px; }
.skeleton-tabs { margin-bottom: 21px; }
.skeleton-tabs i { width: 92px; height: 38px; }
.skeleton-toolbar { margin-bottom: 18px; }
.skeleton-toolbar i { width: 130px; height: 38px; }
.skeleton-toolbar i + i { width: 85px; }
.skeleton-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 188px)); gap: 20px 16px; }
.skeleton-cards i { width: 100%; aspect-ratio: 2 / 3; border-radius: 9px; }
@keyframes skeleton-shimmer { to { background-position-x: -220%; } }

.auth-layout .sidebar, .auth-layout .topbar, .auth-layout .footer { display: none; }
.auth-layout .workspace {
  margin-left: 0;
  background: radial-gradient(ellipse at 50% 0%, var(--raised), transparent 65%), var(--bg);
}
.auth-layout .main { max-width: 1200px; padding: 0 clamp(16px, 5vw, 40px) 40px; }
.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--line);
}
.auth-header .brand { flex: none; height: auto; padding: 0; }
.auth-back { color: var(--muted); font-size: .9rem; text-underline-offset: 4px; }
.auth-back:hover { color: var(--text); }
.auth-card {
  width: min(100%, 444px);
  margin: clamp(24px, 8vh, 72px) auto 0;
  padding: clamp(18px, 5vw, 32px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 18px 44px color-mix(in srgb, var(--accent) 9%, transparent);
}
.auth-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.auth-switch a { display: grid; place-items: center; min-height: 40px; padding: 6px; border-radius: 6px; color: var(--muted); text-align: center; text-decoration: none; font-size: .875rem; font-weight: 650; }
.auth-switch a:hover { color: var(--text); background: var(--raised); }
.auth-switch a[aria-current] { color: var(--text); background: var(--raised); box-shadow: inset 0 0 0 1px var(--focus); }
.auth-card h1 { font-size: clamp(1.75rem, 6vw, 2.25rem); line-height: 1.15; letter-spacing: -.045em; }
.auth-card > p { margin-top: 8px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.auth-form { display: grid; margin-top: 22px; }
.auth-form label { font-weight: 600; font-size: .9rem; }
.auth-form input { min-width: 0; height: 45px; margin-top: 6px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--input-bg); color: var(--text); }
.auth-form input + label { margin-top: 16px; }
.auth-hint { margin-top: 6px; color: var(--muted); font-size: .85rem; }
.auth-note:not(:empty) { margin-top: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--text); font-size: .9rem; line-height: 1.5; }
.auth-note.auth-error:not(:empty) { border-color: #c65b57; }
.auth-submit { min-height: 46px; margin-top: 20px; }
.auth-sign-out { margin-top: 24px; }

.release-carousel {
  zoom: .85;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px;
  background: radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 15%, var(--panel)), transparent 53%), var(--panel);
  box-shadow: 0 12px 32px color-mix(in srgb, var(--accent) 8%, transparent);
}
.release-carousel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.release-eyebrow { margin-bottom: 5px; color: var(--accent); font-size: .68rem; font-weight: 800; letter-spacing: .14em; }
.release-carousel-heading h1 { font-size: clamp(1.6rem, 3vw, 2.15rem); line-height: 1.1; letter-spacing: -.045em; }
.release-tabs { display: flex; gap: 7px; overflow-x: auto; margin: 18px 0 13px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.release-tab { flex: 0 0 auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: .82rem; font-weight: 650; }
.release-tab:hover { color: var(--text); border-color: var(--accent); }
.release-tab.active { color: var(--accent); background: var(--selected-bg); border-color: var(--accent); }
.release-list:not(.top-10-list) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.release-list.top-10-list { overflow-x: auto; overscroll-behavior-inline: contain; -webkit-overflow-scrolling: touch; scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.release-list.top-10-list::-webkit-scrollbar { height: 6px; }
.release-list.top-10-list::-webkit-scrollbar-track { background: transparent; }
.release-list.top-10-list::-webkit-scrollbar-thumb { border-radius: 999px; background: var(--line); }
.release-list.top-10-list:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.release-track { display: flex; gap: 12px; width: 100%; }
.release-card { display: grid; grid-template-columns: 104px minmax(0, 1fr); min-height: 162px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: color-mix(in srgb, var(--bg) 44%, var(--panel)); }
.release-list.top-10-list .release-card { flex: 0 0 calc((100% - 24px) / 3); min-width: 0; grid-template-columns: minmax(64px, 32%) minmax(0, 1fr); min-height: 184px; scroll-snap-align: start; }
.release-list.top-10-list .release-poster { min-height: 184px; }
.release-list.top-10-list .release-card-content { padding: 10px; }
.release-list.top-10-list .release-date { font-size: .72rem; }
.release-list.top-10-list .release-title { font-size: clamp(.92rem, 1.35vw, 1.1rem); }
.release-list.top-10-list .release-summary { font-size: .73rem; line-height: 1.35; -webkit-line-clamp: 3; }
.release-card.top-ten-card .release-card-bottom { justify-content: flex-end; }
.release-card.top-ten-card { cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease; }
.release-card.top-ten-card:hover { border-color: var(--accent); box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 12%, transparent); }
.release-poster { position: relative; min-height: 162px; overflow: hidden; display: grid; place-items: center; color: var(--accent); background: linear-gradient(145deg, var(--selected-bg), var(--raised)); }
.release-poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.release-poster.logo-poster img { object-fit: contain; padding: 8px; background: var(--panel); }
.release-poster.no-poster svg { opacity: .62; }
.release-type { align-self: flex-start; width: fit-content; max-width: 100%; margin-bottom: 6px; padding: 3px 7px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--line) 70%, transparent); border-radius: 999px; background: var(--raised); color: var(--muted); font-size: .63rem; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.release-card.top-ten-card .release-type { margin: 7px 0 0; }
.release-type.is-new { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); background: var(--selected-bg); color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.release-card-content { min-width: 0; padding: 8px 12px; display: flex; flex-direction: column; }
.release-date { color: var(--accent); font-size: .68rem; line-height: 1.3; font-weight: 750; }
.release-card h3 { margin-top: 4px; }
.release-title { display: -webkit-box; width: 100%; padding: 0; overflow: hidden; border: 0; background: none; color: var(--text); text-align: left; text-overflow: ellipsis; font-size: .98rem; line-height: 1.2; font-weight: 750; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.release-title:hover { color: var(--accent); }
.release-summary { display: -webkit-box; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: .75rem; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.release-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 5px; }
.release-card-meta { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.release-source { color: var(--subtle); font-size: .67rem; text-underline-offset: 2px; }
.release-source:hover { color: var(--accent); }
.release-image-credit { max-width: 110px; overflow: hidden; color: var(--subtle); font-size: .59rem; text-overflow: ellipsis; white-space: nowrap; text-underline-offset: 2px; }
.release-image-credit:hover { color: var(--accent); }
.release-rank { color: var(--accent); font-size: .63rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.release-save { width: 28px; height: 28px; min-height: 28px; color: var(--muted); }
.release-card.top-ten-card .release-poster .release-save { position: absolute; z-index: 2; top: 7px; right: 7px; border-color: color-mix(in srgb, var(--line) 75%, transparent); background: color-mix(in srgb, var(--panel) 94%, transparent); color: var(--text); backdrop-filter: blur(8px); }
.release-save:hover { color: var(--accent); border-color: var(--accent); }
.release-save.is-saved { color: var(--accent); }
.release-footnote { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; color: var(--subtle); font-size: .68rem; line-height: 1.4; }
.release-disclaimer { color: var(--muted); font-size: .74rem; }
.release-empty { grid-column: 1 / -1; display: grid; min-height: 120px; place-items: center; padding: 18px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); text-align: center; font-size: .87rem; }

.hero {
  position: relative;
  isolation: isolate;
  min-height: 362px;
  overflow: hidden;
  display: flex;
  align-items: center;
  border: 1px solid #5a3a26;
  border-radius: 13px;
  background: #29190f;
}
.hero-art { position: absolute; inset: 0 0 0 auto; width: 84%; height: 100%; object-fit: cover; object-position: center 39%; z-index: -2; }
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, #25160e 0%, #25160e 13%, #24160fe8 27%, #24160e80 45%, #21160c00 75%),
    linear-gradient(0deg, #170f0bad 0%, transparent 45%);
}
.hero-content { padding: 29px 38px; width: min(530px, 100%); }
.hero-kicker { display: flex; align-items: center; gap: 8px; color: #fac881; text-transform: uppercase; letter-spacing: .14em; font-size: .73rem; font-weight: 700; margin-bottom: 12px; }
.hero-kicker span { width: 16px; height: 2px; border-radius: 2px; background: var(--gold); }
.hero h1 { color: #fff7ed; font-size: clamp(2.55rem, 4.18vw, 4rem); font-weight: 800; line-height: .99; letter-spacing: -.061em; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: #ead8c8; font-size: .88rem; font-weight: 500; margin-top: 15px; }
.hero-meta span { height: 3px; width: 3px; border-radius: 50%; background: #d1a883; }
.hero-description { color: #e0d2cb; font-size: .94rem; line-height: 1.53; max-width: 365px; margin-top: 11px; }
.hero-actions { display: flex; gap: 9px; margin-top: 20px; }
.hero-actions .button { min-height: 43px; padding: 0 15px; }
.hero-save { height: 43px; width: 43px; border-color: #ffffff35; background: #21150f66; }
.hero-save:hover { background: #6d4835; }

.catalog-section { margin-top: 33px; }
.catalog-section.standalone { margin-top: 5px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 12px; margin-bottom: 17px; }
.section-heading h1, .section-heading h2 { font-size: clamp(1.8rem, 3vw, 2.32rem); font-weight: 750; letter-spacing: -.046em; line-height: 1.07; }
.section-heading p { color: var(--muted); font-size: .9rem; line-height: 1.45; padding-bottom: 2px; }
.standalone .section-heading { display: block; margin-bottom: 23px; }
.standalone .section-heading p { margin-top: 7px; }
.tabs { display: flex; margin-bottom: 18px; gap: 8px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; padding: 2px 2px 4px; margin-left: -2px; }
.tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid #2b2d36;
  border-radius: 7px;
  color: #bcbec8;
  background: #191b21;
  font-size: .875rem;
  font-weight: 500;
}
.tab:hover { color: var(--text); border-color: #545762; }
.tab.active { background: #30251a; border-color: #684b2b; color: #ffcd83; }
.library-tabs { flex-wrap: wrap; }
.library-tab-count { margin-left: 5px; opacity: .72; font-variant-numeric: tabular-nums; }
.library-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -7px 0 15px; }
.library-sorting { display: flex; flex-wrap: wrap; gap: 8px; }
.library-sort-control { position: relative; display: inline-flex; min-height: 42px; border: 1px solid var(--line); border-radius: 8px; color: var(--text); background: var(--raised); }
.library-sort-control, .library-type-filter summary { background: var(--raised); border: 1px solid var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent); }
.library-sort-dropdown { position: static; }
.library-sort-trigger { min-height: 40px; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 184px; padding: 0 11px; list-style: none; cursor: pointer; font-size: .85rem; font-weight: 600; }
.library-sort-trigger:hover { color: var(--accent); }
.library-sort-trigger::-webkit-details-marker { display: none; }
.library-sort-trigger svg { flex: none; color: var(--muted); transition: transform .16s; }
.library-sort-dropdown[open] .library-sort-trigger svg { transform: rotate(180deg); }
.library-sort-control:focus-within, .library-sort-control:has(.library-sort-dropdown[open]) { border-color: var(--accent); }
.library-sort-direction { width: 48px; min-height: 40px; display: grid; place-items: center; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0 7px 7px 0; color: var(--accent); background: transparent; cursor: pointer; }
.library-sort-direction:hover { background: var(--selected-bg); }
.library-sort-direction:focus-visible { outline-offset: -3px; }
.library-sort-menu, .site-select-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 100%; display: grid; gap: 3px; padding: 5px; border: 1px solid var(--border-strong, var(--line)); border-radius: 9px; background: var(--panel); box-shadow: 0 10px 28px #18203324; }
.library-sort-option { min-height: 36px; padding: 0 9px; border: 0; border-radius: 6px; color: var(--text); background: transparent; text-align: left; white-space: nowrap; font-size: .84rem; }
.library-sort-option:hover, .library-sort-option.active { color: var(--accent); background: var(--selected-bg); }
.library-type-filter { position: relative; width: fit-content; }
.library-type-filter summary { min-height: 42px; display: inline-flex; align-items: center; gap: 8px; padding-inline: 12px; list-style: none; cursor: pointer; }
.library-type-filter summary::-webkit-details-marker { display: none; }
.library-type-filter summary svg { color: var(--accent); }
.filter-count { min-width: 20px; padding: 3px 5px; border-radius: 20px; background: var(--selected-bg); color: var(--accent); font-size: .75rem; text-align: center; }
.library-filter-panel {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  left: 0;
  width: min(420px, calc(100vw - 34px));
  max-height: min(52vh, 400px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border-strong, var(--line));
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 8px 24px #0002;
}
.library-filter-panel h2 { margin-bottom: 8px; font-size: .9rem; }
.site-select { position: relative; width: 100%; min-width: 0; }
.site-select-trigger {
  width: 100%; min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 12px; border: 1px solid var(--border-strong, var(--line)); border-radius: 8px;
  color: var(--text); background: var(--input-bg, var(--panel)); text-align: left; font-weight: 500;
}
.site-select-trigger:hover, .site-select.open .site-select-trigger { border-color: var(--accent); }
.site-select-trigger svg { flex: none; color: var(--subtle); transition: transform .16s; }
.site-select.open .site-select-trigger svg { transform: rotate(180deg); color: var(--accent); }
.site-select-menu {
  right: 0; display: none; max-height: min(300px, 45vh); overflow-y: auto;
}
.site-select.open .site-select-menu { display: grid; }
.site-select-option {
  width: 100%; min-height: 36px; padding: 0 9px; border: 0; border-radius: 6px;
  color: var(--text); background: transparent; text-align: left; white-space: nowrap; font-size: .84rem;
}
.site-select-option:hover, .site-select-option:focus-visible, .site-select-option.active { color: var(--accent); background: var(--selected-bg); outline-color: var(--accent); }
.library-filter-panel .tabs { flex-wrap: wrap; margin-bottom: 0; }
.library-filter-panel section + section { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.filter-note { color: var(--muted); font-size: .825rem; }
.library-filter-panel .clear-library-filters { min-height: 34px; margin-top: 12px; }
.poster-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px 14px; }
.card { min-width: 0; }
.card-image { position: relative; aspect-ratio: 2 / 3; isolation: isolate; border-radius: 9px; }
.card-image.has-progress { border-radius: 9px 9px 0 0; }
.artwork { overflow: hidden; border: 1px solid #34343d; background: radial-gradient(ellipse at top right, #4d3d30, #20222b 64%); color: #a09280; display: grid; place-items: center; }
.artwork img { width: 100%; height: 100%; object-fit: cover; display: block; position: absolute; inset: 0; transition: transform .28s ease; }
.card-image .artwork { position: absolute; inset: 0; border-radius: inherit; }
.card-image:hover .artwork img { transform: scale(1.035); }
.card-hit { position: absolute; inset: 0; border: 0; background: transparent; border-radius: inherit; }
.card-hit:focus-visible { outline-offset: 2px; }
.card-save { position: absolute; top: 8px; right: 8px; width: 31px; height: 31px; border-radius: 6px; border-color: #ffffff29; background: #101015b8; backdrop-filter: blur(8px); }
.card-save:hover { background: #22222b; }
.is-saved { color: var(--gold); }
.is-saved svg { fill: #f6b8594d; }
.rating { position: absolute; top: 9px; left: 8px; color: #ffcf87; background: #161216da; border: 1px solid #ffffff25; border-radius: 5px; padding: 3px 5px; display: flex; align-items: center; gap: 3px; font-size: .73rem; font-weight: 700; pointer-events: none; }
.rating svg { fill: #ffcf87; }
.card-title { background: none; color: var(--text); border: 0; text-align: left; padding: 0; margin-top: 9px; font-weight: 600; font-size: .93rem; line-height: 1.25; }
.card-title:hover { color: var(--gold); }
.card-meta, .card-state { margin-top: 4px; font-size: .82rem; line-height: 1.25; color: var(--muted); }
.card-state { color: #e6ae67; }
.card-progress { position: relative; height: 7px; border: 1px solid var(--line); border-top: 0; background: var(--raised); border-radius: 0 0 9px 9px; overflow: hidden; }
.card-progress span { display: block; min-width: 0; background: var(--gold); height: 100%; }
.catalog-hint, .results-note { color: var(--muted); font-size: .89rem; line-height: 1.4; margin: 19px 0 3px; }
.catalog-hint { display: flex; align-items: center; gap: 7px; }
.results-note { margin: 0 0 14px; }
.coverage-panel { margin: 0 0 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text); padding: 13px 15px; }
.coverage-panel summary { cursor: pointer; font-weight: 700; }
.coverage-panel > p { color: var(--muted); font-size: .84rem; line-height: 1.4; margin: 7px 0 10px; }
.coverage-scroll { overflow-x: auto; }
.coverage-panel table { border-collapse: collapse; width: 100%; min-width: 530px; font-size: .84rem; }
.coverage-panel th, .coverage-panel td { border-top: 1px solid var(--line); padding: 7px 8px; text-align: left; }
.coverage-panel th { color: var(--text); font-weight: 600; }
.coverage-panel td { color: var(--muted); font-variant-numeric: tabular-nums; }
.coverage-footnote { color: var(--muted); font-size: .78rem; line-height: 1.4; margin: 8px 0 0; }
.detail-extra { color: var(--muted); font-size: .82rem; line-height: 1.4; margin-top: 6px; }
.detail-extra strong { color: var(--text); }
.image-credit { color: var(--muted); font-size: .76rem; line-height: 1.4; margin-top: 8px; }
.image-credit a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.empty { display: grid; place-items: center; text-align: center; min-height: 245px; padding: 24px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); }
.empty-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 11px; color: var(--gold); background: #30251a; }
.empty h2 { margin-top: 9px; font-size: 1.28rem; }
.empty p { color: var(--muted); max-width: 460px; margin: 7px 0 15px; line-height: 1.45; }
.footer { margin: 32px 34px 0; border-top: 1px solid var(--line); padding: 16px 0 19px; display: flex; justify-content: space-between; color: var(--muted); font-size: .82rem; gap: 14px; }
.text-button { border: 0; background: none; color: var(--muted); padding: 0; }
.text-button:hover { color: var(--gold); }

.stat-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; border: 1px solid var(--line); background: var(--panel); padding: 15px; border-radius: 10px; margin-bottom: 16px; }
.stats-filter-header { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stats-filter-header .button, .stats-show-all { min-height: 34px; padding: 5px 10px; font-size: .8rem; }
.stats-filter { position: relative; min-width: 0; }
.stats-filter summary { min-height: 57px; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 10px; border: 1px solid var(--border-strong, var(--line)); border-radius: 7px; background: var(--input-bg); cursor: pointer; list-style: none; }
.stats-filter summary::-webkit-details-marker { display: none; }
.stats-filter summary > span { min-width: 0; display: grid; gap: 3px; }
.stats-filter summary strong { font-size: .75rem; color: var(--muted); }
.stats-filter-selection { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; font-weight: 650; }
.stats-filter summary svg { color: var(--muted); flex: none; }
.stats-filter[open] summary, .stats-filter summary:hover { border-color: var(--accent); }
.stats-filter[open] summary svg { transform: rotate(180deg); }
.stats-filter-options { position: absolute; inset: calc(100% + 5px) 0 auto; z-index: 15; max-height: 240px; overflow-y: auto; padding: 4px; background: var(--panel); border: 1px solid var(--border-strong, var(--line)); border-radius: 8px; box-shadow: 0 8px 24px #0002; }
.stats-filter-options label { display: flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px; border-radius: 5px; font-size: .84rem; overflow-wrap: anywhere; cursor: pointer; }
.stats-filter-options label:hover, .stats-filter-options label:focus-within { background: var(--raised); }
.stats-filter-options input { flex: none; }
.stats-filter-options p { padding: 6px; color: var(--muted); font-size: .84rem; }
.detail-controls label, .form-content label { display: grid; gap: 6px; min-width: 0; }
.detail-controls label > span, .form-content label > span { font-size: .875rem; font-weight: 500; color: #c3c4cf; }
select, .form-content input:not([type=checkbox]), textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--border-strong, var(--line));
  border-radius: 7px;
  padding: 8px 10px;
  background: var(--input-bg, var(--panel));
  color: var(--text);
}
select {
  appearance: none;
  color-scheme: inherit;
  padding-right: 33px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23bbbbc5' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select:focus-visible { border-color: var(--accent); outline-color: var(--accent); }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stats .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric, .stat-panel { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.metric { min-height: 144px; display: grid; align-content: start; gap: 7px; font-size: .86rem; color: var(--muted); }
.metric strong { font-size: 1.85rem; color: var(--text); line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric-detail { color: var(--subtle); font-size: .78rem; }
.rewatch-metric { min-height: 190px; }
.rewatch-list { width: 100%; display: grid; gap: 6px; margin: 1px 0 0; padding: 0; list-style: none; }
.rewatch-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; color: var(--text); font-size: .78rem; }
.rewatch-list li span { min-width: 0; overflow-wrap: anywhere; }
.rewatch-metric li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rewatch-list li small { flex: none; color: var(--muted); font-size: .7rem; }
.stats-show-all { justify-self: start; margin-top: 10px; }
.rewatch-empty { line-height: 1.4; }
.episodes-left-metric { block-size: 14rem; min-inline-size: 0; grid-template-rows: 35px minmax(0, 1fr) 42px; padding-inline: clamp(10px, 3vw, 16px); }
.episodes-left-summary { display: grid; align-content: start; gap: 5px; }
.episodes-left-metric .site-select-trigger { font-size: .82rem; }
.episodes-left-metric .site-select-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.episodes-left-metric .site-select-menu { grid-template-columns: minmax(0, 1fr); }
.episodes-left-metric .site-select-option { white-space: normal; overflow-wrap: anywhere; }
.metric-icon { width: 35px; height: 35px; display: grid; place-items: center; color: var(--gold); background: #30251a; border-radius: 7px; }
.stats-insights, .breakdowns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.stats-insights .stat-panel { min-width: 0; }
.stat-panel h2 { display: flex; gap: 9px; align-items: center; font-size: 1.1rem; margin-bottom: 13px; }
.stat-panel h2 svg { color: var(--gold); }
.stat-panel p { color: var(--muted); font-size: .9rem; }
.stat-panel ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 11px; }
.stat-panel li > div:first-child { display: flex; justify-content: space-between; gap: 6px; font-size: .88rem; margin-bottom: 4px; color: #d5d5df; }
.activity-panel { display: flex; flex-direction: column; }
.activity-chart { flex: 1; min-height: 260px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; padding-top: 23px; border-bottom: 1px solid var(--line); }
.activity-week { min-width: 0; display: grid; grid-template-rows: minmax(0, 1fr) 26px; justify-items: center; gap: 4px; text-align: center; }
.activity-plot { display: flex; align-items: flex-end; justify-content: center; width: 100%; }
.activity-week small { color: var(--subtle); font-size: .65rem; line-height: 1.1; align-self: center; }
.activity-bar { position: relative; width: min(82%, 42px); min-height: 4px; border-radius: 5px 5px 2px 2px; background: var(--accent); }
.activity-bar strong { position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%); color: var(--muted); font-size: .73rem; font-variant-numeric: tabular-nums; }
.activity-bar.is-empty { background: var(--raised); }
.activity-empty { margin-top: 9px; color: var(--subtle); font-size: .76rem; }
.genre-legend { display: flex; flex-wrap: wrap; gap: 15px; margin: -3px 0 14px; color: var(--muted); font-size: .78rem; }
.genre-legend span { display: inline-flex; align-items: center; gap: 6px; }
.genre-legend i { width: 9px; height: 9px; display: inline-block; border-radius: 50%; background: var(--accent); }
.genre-legend .genre-legend-planned { background: var(--subtle); }
.stat-panel .genre-preferences-list { gap: 10px; }
.genre-pref-heading { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 4px; color: var(--text); font-size: .83rem; }
.genre-pref-heading strong { color: var(--muted); font-variant-numeric: tabular-nums; }
.genre-pref-bars { display: grid; gap: 3px; }
.genre-pref-bars span { display: block; height: 4px; min-width: 2px; border-radius: 3px; }
.genre-pref-done { background: var(--accent); }
.genre-pref-queue { background: var(--subtle); }
.bar { height: 5px; background: #292b33; border-radius: 3px; }
.bar span { display: block; background: var(--gold); height: 100%; border-radius: 3px; }
.form-content.stats-list-content { border: 0; border-radius: 0; padding: 26px; }
.stats-list-content h2 { padding-right: 32px; }
.stats-list-content .rewatch-list li { font-size: .88rem; }

dialog {
  color: var(--text);
  border: 1px solid #3a3c46;
  border-radius: 13px;
  background: #191b22;
  padding: 0;
  max-height: min(86vh, 900px);
  max-width: calc(100% - 24px);
  box-shadow: 0 28px 75px #0009;
}
dialog::backdrop { background: #08090bc2; backdrop-filter: blur(3px); }
.close-dialog { position: absolute; top: 12px; right: 12px; z-index: 1; width: 34px; height: 34px; color: #ceced7; background: #262832; border-color: #393b46; }
.detail-dialog { width: 700px; }
.detail-content, .form-content { padding: 26px; }
.detail-heading { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 20px; align-items: start; }
.detail-poster { position: relative; aspect-ratio: 2/3; border-radius: 8px; }
.detail-overview { padding-right: 25px; }
.detail-type { font-size: .82rem; color: var(--gold); font-weight: 600; margin: 0 0 5px; }
.show-status { display: inline-block; padding: 2px 7px; border-radius: 5px; background: var(--selected-bg); color: var(--accent); font-weight: 600; }
.detail-overview h2, .form-content h2 { font-size: clamp(1.4rem, 4vw, 2rem); line-height: 1.14; letter-spacing: -.036em; }
.original, .detail-meta, .description { font-size: .9rem; color: var(--muted); line-height: 1.45; margin-top: 6px; }
.description { color: #dad9df; margin-top: 9px; }
.genres { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.genres span { border: 1px solid #383944; color: #ceced8; padding: 4px 7px; border-radius: 5px; font-size: .75rem; }
.source-link, .form-content a { display: inline-block; color: #ffd08a; margin-top: 8px; font-size: .85rem; }
.detail-controls { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 15px 0; margin-top: 20px; }
.detail-controls label { max-width: 325px; }
.view-counter { display: grid; justify-items: center; gap: 4px; margin-top: 8px; color: var(--muted); font-size: .76rem; }
.view-counter input {
  width: min(70px, 100%);
  height: 32px;
  padding: 0 5px;
  color: var(--text);
  background: var(--input-bg);
  border: 1px solid var(--border-strong, var(--line));
  border-radius: 7px;
  text-align: center;
  font-weight: 700;
  appearance: textfield;
}
.view-counter input::-webkit-inner-spin-button, .view-counter input::-webkit-outer-spin-button { appearance: none; margin: 0; }
.rewatch-button { width: 100%; min-height: 32px; margin-top: 7px; padding: 4px 7px; font-size: .76rem; }
.episodes { margin-top: 17px; }
.episodes-heading, .season-info { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.episodes-heading { flex-wrap: wrap; }
.episodes-heading h3 { font-size: 1.15rem; }
.episodes-heading .button { min-height: 36px; }
.episodes-heading-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.episode-message { color: var(--muted); font-size: .9rem; margin: 10px 0; }
.season-info { margin: 11px 0 7px; color: var(--muted); font-size: .85rem; }
.season-info { flex-wrap: wrap; }
.season-switcher { display: flex; align-items: center; gap: 6px; }
.season-switcher .season-step { width: 38px; height: 38px; border-color: var(--border-strong, var(--line)); background: var(--input-bg, var(--panel)); color: var(--accent); }
.season-switcher .season-step:hover:not(:disabled) { border-color: var(--accent); background: var(--raised); }
.season-switcher .season-select { min-width: 144px; }
.season-info .season-select { width: auto; min-width: 150px; }
.season-info .season-select .site-select-trigger { font-weight: 600; }
.episode-order { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 8px 0 10px; color: var(--muted); font-size: .82rem; }
.episode-order-button { min-height: 32px; padding: 0 10px; font-size: .8rem; }
.episode-order-button.active { border-color: var(--accent); background: var(--selected-bg, var(--raised)); color: var(--accent); }
.episode-order-note { font-size: .78rem; }
select option { color: var(--text); background-color: var(--panel); }
select option:checked { color: var(--accent); background-color: var(--selected-bg, var(--raised)); }
.season-toggle { min-height: 36px; padding-inline: 10px; font-size: .8rem; }
.episode-list { margin: 0; padding: 0; list-style: none; }
.episode-list li + li { border-top: 1px solid var(--line); }
.episode-list-item { display: flex; align-items: center; gap: 6px; }
.episode-list-item .episode-row { flex: 1; min-width: 0; }
.episode-edit { width: 30px; height: 30px; flex: none; color: var(--muted); }
.episode-edit:hover { color: var(--accent); }
.episode-row { display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 7px 4px; font-size: .9rem; cursor: pointer; }
.episode-row:hover { background: #23252e; }
.episode-upcoming .episode-row { cursor: default; }
.episode-upcoming .episode-row:hover { background: transparent; }
.episode-availability { flex: none; color: var(--muted); font-size: .76rem; text-align: right; }
input[type=checkbox] {
  appearance: none; -webkit-appearance: none; width: 18px; height: 18px; flex: none; display: inline-grid; place-content: center;
  margin: 0; border: 1.5px solid var(--border-strong, var(--line)); border-radius: 5px; color: var(--accent);
  background: var(--input-bg, var(--panel)); cursor: pointer; transition: background-color .16s, border-color .16s, box-shadow .16s;
}
input[type=checkbox]::before { content: ''; width: 9px; height: 5px; border: solid currentColor; border-width: 0 0 2px 2px; transform: translateY(-1px) rotate(-45deg) scale(0); transition: transform .12s ease-in-out; }
input[type=checkbox]:checked { border-color: var(--accent); background: var(--selected-bg); }
input[type=checkbox]:checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
input[type=checkbox]:hover { border-color: var(--accent); }
input[type=checkbox]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.episode-index { color: var(--subtle); font-variant-numeric: tabular-nums; }
.episode-name { flex: 1; }
.episode-runtime { flex: none; color: var(--muted); }
.detail-footer { margin-top: 16px; }
.form-dialog { width: 530px; }
.form-content > p { font-size: .91rem; color: var(--muted); margin-top: 9px; line-height: 1.5; }
.form-content h2 { padding-right: 30px; }
.form-content form { display: grid; gap: 12px; margin-top: 17px; }
.form-content textarea { min-height: 78px; resize: vertical; }
.form-content input::placeholder, .form-content textarea::placeholder { color: #81838e; }
.form-content input[type="number"] { appearance: textfield; -moz-appearance: textfield; }
.form-content input[type="number"]::-webkit-inner-spin-button,
.form-content input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-content .checkbox-label { display: flex; align-items: center; }
.form-content .custom-season-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 9px; padding: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); }
.form-content .custom-season-fields label > span { font-size: .76rem; }
.form-content .custom-season-fields input { min-height: 34px; padding: 5px 8px; }
.form-content .custom-season-fields[hidden] { display: none; }
.custom-season-episode-counts { display: contents; }
.form-content .token-entry { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; min-height: 42px; padding: 4px 6px; border: 1px solid var(--border-strong, var(--line)); border-radius: 7px; background: var(--input-bg, var(--panel)); }
.form-content .token-entry:focus-within { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 1px; }
.form-content .token-entry input:not([type="hidden"]) { flex: 1 1 90px; width: auto; min-width: 70px; min-height: 30px; padding: 3px 5px; border: 0; outline: 0; background: transparent; box-shadow: none; }
.form-content .token-entry input:not([type="hidden"]):focus-visible { outline: 0; }
.token-suggestions { position: absolute; top: calc(100% + 6px); left: 0; z-index: 12; display: grid; width: max-content; min-width: 100%; max-width: min(320px, 80vw); max-height: 220px; overflow: auto; padding: 5px; border: 1px solid var(--border-strong, var(--line)); border-radius: 9px; background: var(--panel); box-shadow: 0 10px 28px rgb(25 42 75 / 18%); }
.token-suggestions[hidden] { display: none; }
.token-suggestion { padding: 8px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.token-suggestion:hover, .token-suggestion:focus-visible { background: var(--selected-bg); color: var(--accent); outline: 0; }
.title-validation-message { margin: -7px 0 0; color: #bf3c4b; font-size: .82rem; font-weight: 600; }
.title-validation-message[hidden] { display: none; }
.form-content input.is-invalid { border-color: #bf3c4b; box-shadow: 0 0 0 2px color-mix(in srgb, #bf3c4b 18%, transparent); }
.field-error { color: #bf3c4b; font-size: .78rem; font-weight: 600; line-height: 1.3; }
.field-error[hidden] { display: none; }
.episode-form-dialog .field-error { display: block; min-height: 1.3em; visibility: hidden; }
.episode-form-dialog .field-error:not([hidden]) { visibility: visible; }
.form-content .poster-upload input[type="file"] { min-height: 38px; padding: 5px; font-size: .83rem; }
.form-content .poster-upload input[type="file"]::file-selector-button,
.form-content .poster-upload input[type="file"]::-webkit-file-upload-button { min-height: 27px; margin: 0 9px 0 0; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--raised); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.form-content .poster-upload input[type="file"]::file-selector-button:hover,
.form-content .poster-upload input[type="file"]::-webkit-file-upload-button:hover { border-color: var(--accent); color: var(--accent); }
.poster-upload small { color: var(--muted); font-size: .75rem; line-height: 1.35; }
.poster-upload img { width: 76px; height: 112px; border: 1px solid var(--line); border-radius: 7px; object-fit: cover; }
.poster-upload img[hidden] { display: none; }
.token-chips { display: contents; }
.token-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 27px; padding: 3px 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--selected-bg); color: var(--accent); font-size: .78rem; line-height: 1.1; }
.token-chip:hover { border-color: var(--accent); }
.token-chip svg { flex: none; }
.form-content input[type="hidden"] { display: none; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.button-danger { border: 1px solid color-mix(in srgb, #bd4350 48%, var(--line)); background: color-mix(in srgb, #bd4350 9%, var(--panel)); color: #ad3442; }
.button-danger:hover { border-color: #bd4350; background: color-mix(in srgb, #bd4350 16%, var(--panel)); color: #922432; }
.toast {
  position: fixed;
  bottom: 21px;
  right: 22px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 9px;
  max-width: calc(100% - 44px);
  padding: 11px 14px;
  background: #28272e;
  color: #f5f1ec;
  border: 1px solid #48434a;
  border-radius: 8px;
  font-size: .9rem;
  opacity: 0;
  transform: translateY(7px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast:empty { visibility: hidden; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast svg { color: var(--gold); flex: none; }

@media (max-width: 1180px) {
  :root { --side-width: 205px; }
  .topbar { padding-inline: 24px; }
  .main { padding-inline: 24px; }
  .footer { margin-inline: 24px; }
  .hero-content { padding-inline: 28px; }
  .poster-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .poster-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hero { min-height: 328px; }
  .hero-art { width: 100%; object-position: 62% 46%; }
  .hero::before { background: linear-gradient(90deg, #25160ef5 0%, #25160ec9 31%, #24160e70 61%, #21160c00 100%), linear-gradient(0deg, #170f0b9c 0%, transparent 50%); }
  .section-heading { align-items: start; flex-direction: column; gap: 5px; }
  .stats .metrics, .stat-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-insights, .breakdowns { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .workspace { margin-left: 0; }
  .sidebar { width: min(260px, 75vw); transform: translateX(-100%); transition: transform .18s ease; }
  .menu-open .sidebar { transform: translateX(0); box-shadow: 0 0 0 100vmax #0008; }
  .mobile-menu { display: inline-flex; margin-left: -6px; width: 36px; color: var(--muted); }
  .topbar { min-height: 64px; padding-inline: 17px; gap: 8px; }
  .main { padding: 18px 17px 0; }
  .footer { margin-inline: 17px; }
  .add-top { padding-inline: 10px; min-height: 40px; font-size: .82rem; }
  .search { height: 40px; }
  .search input { padding: 0 7px 0 32px; }
  .search > span { left: 8px; }
  .search > span svg { width: 17px; }
  .hero { min-height: 318px; }
  .hero-art { object-position: 61% 47%; }
  .hero-content { padding: 22px; }
  .release-carousel { padding: 18px; }
  .catalog-section { margin-top: 26px; }
  .poster-grid { gap: 20px 10px; }
}
@media (max-width: 510px) {
  .hero-art { object-position: 58% 50%; }
  .hero-content { width: min(340px, 100%); }
  .hero-description { max-width: 246px; font-size: .86rem; }
  .hero h1 { font-size: 2.48rem; }
  .hero-meta { font-size: .82rem; }
  .release-card { grid-template-columns: 87px minmax(0, 1fr); min-height: 146px; }
  .release-list.top-10-list .release-card { flex-basis: calc(100% - 32px); grid-template-columns: 86px minmax(0, 1fr); }
  .release-list.top-10-list .release-poster { min-height: 200px; }
  .release-poster { min-height: 146px; }
  .release-card-content { padding: 9px; }
  .release-footnote { display: grid; }
  .poster-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rating { top: 5px; left: 5px; }
  .card-save { top: 5px; right: 5px; width: 29px; height: 29px; }
  .card-title { font-size: .87rem; }
  .card-meta { font-size: .76rem; }
  .profile-actions .button { flex: 1; }
  .detail-content, .form-content { padding: 18px; }
  .detail-heading { grid-template-columns: 83px minmax(0, 1fr); gap: 11px; }
  .detail-overview { padding-right: 22px; }
  .form-grid { gap: 8px; }
}
@media (max-width: 370px) {
  .add-top { width: 38px; padding: 0; }
  .add-top span:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* User-selected palette and appearance */
:root[data-palette="sky"] {
  --palette-base: #c9e3fb;
  --accent: #234bcb; --accent-hover: #193fae; --accent-ink: #fff;
  --selected-bg: #d7e8fa; --focus: #4977dc;
}
:root[data-palette="pistachio"] {
  --palette-base: #dce9ae;
  --accent: #a62355; --accent-hover: #861d46; --accent-ink: #fff;
  --selected-bg: #e5edcb; --focus: #ad4267;
}
:root[data-palette="sand"] {
  --palette-base: #eed5ae;
  --accent: #a92e28; --accent-hover: #8b2521; --accent-ink: #fff;
  --selected-bg: #f1e0c7; --focus: #bd554b;
}
:root[data-palette="lilac"] {
  --palette-base: #e4d4f5;
  --accent: #703d91; --accent-hover: #5c3177; --accent-ink: #fff;
  --selected-bg: #eadcf4; --focus: #8657a5;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: color-mix(in srgb, var(--palette-base) 38%, #f6f8fc);
  --sidebar: color-mix(in srgb, var(--palette-base) 54%, #fff);
  --panel: color-mix(in srgb, var(--palette-base) 24%, #fff);
  --raised: color-mix(in srgb, var(--palette-base) 58%, #fff);
  --line: color-mix(in srgb, var(--palette-base) 38%, #b8c3d2);
  --text: #20283a; --muted: #58657b; --subtle: #67758a; --ink: #fff;
  --gold: var(--accent); --gold-hover: var(--accent-hover);
  --palette-soft: color-mix(in srgb, var(--accent) 13%, var(--panel));
  --input-bg: color-mix(in srgb, var(--palette-base) 12%, #fff);
  --border-strong: color-mix(in srgb, var(--palette-base) 30%, #aebbd0);
  --artwork-glow: color-mix(in srgb, var(--palette-base) 70%, #68758b);
  --artwork-shadow: color-mix(in srgb, var(--palette-base) 25%, #485267);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: color-mix(in srgb, var(--palette-base) 12%, #121722);
  --sidebar: color-mix(in srgb, var(--palette-base) 17%, #151b27);
  --panel: color-mix(in srgb, var(--palette-base) 21%, #1b2331);
  --raised: color-mix(in srgb, var(--palette-base) 30%, #252f40);
  --line: color-mix(in srgb, var(--palette-base) 32%, #303b4d);
  --text: #edf2fb; --muted: #b2bfd3; --subtle: #98a6bb; --ink: #fff;
  --gold: var(--accent); --gold-hover: var(--accent-hover);
  --palette-soft: color-mix(in srgb, var(--accent) 21%, var(--panel));
  --input-bg: color-mix(in srgb, var(--palette-base) 16%, #1b2331);
  --border-strong: color-mix(in srgb, var(--palette-base) 29%, #39465a);
  --artwork-glow: color-mix(in srgb, var(--palette-base) 48%, #343c4e);
  --artwork-shadow: color-mix(in srgb, var(--palette-base) 12%, #171b26);
}
:root[data-theme="light"] body { background: var(--bg); color: var(--text); }
:root[data-theme="light"] .sidebar,
:root[data-theme="light"] .topbar { border-color: var(--line); }
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar { border-color: var(--line); }
.nav-link { color: var(--muted); }
.nav-link svg { color: var(--subtle); }
.nav-link.active { background: var(--selected-bg); color: var(--accent); }
.nav-link.active svg { color: var(--accent); }
.button-primary { background: var(--accent); color: var(--accent-ink); }
.button-primary:hover { background: var(--accent-hover); }
.search input, .stat-filters, .metric, .stat-panel, select,
.form-content input:not([type=checkbox]), textarea {
  background-color: var(--input-bg, #191b21);
  border-color: var(--border-strong, var(--line));
}
.search input, select, .form-content input:not([type=checkbox]), textarea { color: var(--text); }
.search input::placeholder, .form-content input::placeholder, textarea::placeholder { color: var(--subtle); }
.search input:focus { border-color: var(--focus, #8c6c40); }
.stat-filters, .metric, .stat-panel { background-color: var(--panel); }
.empty-icon, .metric-icon { background: var(--palette-soft, #30251a); color: var(--accent); }
.button-secondary { background: var(--raised); border-color: var(--line); color: var(--text); }
.genres span, .season-info select { border-color: var(--line); }
.card-save.is-saved { color: var(--accent); }
.rating { color: var(--accent); }
.rating svg { fill: var(--accent); }
.tabs .tab.active { background: var(--selected-bg); border-color: var(--accent); color: var(--accent); }
.toast { color: var(--text); background: var(--panel); border-color: var(--line); }

:root[data-theme="light"] .hero-save,
:root[data-theme="light"] .card-save {
  color: #182033;
  background: rgba(255, 255, 255, .94);
  border-color: rgba(24, 32, 51, .18);
  box-shadow: 0 2px 8px rgba(16, 24, 40, .2);
}
:root[data-theme="light"] .hero-save:hover,
:root[data-theme="light"] .card-save:hover {
  color: var(--accent);
  background: #fff;
  border-color: var(--accent);
}
:root[data-theme="light"] .hero-save.is-saved,
:root[data-theme="light"] .card-save.is-saved { color: var(--accent); }
:root[data-theme="light"] .rating {
  color: #111827;
  background: #fff;
  border-color: #111827;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .35);
}
:root[data-theme="dark"] .rating {
  color: #fff;
  background: #111318;
  border-color: rgba(255, 255, 255, .78);
  box-shadow: 0 1px 6px rgba(0, 0, 0, .55);
}
.rating svg { fill: currentColor; }
:root[data-theme="light"] .nav-link.active::before { background: var(--accent); }
:root[data-theme="dark"] .nav-link.active::before { background: var(--accent); }
.settings-page { max-width: 910px; }
.settings-page .section-heading { margin-bottom: 20px; }
.upcoming-page { max-width: 880px; }
.upcoming-list { display: grid; gap: 10px; list-style: none; margin: 0; padding: 0; }
.upcoming-episode {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.upcoming-poster { position: relative; aspect-ratio: 2 / 3; border-radius: 6px; }
.upcoming-poster svg { width: 20px; height: 20px; }
.upcoming-episode-info { display: grid; justify-items: start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.upcoming-episode-info .card-title { margin: 0; font-size: .98rem; }
.upcoming-episode-info > span { color: var(--muted); font-size: .875rem; }
.upcoming-episode-info > small { color: var(--muted); font-size: .75rem; }
.upcoming-episode time { padding: 7px 9px; border-radius: 7px; background: var(--palette-soft); font-size: .84rem; font-weight: 650; }
.upcoming-notice { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; color: var(--muted); }
@media (max-width: 510px) {
  .upcoming-episode { grid-template-columns: 40px minmax(0, 1fr); gap: 7px 12px; padding: 10px; }
  .upcoming-poster { grid-row: span 2; align-self: start; }
  .upcoming-episode time { grid-column: 2; justify-self: start; }
}
.profile-page .section-heading { margin-bottom: 18px; }
.profile-layout {
  --profile-padding: clamp(14px, 2vw, 20px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, min(42%, 480px));
  gap: 12px clamp(16px, 2.5vw, 28px);
}
.profile-account { display: grid; grid-template-rows: 1fr auto; gap: 18px; }
.profile-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 8px 20px color-mix(in srgb, var(--text) 7%, transparent);
}
.profile-stats { display: grid; container-type: inline-size; }
.profile-stats-heading {
  grid-column: 1 / -1;
  font-size: 1.05rem;
}
.profile-stats-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.profile-stats-list > li { display: grid; min-width: 0; }
@container (max-width: 360px) {
  .profile-stats-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.profile-stat {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  grid-template-rows: minmax(30px, 1fr) auto;
  align-items: start;
  gap: 9px 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  text-decoration: none;
}
.profile-stat:hover, .profile-stat:focus-visible {
  border-color: var(--accent);
  background: var(--raised);
}
.profile-stat-label {
  grid-row: 2;
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: .875rem;
  overflow-wrap: anywhere;
}
.profile-stat-count {
  grid-area: 1 / 2;
  text-align: right;
  font-size: 1.4rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 30px;
  overflow-wrap: anywhere;
}
.profile-stat-icon {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 8px;
  background: var(--selected-bg);
  color: var(--accent);
}
.profile-stat-total {
  border-color: color-mix(in srgb, var(--accent) 24%, var(--line));
  background: var(--palette-soft);
}
.profile-stat-total .profile-stat-label { color: var(--text); font-weight: 700; }
.profile-card-header {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: var(--profile-padding);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(120deg, var(--palette-soft), var(--panel));
}
.profile-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.35rem;
  font-weight: 800;
}
.profile-identity { min-width: 0; }
.profile-eyebrow { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.profile-identity h2 { margin-top: 2px; overflow-wrap: anywhere; font-size: 1.05rem; }
.profile-identity small { display: block; margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); font-size: .8rem; }
.profile-name-form { display: grid; align-content: center; gap: 8px; padding: var(--profile-padding); }
.profile-name-form > label { color: var(--text); font-size: .875rem; font-weight: 600; }
.profile-name-fields { display: flex; gap: 8px; }
.profile-name-fields input { min-width: 0; flex: 1; height: 44px; padding: 0 11px; border: 1px solid var(--border-strong, var(--line)); border-radius: 8px; background: var(--input-bg, var(--panel)); color: var(--text); }
.profile-name-fields input:focus { border-color: var(--accent); outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent); outline-offset: 1px; }
.profile-name-fields .button { min-height: 44px; }
.profile-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile-signout {
  width: 100%;
  min-height: 52px;
  gap: 10px;
  border-radius: 11px;
  background: #a52d40;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}
.profile-signout:hover { background: #872335; }
.profile-signout svg { width: 21px; height: 21px; }
.signout-confirm-dialog { width: min(440px, calc(100vw - 28px)); }
@media (max-width: 860px) {
  .profile-layout { grid-template-columns: minmax(0, 480px); }
  .profile-account { margin-top: 6px; }
}
.settings-group { margin-top: 21px; }
.settings-group-heading { margin-bottom: 9px; }
.settings-group-heading h2 { font-size: 1.16rem; letter-spacing: -.025em; }
.setting-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.palette-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
.setting-choice {
  width: 100%; min-width: 0; min-height: 48px; display: flex; align-items: center; gap: 7px;
  padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text); text-align: left;
}
.setting-choice:hover { border-color: var(--accent); background: var(--raised); }
.setting-choice.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.setting-choice-copy { min-width: 0; flex: 1; display: grid; gap: 4px; }
.setting-choice-copy strong { font-size: .82rem; font-weight: 600; }
.setting-choice-copy small { font-size: .79rem; line-height: 1.35; color: var(--muted); }
.setting-swatch {
  position: relative; flex: none; width: 24px; height: 24px; border-radius: 6px;
  background: var(--swatch-base); border: 1px solid color-mix(in srgb, var(--text) 12%, transparent);
}
.setting-swatch::after {
  content: ''; position: absolute; width: 11px; height: 11px; right: -3px; bottom: -3px;
  border: 2px solid var(--panel); border-radius: 50%; background: var(--swatch-accent);
}
.setting-radio {
  display: grid; place-items: center; flex: none; width: 16px; height: 16px;
  border: 1px solid var(--subtle); border-radius: 50%;
}
.setting-choice.selected .setting-radio { border: 6px solid var(--accent); }
.appearance-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.appearance-options .setting-choice > svg { color: var(--accent); }
@media (max-width: 560px) {
  .setting-options { grid-template-columns: 1fr; }
  .palette-options { grid-template-columns: repeat(auto-fit, minmax(min(100%, 205px), 1fr)); }
  .appearance-options { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .appearance-options .setting-choice { flex-direction: column; justify-content: center; min-height: 86px; padding: 8px; }
  .appearance-options .setting-radio { display: none; }
}

/* Carry the selected palette across surfaces, controls, and supporting UI. */
.nav-link.active::before { background: var(--accent); }
.tab { color: var(--muted); background: var(--panel); border-color: var(--line); }
.tab:hover { color: var(--text); border-color: var(--accent); }
.genres span { color: var(--accent); background: var(--palette-soft); border-color: var(--line); }
.artwork {
  border-color: var(--line);
  color: var(--muted);
  background: radial-gradient(ellipse at top right, var(--artwork-glow), var(--artwork-shadow) 64%);
}
.card-state, .source-link, .form-content a, .detail-type { color: var(--accent); }
.description, .detail-controls label > span { color: var(--muted); }
.stat-panel li > div:first-child { color: var(--text); }
.bar { background: var(--raised); }
dialog { background: var(--panel); border-color: var(--line); }
.close-dialog { color: var(--text); background: var(--raised); border-color: var(--line); }
.episode-row:hover { background: var(--raised); }
.button-secondary:hover, .icon-button:hover { background: var(--raised); border-color: var(--accent); }
.card-title:hover, .text-button:hover, .stat-panel h2 svg, .toast svg { color: var(--accent); }
.toast { color: var(--text); background: var(--panel); border-color: var(--line); }
