:root {
  color-scheme: dark;
  --bg: #101113;
  --panel: #17191d;
  --panel-2: #202329;
  --line: #31343b;
  --text: #f4f0e8;
  --muted: #b8b1a6;
  --soft: #817b72;
  --red: #ff5c68;
  --mint: #62d5a4;
  --amber: #f5b84b;
  --cyan: #70d8ee;
  --violet: #b697ff;
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 92, 104, 0.14), transparent 26rem),
    radial-gradient(circle at 88% 8%, rgba(98, 213, 164, 0.12), transparent 24rem),
    var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 26rem),
    transparent;
  transition: background-color 180ms ease, color 180ms ease;
}

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #edf0f4;
  --line: #d7dce3;
  --text: #1b1e23;
  --muted: #5f6670;
  --soft: #858c96;
  --shadow: 0 18px 46px rgba(39, 44, 51, 0.12);
  background: #f4f6f8;
}

html[data-theme="light"] body {
  background: #f4f6f8;
}

html[data-theme="light"] .search-band,
html[data-theme="light"] .detail-pane {
  background: rgba(255, 255, 255, 0.96);
}

html[data-theme="light"] :is(
  .search-box,
  .segmented,
  .select-control select,
  .rating-strip,
  .character-card,
  .comment-item,
  .episode-button,
  .field input,
  .field select,
  .field textarea,
  .api-episode-card,
  .availability-panel,
  .guide-notes
) {
  background: #f8f9fb;
}

html[data-theme="light"] :is(.anime-card, .shelf-card, .update-card, .popular-item, .calendar-day, .history-item) {
  background: #ffffff;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 32px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 92, 104, 0.95), rgba(245, 184, 75, 0.88)),
    #2a1f22;
  box-shadow: var(--shadow);
  color: #17120f;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 1.05rem;
}

.brand-copy small {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.quick-stats span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 29, 0.82);
}

.quick-stats b {
  color: var(--text);
}

html[data-theme="light"] .quick-stats span {
  border-color: #17191d;
  background: #17191d;
  color: #ffffff;
}

html[data-theme="light"] .quick-stats b {
  color: #ffffff;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.launch-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 18px;
  padding: 14px;
  border: 1px solid rgba(98, 213, 164, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(98, 213, 164, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(112, 216, 238, 0.1), transparent 44%),
    rgba(23, 25, 29, 0.88);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .launch-banner {
  background:
    linear-gradient(135deg, rgba(32, 142, 97, 0.1), transparent 34%),
    linear-gradient(225deg, rgba(49, 126, 151, 0.08), transparent 44%),
    rgba(255, 255, 255, 0.96);
}

.launch-copy {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.launch-badge {
  display: inline-grid;
  min-width: 52px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(98, 213, 164, 0.34);
  border-radius: 8px;
  background: rgba(98, 213, 164, 0.12);
  color: var(--mint);
  font-weight: 900;
  text-transform: uppercase;
}

.launch-copy strong {
  display: block;
  margin-bottom: 3px;
}

.launch-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.launch-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.search-band {
  display: grid;
  gap: 14px;
  margin: 12px 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 29, 0.9);
  box-shadow: var(--shadow);
}

.watch-hub {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(112, 216, 238, 0.09), transparent 34%),
    linear-gradient(225deg, rgba(98, 213, 164, 0.08), transparent 42%),
    rgba(23, 25, 29, 0.86);
  box-shadow: var(--shadow);
}

html[data-theme="light"] .watch-hub {
  background:
    linear-gradient(135deg, rgba(49, 126, 151, 0.08), transparent 34%),
    linear-gradient(225deg, rgba(32, 142, 97, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.96);
}

.watch-hub-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.watch-hub-head h2 {
  margin: 0;
  font-size: clamp(1.18rem, 2vw, 1.7rem);
}

.watch-hub-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.watch-hub-card {
  position: relative;
  display: grid;
  grid-template-columns: 36px 74px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  gap: 10px;
  min-height: 132px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 160ms ease, transform 160ms ease;
}

.watch-hub-card:hover {
  border-color: rgba(112, 216, 238, 0.58);
  transform: translateY(-2px);
}

.watch-hub-card.is-loading {
  opacity: 0.82;
}

.watch-hub-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 8px;
  background: rgba(112, 216, 238, 0.12);
  color: var(--cyan);
}

.watch-hub-poster {
  grid-row: 1 / 3;
  grid-column: 2;
  overflow: hidden;
  border-radius: 8px;
  background: #252832;
}

.watch-hub-image,
.watch-hub-poster .image-fallback {
  width: 74px;
  height: 106px;
  object-fit: cover;
}

.watch-hub-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 4px;
}

.watch-hub-eyebrow,
.watch-hub-meta,
.watch-hub-note {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-hub-eyebrow {
  color: var(--cyan);
  font-weight: 850;
  text-transform: uppercase;
}

.watch-hub-copy strong {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.4em;
  font-size: 0.92rem;
  line-height: 1.2;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.watch-hub-note {
  color: var(--soft);
}

.watch-hub-action {
  grid-column: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(245, 184, 75, 0.45);
  border-radius: 7px;
  color: var(--amber);
  font-size: 0.74rem;
  font-weight: 850;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.search-box {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f1012;
}

.search-box:focus-within {
  border-color: rgba(112, 216, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(112, 216, 238, 0.12);
}

.search-box svg {
  color: var(--cyan);
}

i[data-lucide] {
  display: inline-grid;
  width: 1em;
  height: 1em;
  place-items: center;
  font-style: normal;
  line-height: 1;
}

i[data-lucide="search"]::before {
  content: "⌕";
}

i[data-lucide="sparkles"]::before {
  content: "✦";
}

i[data-lucide="refresh-cw"]::before {
  content: "↻";
}

i[data-lucide="heart"]::before {
  content: "♡";
}

i[data-lucide="star"]::before {
  content: "★";
}

i[data-lucide="scan-search"]::before {
  content: "⌕";
}

i[data-lucide="plus"]::before {
  content: "+";
}

i[data-lucide="rotate-ccw"]::before {
  content: "↶";
}

i[data-lucide="play"]::before {
  content: "▶";
}

i[data-lucide="x"]::before {
  content: "×";
}

i[data-lucide="library-big"]::before {
  content: "▣";
}

i[data-lucide="folder-open"]::before {
  content: "▱";
}

i[data-lucide="save"]::before {
  content: "✓";
}

i[data-lucide="video"]::before {
  content: "▶";
}

i[data-lucide="send"]::before {
  content: "➤";
}

i[data-lucide="external-link"]::before {
  content: "↗";
}

i[data-lucide="sun"]::before {
  content: "☀";
}

i[data-lucide="moon"]::before {
  content: "◐";
}

i[data-lucide="trash-2"]::before {
  content: "×";
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: var(--soft);
}

.primary-button,
.secondary-button,
.icon-button,
.segment {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border-color: rgba(245, 184, 75, 0.55);
  background: linear-gradient(135deg, var(--amber), var(--red));
  color: #17120f;
  font-weight: 800;
}

.primary-button.compact,
.secondary-button {
  min-height: 42px;
}

.primary-button.compact {
  padding: 0 14px;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  font-weight: 720;
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid rgba(255, 92, 104, 0.48);
  border-radius: 8px;
  background: rgba(255, 92, 104, 0.1);
  color: var(--red);
  font-weight: 700;
  cursor: pointer;
}

.danger-button:hover {
  background: rgba(255, 92, 104, 0.17);
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover,
.segment:hover {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none !important;
}

.toolbar {
  display: grid;
  grid-template-columns: auto minmax(210px, 1fr) minmax(180px, 220px);
  align-items: center;
  gap: 12px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(180px, 260px) auto;
  align-items: end;
  gap: 12px;
}

.quick-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-filter {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
  color: var(--muted);
  font-weight: 760;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.quick-filter:hover {
  transform: translateY(-1px);
}

.quick-filter.is-active {
  border-color: rgba(112, 216, 238, 0.58);
  background: rgba(112, 216, 238, 0.14);
  color: var(--text);
}

.quick-filter b {
  display: grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.76rem;
}

.reset-filters {
  justify-self: start;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(88px, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.segment {
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
}

.segment.is-active {
  border-color: rgba(98, 213, 164, 0.55);
  background: rgba(98, 213, 164, 0.18);
  color: var(--text);
}

.range-control,
.select-control {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
}

.range-control input {
  width: 100%;
  accent-color: var(--mint);
}

.select-control select,
.select-control .option-search {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
  color: var(--text);
  padding: 0 10px;
}

.select-control .option-search::placeholder {
  color: var(--soft);
}

.filter-search-empty {
  color: var(--amber);
  font-size: 0.75rem;
}

.catalog-load-more {
  display: flex;
  justify-content: center;
  padding-top: 16px;
}

.status-line {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: 18px;
  align-items: start;
}

.anime-column,
.detail-pane {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-size: 1.35rem;
}

.anime-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  align-items: start;
  gap: 14px;
}

.anime-card {
  position: relative;
  min-height: 336px;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.anime-card.is-selected {
  border-color: rgba(112, 216, 238, 0.78);
  box-shadow:
    0 0 0 3px rgba(112, 216, 238, 0.12),
    0 12px 40px rgba(0, 0, 0, 0.24);
}

.anime-select {
  display: grid;
  width: 100%;
  border: 0;
  padding: 0;
  text-align: left;
  background: transparent;
  cursor: pointer;
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(135deg, rgba(112, 216, 238, 0.22), rgba(255, 92, 104, 0.18)),
    #262832;
}

.poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-availability {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 16px);
  min-height: 26px;
  padding: 0 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 7px;
  background: rgba(16, 17, 19, 0.78);
  color: var(--text);
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.card-availability.is-available,
.card-availability.is-ongoing {
  border-color: rgba(98, 213, 164, 0.45);
  color: var(--mint);
}

.card-availability.is-partial,
.card-availability.is-expected {
  border-color: rgba(245, 184, 75, 0.45);
  color: var(--amber);
}

.card-availability.is-unavailable,
.card-availability.is-error {
  border-color: rgba(255, 92, 104, 0.45);
  color: var(--red);
}

.image-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 12px;
  color: var(--text);
  font-weight: 900;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(255, 92, 104, 0.28), rgba(98, 213, 164, 0.2)),
    #23252b;
}

.anime-info {
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 142px;
  padding: 12px 12px 56px;
}

.anime-title {
  display: -webkit-box;
  min-height: 2.44em;
  overflow: hidden;
  color: var(--text);
  font-weight: 850;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.anime-subtitle,
.anime-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.anime-subtitle {
  white-space: nowrap;
}

.anime-meta {
  display: -webkit-box;
  min-height: 2.7em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-actions {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 46px);
  min-height: 34px;
  padding: 0 10px;
  overflow: hidden;
  border: 1px solid rgba(245, 184, 75, 0.38);
  border-radius: 8px;
  background: rgba(16, 17, 19, 0.9);
  color: var(--amber);
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.score-pill.is-missing {
  border-color: var(--line);
  color: var(--muted);
}

.score-pill.is-loading,
.score-pill.is-temporary {
  border-color: rgba(112, 216, 238, 0.34);
  color: var(--cyan);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 auto;
}

.icon-button.mini {
  width: 36px;
  height: 36px;
}

.favorite-toggle,
.character-favorite,
.heart-button {
  pointer-events: auto;
}

.icon-button.is-active {
  border-color: rgba(255, 92, 104, 0.7);
  background: rgba(255, 92, 104, 0.18);
  color: var(--red);
}

.detail-pane {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 25, 29, 0.94);
  box-shadow: var(--shadow);
}

.detail-cover {
  min-height: 210px;
  background:
    linear-gradient(135deg, rgba(182, 151, 255, 0.2), rgba(245, 184, 75, 0.16)),
    #23252b;
  background-position: center;
  background-size: cover;
}

.detail-cover::after {
  content: "";
  display: block;
  min-height: 210px;
  background: linear-gradient(180deg, transparent, rgba(23, 25, 29, 0.95));
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-title-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-title-actions .icon-button {
  width: 36px;
  height: 36px;
}

.resume-hint {
  margin: 9px 0 0;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 700;
}

.status-control {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

.status-control select {
  min-width: 0;
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
  color: var(--text);
  padding: 0 9px;
}

html[data-theme="light"] .status-control select {
  background: #f8f9fb;
}

html[data-theme="light"] .select-control .option-search {
  background: #f8f9fb;
}

.franchise-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.franchise-timeline {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.franchise-timeline-list {
  display: grid;
  max-height: 260px;
  gap: 6px;
  overflow: auto;
}

.franchise-timeline-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.franchise-timeline-item:hover {
  border-color: var(--line-strong);
  background: var(--panel-2);
}

.franchise-timeline-item.is-current {
  border-color: rgba(98, 213, 164, 0.56);
  background: rgba(98, 213, 164, 0.1);
}

.timeline-order {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--cyan);
  font-size: 0.76rem;
  font-weight: 800;
}

.timeline-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.timeline-copy strong,
.timeline-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-copy strong {
  font-size: 0.84rem;
}

.timeline-copy span,
.timeline-status {
  color: var(--muted);
  font-size: 0.74rem;
}

.timeline-status {
  color: var(--mint);
  font-weight: 700;
}

.detail-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--mint);
  font-size: 0.78rem;
  text-transform: uppercase;
}

h2 {
  margin: 0;
  font-size: 1.28rem;
  line-height: 1.2;
}

.detail-original {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.synopsis {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.availability-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.availability-panel strong {
  display: block;
  margin-bottom: 3px;
  font-size: 0.9rem;
}

.availability-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.availability-state {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 0.74rem;
  font-weight: 850;
  white-space: nowrap;
}

.availability-state.is-available,
.availability-state.is-ongoing {
  border-color: rgba(98, 213, 164, 0.42);
  color: var(--mint);
}

.availability-state.is-partial,
.availability-state.is-expected {
  border-color: rgba(245, 184, 75, 0.44);
  color: var(--amber);
}

.availability-state.is-unavailable,
.availability-state.is-error {
  border-color: rgba(255, 92, 104, 0.45);
  color: var(--red);
}

.guide-notes {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.guide-notes[hidden] {
  display: none;
}

.guide-notes p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.rating-strip {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.rating-strip > div {
  display: grid;
  align-content: center;
  gap: 4px;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
}

.metric-sub,
.metric-link {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.25;
}

.metric-link {
  width: fit-content;
  color: var(--cyan);
  font-weight: 750;
  text-decoration: none;
}

.metric-link:hover {
  text-decoration: underline;
}

#detailScore {
  color: var(--amber);
  font-size: 1.18rem;
}

.stars {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.star-button {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--soft);
  cursor: pointer;
}

.star-button.is-active {
  color: var(--amber);
}

.star-button:hover {
  border-color: rgba(245, 184, 75, 0.42);
  color: var(--amber);
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.genre-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(112, 216, 238, 0.32);
  border-radius: 8px;
  color: var(--cyan);
  font-size: 0.8rem;
}

.api-episodes {
  display: grid;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.api-episodes .characters-head {
  margin: 0;
}

.api-episodes .eyebrow {
  margin-bottom: 3px;
}

.api-episode-list {
  display: grid;
  gap: 7px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 3px;
}

.api-episode-card {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.api-episode-number {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(112, 216, 238, 0.35);
  border-radius: 7px;
  color: var(--cyan);
  font-size: 0.8rem;
  font-weight: 850;
}

.api-episode-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.api-episode-copy strong,
.api-episode-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-episode-copy strong {
  font-size: 0.84rem;
}

.api-episode-copy span {
  color: var(--muted);
  font-size: 0.74rem;
}

.api-watch-button {
  min-height: 36px;
  padding: 0 10px;
}

.api-release-link {
  justify-self: start;
  color: var(--text);
  text-decoration: none;
}

.characters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

h3 {
  margin: 0;
  font-size: 1rem;
}

.characters-head span {
  display: grid;
  min-width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.character-grid {
  display: grid;
  gap: 10px;
}

.character-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.character-photo {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  object-fit: cover;
  background: #23252b;
}

.character-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.character-copy strong,
.character-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-copy span {
  color: var(--muted);
  font-size: 0.84rem;
}

.empty-state {
  display: grid;
  min-height: 280px;
  place-items: center;
  align-content: center;
  gap: 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.empty-state svg {
  color: var(--cyan);
}

.content-section {
  display: grid;
  gap: 14px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.content-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.content-heading > div {
  min-width: 0;
}

.content-heading > span {
  max-width: 360px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: right;
}

.ranked-shelf,
.updates-shelf,
.recommendation-shelf,
.library-shelf {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.library-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.collection-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.collection-tab {
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 760;
  cursor: pointer;
}

.collection-tab:hover,
.collection-tab.is-active {
  border-color: rgba(112, 216, 238, 0.42);
  color: var(--text);
}

.library-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
}

.library-tab b {
  display: grid;
  min-width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.78rem;
}

.library-tab.is-active {
  border-color: rgba(98, 213, 164, 0.58);
  background: rgba(98, 213, 164, 0.15);
  color: var(--text);
}

.shelf-reason {
  color: var(--mint) !important;
}

.feature-empty {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 82px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(168px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.calendar-day {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 168px;
  min-height: 160px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.calendar-day.is-today {
  border-color: rgba(245, 184, 75, 0.62);
  box-shadow: inset 0 3px 0 var(--amber);
}

.calendar-day-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
}

.calendar-day-head strong {
  color: var(--text);
}

.calendar-anime {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.calendar-anime strong {
  overflow: hidden;
  font-size: 0.8rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-anime span {
  color: var(--muted);
  font-size: 0.72rem;
}

.calendar-anime .calendar-countdown {
  color: var(--mint);
}

.calendar-empty {
  margin: 0;
  color: var(--soft);
  font-size: 0.78rem;
}

.notification-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.notification-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.notification-card:hover {
  border-color: rgba(112, 216, 238, 0.58);
}

.notification-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: rgba(112, 216, 238, 0.13);
  color: var(--cyan);
}

.notification-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.notification-copy strong,
.notification-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-copy span,
.notification-time {
  color: var(--muted);
  font-size: 0.78rem;
}

.notification-time {
  justify-self: end;
  white-space: nowrap;
}

.history-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.history-item img,
.history-item .image-fallback {
  width: 58px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
}

.history-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.history-copy strong,
.history-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-copy span,
.history-time {
  color: var(--muted);
  font-size: 0.78rem;
}

.history-time {
  white-space: nowrap;
}

.profile-section {
  display: grid;
  gap: 12px;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-import-label {
  cursor: pointer;
}

.shelf-card,
.update-card,
.popular-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
}

.shelf-card {
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.shelf-card:hover,
.update-card:hover,
.popular-item:hover {
  border-color: rgba(112, 216, 238, 0.58);
  transform: translateY(-2px);
}

.shelf-media,
.update-media {
  position: relative;
  overflow: hidden;
  background: #252832;
}

.shelf-media {
  aspect-ratio: 16 / 10;
}

.shelf-media img,
.update-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shelf-media .image-fallback,
.update-media .image-fallback {
  position: absolute;
  inset: 0;
}

.rank-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: rgba(16, 17, 19, 0.9);
  color: var(--amber);
  font-weight: 900;
}

.shelf-copy {
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 11px;
}

.shelf-copy strong,
.update-copy strong,
.popular-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shelf-copy span,
.update-copy span,
.popular-copy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.updates-shelf {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.update-card {
  display: grid;
  grid-template-columns: 94px minmax(0, 1fr);
  min-height: 126px;
  padding: 0;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.update-media {
  min-height: 126px;
}

.update-copy {
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px;
}

.availability-tag {
  justify-self: start;
  min-height: 26px;
  padding: 4px 8px;
  border: 1px solid rgba(98, 213, 164, 0.38);
  border-radius: 7px;
  color: var(--mint) !important;
}

.availability-tag.is-pending {
  border-color: rgba(245, 184, 75, 0.32);
  color: var(--amber) !important;
}

.popular-shelf {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.popular-item {
  display: grid;
  grid-template-columns: 44px 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 76px;
  padding: 8px 12px 8px 8px;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease;
}

.popular-rank {
  color: var(--amber);
  font-size: 1.05rem;
  font-weight: 900;
  text-align: center;
}

.popular-item img,
.popular-item .image-fallback {
  width: 58px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
}

.popular-copy {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.popular-metric {
  color: var(--cyan);
  font-size: 0.84rem;
  font-weight: 800;
  white-space: nowrap;
}

.modal {
  width: min(720px, calc(100% - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}

.modal::backdrop {
  background: rgba(7, 8, 10, 0.82);
  backdrop-filter: blur(5px);
}

.modal-panel {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.modal-header,
.modal-footer,
.source-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-header > div {
  min-width: 0;
}

.modal-footer {
  justify-content: flex-end;
}

.admin-modal {
  width: min(860px, calc(100% - 24px));
}

.admin-preview {
  display: flex;
  min-height: 76px;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-preview img {
  width: 52px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 6px;
  background: var(--panel-2);
  object-fit: cover;
}

.admin-preview img:not([src]),
.admin-preview img[src=""] {
  visibility: hidden;
}

.admin-preview > div {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.admin-preview strong,
.admin-preview span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-preview span {
  color: var(--muted);
  font-size: 0.82rem;
}

.admin-footer {
  justify-content: space-between;
}

.admin-footer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.field.span-2 {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: 0;
  background: #101113;
  color: var(--text);
}

.field input,
.field select {
  min-height: 42px;
  padding: 0 11px;
}

.field textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(112, 216, 238, 0.72);
  box-shadow: 0 0 0 3px rgba(112, 216, 238, 0.1);
}

html[data-theme="light"] .field input,
html[data-theme="light"] .field select,
html[data-theme="light"] .field textarea {
  background: #f8f9fb;
}

.form-note {
  margin: 0;
  color: var(--soft);
  font-size: 0.8rem;
  line-height: 1.5;
}

.player-modal {
  width: min(980px, calc(100% - 24px));
}

.player-stage {
  position: relative;
  display: grid;
  width: 100%;
  aspect-ratio: 16 / 9;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #090a0c;
}

.player-stage video,
.player-stage iframe {
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
}

.player-empty {
  display: grid;
  max-width: 420px;
  place-items: center;
  gap: 8px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.player-empty svg {
  width: 32px;
  height: 32px;
  color: var(--cyan);
}

.player-empty strong {
  color: var(--text);
}

.episode-list {
  display: flex;
  gap: 7px;
  min-height: 38px;
  overflow-x: auto;
}

.playback-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
}

.voiceover-control {
  display: grid;
  flex: 0 1 220px;
  gap: 4px;
  color: var(--muted);
  font-size: 0.75rem;
}

.voiceover-control select {
  min-height: 38px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
  color: var(--text);
  padding: 0 9px;
}

html[data-theme="light"] .voiceover-control select {
  background: #f8f9fb;
}

.playback-status {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.playback-status.is-error {
  color: var(--amber);
}

.source-link {
  flex: 0 0 auto;
  color: var(--text);
  text-decoration: none;
}

.episode-button {
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
  color: var(--muted);
  cursor: pointer;
}

.episode-button.is-active {
  border-color: rgba(98, 213, 164, 0.62);
  background: rgba(98, 213, 164, 0.16);
  color: var(--text);
}

.source-tools {
  display: grid;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.custom-voiceover-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.6fr) minmax(220px, 1.4fr) 42px;
  align-items: end;
  gap: 8px;
}

.custom-voiceover-url {
  min-width: 0;
}

@media (max-width: 680px) {
  .custom-voiceover-row {
    grid-template-columns: 1fr 42px;
  }

  .custom-voiceover-row > :first-child {
    grid-column: 1 / -1;
  }
}

.comments-panel {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.comments-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.comments-head > span {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.comment-list {
  display: grid;
  gap: 8px;
}

.comment-item {
  display: grid;
  gap: 7px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111215;
}

.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.78rem;
}

.comment-meta strong {
  color: var(--mint);
}

.comment-item p {
  margin: 0;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}

.comments-empty {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.source-links textarea {
  min-height: 72px;
}

.file-button {
  position: relative;
  overflow: hidden;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1040px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .watch-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-pane {
    position: static;
    max-height: none;
  }

  .detail-cover,
  .detail-cover::after {
    min-height: 250px;
  }

  .ranked-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .recommendation-shelf,
  .library-shelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .updates-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 20px, 1480px);
    padding-top: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
  }

  .quick-stats {
    justify-content: flex-start;
    width: 100%;
  }

  .search-form,
  .toolbar,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .segmented {
    grid-template-columns: 1fr;
  }

  .primary-button {
    width: 100%;
  }

  .primary-button.compact,
  .secondary-button {
    width: auto;
  }

  .reset-filters {
    width: 100%;
  }

  .quick-filter-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-filter {
    justify-content: space-between;
    width: 100%;
  }

  .content-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .content-heading > span {
    max-width: none;
    text-align: left;
  }

  .ranked-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .popular-shelf {
    grid-template-columns: 1fr;
  }

  .library-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .notification-list,
  .history-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .anime-grid {
    grid-template-columns: 1fr;
  }

  .rating-strip {
    grid-template-columns: 1fr;
  }

  .character-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
  }

  .character-photo {
    width: 52px;
    height: 52px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .field.span-2 {
    grid-column: auto;
  }

  .source-actions,
  .modal-footer,
  .comment-form {
    align-items: stretch;
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .playback-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .source-link {
    width: 100%;
  }

  .quick-filter-row {
    grid-template-columns: 1fr;
  }

  .notification-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .notification-time {
    grid-column: 2;
    justify-self: start;
  }

  .source-actions .secondary-button,
  .source-actions .primary-button,
  .modal-footer .secondary-button,
  .modal-footer .primary-button {
    width: 100%;
  }

  .admin-footer-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .admin-footer .danger-button {
    width: 100%;
  }

  .franchise-timeline-item {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .timeline-status {
    grid-column: 2;
  }

  .ranked-shelf,
  .updates-shelf,
  .recommendation-shelf,
  .library-shelf {
    grid-template-columns: 1fr;
  }

  .shelf-card {
    grid-template-columns: 108px minmax(0, 1fr);
    grid-template-rows: none;
    min-height: 118px;
  }

  .shelf-media {
    height: 100%;
    aspect-ratio: auto;
  }

  .shelf-copy {
    align-content: center;
  }

  .popular-item {
    grid-template-columns: 36px 52px minmax(0, 1fr);
  }

  .api-episode-card {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .api-watch-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .popular-item img,
  .popular-item .image-fallback {
    width: 52px;
    height: 52px;
  }

  .popular-metric {
    grid-column: 3;
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 16px, 1480px);
    padding: 8px 0 24px;
  }

  .topbar {
    display: grid;
    min-height: 0;
    align-items: center;
    gap: 8px;
  }

  .topbar-actions {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) repeat(3, 38px);
    align-items: center;
    gap: 6px;
  }

  .quick-stats {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
  }

  .quick-stats span {
    min-height: 32px;
    justify-content: center;
    padding: 0 5px;
    font-size: 0.72rem;
  }

  .topbar-actions > .icon-button,
  .topbar-actions > .secondary-button {
    width: 38px;
    min-height: 38px;
    height: 38px;
    padding: 0;
  }

  .topbar-actions > .secondary-button span {
    display: none;
  }

  .search-band {
    gap: 10px;
    margin: 8px 0 14px;
    padding: 12px;
  }

  .watch-hub {
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px;
  }

  .watch-hub-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .watch-hub-head .secondary-button {
    min-height: 36px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .segmented {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .reset-filters {
    grid-column: 1 / -1;
    width: 100%;
  }

  .workspace {
    gap: 12px;
  }

  .detail-cover,
  .detail-cover::after {
    min-height: 180px;
  }

  .content-section {
    gap: 11px;
    margin-top: 24px;
    padding-top: 18px;
  }

  .content-heading {
    gap: 4px;
  }
}

@media (max-width: 540px) {
  .shell {
    width: calc(100% - 12px);
    padding-top: 6px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 0.96rem;
  }

  .brand-copy small {
    font-size: 0.65rem;
  }

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) repeat(3, 36px);
  }

  .topbar-actions > .icon-button,
  .topbar-actions > .secondary-button {
    width: 36px;
    min-height: 36px;
    height: 36px;
  }

  .quick-stats span {
    min-height: 30px;
    font-size: 0.66rem;
  }

  .search-band {
    gap: 8px;
    padding: 9px;
  }

  .watch-hub {
    gap: 8px;
    padding: 9px;
  }

  .watch-hub-head h2 {
    font-size: 1.05rem;
  }

  .watch-hub-head .secondary-button {
    width: 100%;
    min-height: 34px;
    font-size: 0.76rem;
  }

  .watch-hub-grid {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .watch-hub-card {
    grid-template-columns: 30px 58px minmax(0, 1fr);
    min-height: 88px;
    gap: 8px;
    padding: 7px;
  }

  .watch-hub-icon {
    width: 30px;
    height: 30px;
  }

  .watch-hub-image,
  .watch-hub-poster .image-fallback {
    width: 58px;
    height: 76px;
  }

  .watch-hub-copy {
    gap: 3px;
  }

  .watch-hub-copy strong {
    min-height: 2.3em;
    font-size: 0.8rem;
  }

  .watch-hub-eyebrow,
  .watch-hub-meta,
  .watch-hub-note,
  .watch-hub-action {
    font-size: 0.68rem;
  }

  .watch-hub-action {
    min-height: 24px;
    padding: 0 7px;
  }

  .search-form .primary-button {
    width: 40px;
    min-height: 40px;
    padding: 0;
  }

  .search-form .primary-button span {
    display: none;
  }

  .search-box {
    min-height: 40px;
    padding: 0 10px;
  }

  .search-box input {
    font-size: 0.84rem;
  }

  .toolbar,
  .filter-row {
    gap: 7px;
  }

  .segmented {
    padding: 3px;
  }

  .segment {
    min-width: 0;
    min-height: 34px;
    padding: 0 5px;
    font-size: 0.74rem;
  }

  .range-control,
  .select-control {
    gap: 5px;
    font-size: 0.72rem;
  }

  .select-control select,
  .select-control .option-search {
    min-height: 34px;
    padding: 0 7px;
    font-size: 0.76rem;
  }

  .filter-row .option-search {
    display: none;
  }

  .status-line {
    min-height: 16px;
    font-size: 0.76rem;
  }

  .section-heading {
    margin-bottom: 8px;
  }

  .section-heading h1 {
    font-size: 1.05rem;
  }

  .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .anime-card {
    min-height: 0;
    border-radius: 7px;
  }

  .card-availability {
    top: 6px;
    left: 6px;
    max-width: calc(100% - 12px);
    min-height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    font-size: 0.64rem;
  }

  .poster-wrap {
    aspect-ratio: 3 / 4;
  }

  .anime-info {
    gap: 3px;
    min-height: 112px;
    padding: 8px 8px 45px;
  }

  .anime-title {
    min-height: 2.4em;
    font-size: 0.8rem;
    line-height: 1.2;
  }

  .anime-subtitle,
  .anime-meta {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .anime-meta {
    min-height: 2.5em;
  }

  .card-actions {
    right: 6px;
    bottom: 6px;
    left: 6px;
    gap: 4px;
  }

  .score-pill {
    min-height: 29px;
    padding: 0 7px;
    border-radius: 7px;
    font-size: 0.75rem;
  }

  .card-actions .icon-button.mini {
    width: 30px;
    height: 30px;
  }

  .catalog-load-more {
    padding-top: 10px;
  }

  .catalog-load-more .secondary-button {
    min-height: 36px;
    font-size: 0.78rem;
  }

  .detail-cover,
  .detail-cover::after {
    min-height: 145px;
  }

  .detail-body {
    gap: 10px;
    padding: 11px;
  }

  .detail-title-row h2 {
    font-size: 1.05rem;
  }

  .detail-title-actions {
    gap: 4px;
  }

  .detail-title-actions .icon-button {
    width: 32px;
    height: 32px;
  }

  .synopsis {
    font-size: 0.82rem;
    line-height: 1.45;
    -webkit-line-clamp: 4;
  }

  .detail-original,
  .availability-panel p,
  .guide-notes p {
    font-size: 0.74rem;
  }

  .availability-panel {
    grid-template-columns: minmax(0, 1fr);
    gap: 7px;
    padding: 9px;
  }

  .availability-state {
    width: fit-content;
    min-height: 25px;
    padding: 0 7px;
    font-size: 0.68rem;
  }

  .guide-notes {
    padding: 9px;
  }

  .collection-tabs {
    gap: 6px;
    margin-bottom: 9px;
  }

  .collection-tab {
    min-height: 32px;
    padding: 0 8px;
    font-size: 0.72rem;
  }

  .detail-actions {
    gap: 7px;
  }

  .detail-actions .primary-button,
  .status-control select {
    min-height: 38px;
    font-size: 0.78rem;
  }

  .franchise-label,
  .resume-hint {
    font-size: 0.74rem;
  }

  .rating-strip {
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 8px;
    padding: 9px;
  }

  .star-button {
    width: 24px;
    height: 24px;
  }

  .genre-list {
    gap: 5px;
  }

  .genre-chip {
    min-height: 24px;
    padding: 0 7px;
    font-size: 0.7rem;
  }

  .api-episodes {
    gap: 7px;
    padding-top: 10px;
  }

  .api-episode-card {
    gap: 7px;
    padding: 7px;
  }

  .character-grid {
    gap: 7px;
  }

  .character-card {
    min-height: 64px;
    gap: 8px;
    padding: 7px;
  }

  .character-photo {
    width: 46px;
    height: 46px;
  }

  .content-section {
    gap: 9px;
    margin-top: 20px;
    padding-top: 14px;
  }

  .content-heading h2 {
    font-size: 1.05rem;
  }

  .content-heading > span {
    display: none;
  }

  .library-tabs {
    gap: 5px;
  }

  .library-tab {
    min-height: 36px;
    gap: 5px;
    padding: 0 7px;
    font-size: 0.72rem;
  }

  .library-tab b {
    min-width: 21px;
    height: 21px;
    font-size: 0.68rem;
  }

  .shelf-card {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 96px;
  }

  .shelf-copy {
    gap: 4px;
    padding: 9px;
  }

  .shelf-copy strong,
  .update-copy strong,
  .popular-copy strong,
  .history-copy strong {
    font-size: 0.8rem;
  }

  .update-card {
    grid-template-columns: 72px minmax(0, 1fr);
    min-height: 100px;
  }

  .update-copy {
    gap: 5px;
    padding: 9px;
  }

  .history-item {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    min-height: 64px;
    gap: 8px;
    padding: 7px;
  }

  .history-image,
  .history-item .image-fallback {
    width: 48px;
    height: 48px;
  }

  .popular-item {
    gap: 7px;
    min-height: 64px;
    padding: 7px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 148px);
    gap: 7px;
  }

  .calendar-day {
    min-height: 150px;
    padding: 9px;
  }

  .modal {
    width: calc(100% - 10px);
    max-height: calc(100vh - 10px);
  }

  .modal-panel {
    gap: 12px;
    padding: 12px;
  }

  .field {
    gap: 5px;
    font-size: 0.75rem;
  }

  .field input,
  .field select {
    min-height: 38px;
  }

  .field textarea {
    min-height: 72px;
  }
}

@media (max-width: 340px) {
  .topbar-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-stats {
    grid-column: 1 / -1;
  }

  .topbar-actions > .icon-button,
  .topbar-actions > .secondary-button {
    width: 100%;
  }

  .anime-grid {
    grid-template-columns: 1fr;
  }

  .anime-card {
    min-height: 154px;
  }

  .anime-select {
    grid-template-columns: 106px minmax(0, 1fr);
  }

  .poster-wrap {
    width: 106px;
    height: 154px;
    aspect-ratio: auto;
  }

  .anime-info {
    min-height: 154px;
  }

  .rating-strip {
    grid-template-columns: 1fr;
  }
}

/* Taytlo premium streaming skin */
:root {
  --bg: #090d12;
  --panel: rgba(17, 23, 31, 0.92);
  --panel-2: rgba(25, 33, 43, 0.92);
  --line: rgba(159, 174, 195, 0.16);
  --text: #f7f9fc;
  --muted: #b7c0ce;
  --soft: #747f90;
  --red: #ff5367;
  --mint: #65dbc0;
  --amber: #ffb73e;
  --cyan: #64d8ff;
  --violet: #b89cff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

html {
  background:
    linear-gradient(180deg, #0c1118 0%, #090d12 42%, #07090d 100%),
    #090d12;
}

body {
  background:
    linear-gradient(115deg, rgba(100, 216, 255, 0.08), transparent 34rem),
    linear-gradient(245deg, rgba(255, 183, 62, 0.075), transparent 30rem),
    transparent;
}

html[data-theme="light"] {
  --bg: #f3f6fa;
  --panel: rgba(255, 255, 255, 0.95);
  --panel-2: rgba(244, 247, 251, 0.96);
  --line: rgba(32, 43, 57, 0.13);
  --text: #151b24;
  --muted: #596578;
  --soft: #8c95a3;
  background: #f3f6fa;
}

html[data-theme="light"] body {
  background:
    linear-gradient(135deg, rgba(35, 150, 176, 0.08), transparent 34rem),
    linear-gradient(245deg, rgba(255, 183, 62, 0.09), transparent 30rem),
    #f3f6fa;
}

.shell {
  width: min(1540px, calc(100% - 28px));
  padding: 14px 0 34px;
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 20;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 13, 18, 0.82);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .topbar {
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 18px 46px rgba(26, 38, 52, 0.11);
}

.brand-mark {
  border-color: rgba(255, 183, 62, 0.38);
  background:
    linear-gradient(135deg, #ffb73e, #ff5367 54%, #64d8ff);
  color: #081016;
  box-shadow: 0 12px 34px rgba(255, 183, 62, 0.18);
}

.brand-copy strong {
  color: var(--text);
  font-size: 1.14rem;
}

.brand-copy small {
  color: var(--amber);
  font-weight: 800;
  letter-spacing: 0;
}

.topbar-actions {
  gap: 8px;
}

.quick-stats {
  gap: 6px;
}

.quick-stats span {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.055);
}

html[data-theme="light"] .quick-stats span {
  border-color: rgba(21, 27, 36, 0.12);
  background: #151b24;
}

.icon-button,
.secondary-button,
.primary-button,
.danger-button {
  border-radius: 8px;
}

.primary-button {
  border: 1px solid rgba(255, 183, 62, 0.45);
  background: linear-gradient(135deg, #ffbd4f, #ff8e3d);
  color: #130d07;
  box-shadow: 0 14px 30px rgba(255, 183, 62, 0.18);
}

.secondary-button,
.icon-button {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.secondary-button:hover,
.icon-button:hover {
  border-color: rgba(100, 216, 255, 0.5);
  background: rgba(100, 216, 255, 0.11);
}

.search-band {
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.3fr);
  align-items: start;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 12px;
  border-color: var(--line);
  background: rgba(12, 17, 24, 0.78);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .search-band {
  background: rgba(255, 255, 255, 0.92);
}

.search-form {
  grid-template-columns: minmax(0, 1fr) 118px;
}

.search-box {
  min-height: 48px;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.055);
}

.search-box input::placeholder {
  color: var(--soft);
}

.toolbar {
  grid-template-columns: minmax(0, 1.15fr) minmax(180px, 0.85fr) minmax(190px, 0.85fr);
  gap: 10px;
}

.filter-row {
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(180px, 1fr)) auto;
  gap: 10px;
}

.quick-filter-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.search-band > .status-line {
  grid-column: 1 / -1;
}

.segmented,
.select-control select,
.select-control .option-search,
.range-control,
.quick-filter,
.field input,
.field select,
.field textarea {
  border-color: var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.segment {
  border-radius: 7px;
}

.segment.is-active,
.quick-filter.is-active {
  background: rgba(255, 183, 62, 0.16);
  color: var(--amber);
}

.quick-filter {
  min-height: 42px;
  justify-content: space-between;
}

.quick-filter b {
  background: rgba(100, 216, 255, 0.13);
  color: var(--cyan);
}

.watch-hub {
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border-color: var(--line);
  background:
    linear-gradient(115deg, rgba(255, 183, 62, 0.12), transparent 42%),
    linear-gradient(245deg, rgba(100, 216, 255, 0.11), transparent 44%),
    rgba(12, 17, 24, 0.88);
  backdrop-filter: blur(18px);
}

html[data-theme="light"] .watch-hub {
  background:
    linear-gradient(115deg, rgba(255, 183, 62, 0.12), transparent 42%),
    linear-gradient(245deg, rgba(35, 150, 176, 0.09), transparent 44%),
    rgba(255, 255, 255, 0.96);
}

.watch-hub-head h2 {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
}

.watch-hub-grid {
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
}

.watch-hub-card {
  min-height: 134px;
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(14, 20, 28, 0.94);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

html[data-theme="light"] .watch-hub-card {
  background: #ffffff;
}

.watch-hub-card:first-child {
  grid-row: span 2;
  grid-template-columns: 116px minmax(0, 1fr);
  min-height: 280px;
  padding: 14px;
}

.watch-hub-card:first-child .watch-hub-icon {
  position: absolute;
  top: 14px;
  right: 14px;
}

.watch-hub-card:first-child .watch-hub-poster {
  grid-row: 1 / 3;
  grid-column: 1;
}

.watch-hub-card:first-child .watch-hub-image,
.watch-hub-card:first-child .watch-hub-poster .image-fallback {
  width: 116px;
  height: 206px;
}

.watch-hub-card:first-child .watch-hub-copy {
  grid-column: 2;
  align-content: center;
  padding-right: 38px;
}

.watch-hub-card:first-child .watch-hub-copy strong {
  font-size: 1.34rem;
}

.watch-hub-card:first-child .watch-hub-action {
  grid-column: 2;
  min-height: 34px;
  padding: 0 13px;
}

.watch-hub-icon {
  background: rgba(255, 183, 62, 0.13);
  color: var(--amber);
}

.watch-hub-poster {
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.watch-hub-eyebrow {
  color: var(--amber);
}

.watch-hub-action {
  border-color: rgba(100, 216, 255, 0.35);
  background: rgba(100, 216, 255, 0.08);
  color: var(--cyan);
}

.workspace {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
  gap: 14px;
}

.section-heading {
  min-height: 48px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.section-heading h1,
.content-heading h2 {
  color: var(--text);
}

.anime-grid {
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 12px;
}

.anime-card,
.detail-pane,
.content-section,
.modal-panel,
.player-panel {
  border-color: var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent),
    rgba(13, 18, 25, 0.92);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

html[data-theme="light"] :is(.anime-card, .detail-pane, .content-section, .modal-panel, .player-panel) {
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(24, 37, 52, 0.1);
}

.anime-card {
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.anime-card:hover,
.anime-card.is-selected {
  border-color: rgba(255, 183, 62, 0.54);
  transform: translateY(-3px);
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.32);
}

.poster-wrap {
  background: #121923;
}

.poster {
  filter: saturate(1.04) contrast(1.02);
}

.anime-info {
  min-height: 126px;
  padding: 10px 10px 50px;
}

.anime-title {
  font-size: 0.95rem;
  line-height: 1.22;
}

.anime-subtitle,
.anime-meta {
  color: var(--muted);
}

.score-pill {
  border-color: rgba(255, 183, 62, 0.45);
  background: rgba(255, 183, 62, 0.1);
  color: var(--amber);
}

.card-actions .icon-button.mini {
  background: rgba(255, 255, 255, 0.075);
}

.detail-pane {
  top: 92px;
  border-radius: 8px;
}

.detail-cover {
  min-height: 300px;
}

.detail-cover::after {
  background:
    linear-gradient(180deg, transparent, rgba(9, 13, 18, 0.18) 46%, rgba(9, 13, 18, 0.95)),
    linear-gradient(90deg, rgba(9, 13, 18, 0.65), transparent 45%);
}

.detail-body {
  padding: 16px;
}

.availability-panel,
.rating-strip,
.guide-notes,
.api-episode-card,
.character-card,
.notification-card,
.history-item,
.calendar-day,
.shelf-card,
.update-card,
.popular-item,
.library-tab,
.collection-tab {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.055);
}

html[data-theme="light"] :is(
  .availability-panel,
  .rating-strip,
  .guide-notes,
  .api-episode-card,
  .character-card,
  .notification-card,
  .history-item,
  .calendar-day,
  .shelf-card,
  .update-card,
  .popular-item,
  .library-tab,
  .collection-tab
) {
  background: #f8fafc;
}

.content-section {
  margin-top: 26px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.content-section + .content-section {
  margin-top: 16px;
}

.ranked-shelf,
.recommendation-shelf,
.library-shelf {
  gap: 10px;
}

.shelf-card,
.update-card,
.popular-item,
.notification-card,
.history-item,
.calendar-day,
.calendar-anime {
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.shelf-card:hover,
.update-card:hover,
.popular-item:hover,
.notification-card:hover,
.history-item:hover,
.calendar-anime:hover {
  border-color: rgba(100, 216, 255, 0.5);
  background: rgba(100, 216, 255, 0.08);
}

.calendar-grid {
  grid-template-columns: repeat(7, minmax(156px, 1fr));
}

.calendar-day.is-today {
  border-color: rgba(255, 183, 62, 0.66);
  box-shadow: inset 0 3px 0 var(--amber);
}

.calendar-anime .calendar-countdown,
.shelf-reason {
  color: var(--cyan) !important;
}

.popular-rank,
.rank-badge {
  background: rgba(255, 183, 62, 0.16);
  color: var(--amber);
}

.catalog-load-more .secondary-button {
  min-width: min(100%, 320px);
  justify-content: center;
}

@media (min-width: 1180px) {
  .anime-grid {
    grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  }
}

@media (max-width: 1040px) {
  .search-band {
    grid-template-columns: 1fr;
  }

  .watch-hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .watch-hub-card:first-child {
    grid-column: 1 / -1;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .detail-pane {
    top: auto;
  }
}

@media (max-width: 820px) {
  body {
    background:
      linear-gradient(180deg, rgba(100, 216, 255, 0.08), transparent 24rem),
      #090d12;
  }

  .shell {
    width: min(100% - 14px, 1480px);
    padding: 8px 0 86px;
  }

  .topbar {
    top: 6px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 8px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .topbar-actions {
    grid-template-columns: minmax(0, 1fr) repeat(4, 38px);
  }

  .launch-banner {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 12px;
    padding: 10px;
  }

  .launch-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .launch-actions .primary-button,
  .launch-actions .secondary-button {
    justify-content: center;
    width: 100%;
  }

  .quick-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .quick-stats span {
    min-height: 30px;
    font-size: 0.68rem;
  }

  .search-band {
    gap: 8px;
    padding: 9px;
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 42px;
  }

  .search-form .primary-button {
    width: 42px;
    min-height: 42px;
    padding: 0;
  }

  .search-form .primary-button span {
    display: none;
  }

  .search-box {
    min-height: 42px;
  }

  .toolbar,
  .filter-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented {
    grid-column: 1 / -1;
  }

  .reset-filters {
    grid-column: 1 / -1;
  }

  .quick-filter-row {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 3px;
    scrollbar-width: none;
  }

  .quick-filter-row::-webkit-scrollbar {
    display: none;
  }

  .quick-filter {
    flex: 0 0 auto;
    min-width: 136px;
  }

  .watch-hub {
    padding: 10px;
  }

  .watch-hub-head {
    display: grid;
    gap: 8px;
  }

  .watch-hub-head .secondary-button {
    width: 100%;
  }

  .watch-hub-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .watch-hub-card,
  .watch-hub-card:first-child {
    grid-column: auto;
    grid-row: auto;
    grid-template-columns: 34px 88px minmax(0, 1fr);
    min-height: 108px;
    padding: 8px;
  }

  .watch-hub-card:first-child .watch-hub-icon {
    position: static;
  }

  .watch-hub-card:first-child .watch-hub-poster,
  .watch-hub-poster {
    grid-row: 1 / 3;
    grid-column: 2;
  }

  .watch-hub-card:first-child .watch-hub-image,
  .watch-hub-card:first-child .watch-hub-poster .image-fallback,
  .watch-hub-image,
  .watch-hub-poster .image-fallback {
    width: 88px;
    height: 92px;
  }

  .watch-hub-card:first-child .watch-hub-copy,
  .watch-hub-copy {
    grid-column: 3;
    padding-right: 0;
  }

  .watch-hub-card:first-child .watch-hub-copy strong,
  .watch-hub-copy strong {
    min-height: auto;
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
  }

  .watch-hub-card:first-child .watch-hub-action,
  .watch-hub-action {
    grid-column: 3;
    min-height: 28px;
  }

  .anime-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .content-section {
    padding: 12px;
  }

  .calendar-grid {
    grid-template-columns: repeat(7, 146px);
  }
}

@media (max-width: 540px) {
  .shell {
    width: calc(100% - 12px);
  }

  .brand-copy small {
    display: none;
  }

  .launch-copy {
    align-items: flex-start;
  }

  .launch-badge {
    min-width: 44px;
    height: 30px;
    font-size: 0.72rem;
  }

  .launch-copy p {
    font-size: 0.78rem;
  }

  .search-band {
    margin-top: 8px;
  }

  .toolbar,
  .filter-row {
    gap: 7px;
  }

  .range-control,
  .select-control {
    font-size: 0.72rem;
  }

  .watch-hub-head h2,
  .section-heading h1,
  .content-heading h2 {
    font-size: 1.05rem;
  }

  .watch-hub-card,
  .watch-hub-card:first-child {
    grid-template-columns: 30px 78px minmax(0, 1fr);
  }

  .watch-hub-card:first-child .watch-hub-image,
  .watch-hub-card:first-child .watch-hub-poster .image-fallback,
  .watch-hub-image,
  .watch-hub-poster .image-fallback {
    width: 78px;
    height: 86px;
  }

  .anime-info {
    min-height: 108px;
    padding: 8px 8px 44px;
  }

  .anime-title {
    min-height: 2.35em;
    font-size: 0.78rem;
  }

  .anime-subtitle,
  .anime-meta {
    font-size: 0.67rem;
  }

  .detail-cover,
  .detail-cover::after {
    min-height: 158px;
  }

  .detail-body {
    padding: 12px;
  }

  .ranked-shelf,
  .updates-shelf,
  .recommendation-shelf,
  .library-shelf {
    grid-template-columns: 1fr;
  }

  .shelf-card {
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 98px;
  }

  .update-card {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .history-item {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .history-time {
    grid-column: 2;
  }
}

@media (max-width: 340px) {
  .anime-grid {
    grid-template-columns: 1fr;
  }

  .anime-select {
    grid-template-columns: 104px minmax(0, 1fr);
  }
}

/* Mobile action layout fixes */
.api-episode-card {
  overflow: visible;
}

.api-watch-button {
  display: inline-flex;
  justify-self: end;
  align-self: center;
  min-width: 96px;
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.timeline-status {
  justify-self: end;
  min-width: 64px;
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(100, 216, 255, 0.28);
  border-radius: 8px;
  background: rgba(100, 216, 255, 0.08);
  color: var(--cyan);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.franchise-timeline-item.is-current .timeline-status {
  border-color: rgba(101, 219, 192, 0.42);
  background: rgba(101, 219, 192, 0.1);
  color: var(--mint);
}

@media (max-width: 620px) {
  .api-episode-list {
    max-height: min(58vh, 430px);
    padding-right: 0;
  }

  .api-episode-card {
    grid-template-columns: 40px minmax(0, 1fr) minmax(88px, auto);
    gap: 7px;
    min-height: 56px;
    padding: 7px;
  }

  .api-episode-number {
    width: 38px;
    height: 38px;
  }

  .api-watch-button {
    grid-column: auto;
    width: auto;
    min-width: 88px;
    min-height: 38px;
    padding: 0 9px;
    font-size: 0.74rem;
  }

  .franchise-timeline-item {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 7px;
    min-height: 52px;
  }

  .timeline-status {
    grid-column: auto;
    min-width: 58px;
    padding: 0 7px;
    font-size: 0.68rem;
  }
}

@media (max-width: 360px) {
  .api-episode-card {
    grid-template-columns: 38px minmax(0, 1fr) 40px;
  }

  .api-watch-button {
    width: 40px;
    min-width: 40px;
    padding: 0;
  }

  .api-watch-button span {
    display: none;
  }

  .franchise-timeline-item {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .timeline-status {
    grid-column: 2;
    justify-self: start;
    margin-top: 2px;
  }
}

/* Mobile topbar stats overflow fix */
.quick-stats span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-stats b {
  flex: 0 0 auto;
}

@media (max-width: 620px) {
  .topbar-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .quick-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .quick-stats span {
    justify-content: center;
    min-height: 32px;
    padding: 0 6px;
    font-size: 0.68rem;
  }

  .topbar-actions > .icon-button,
  .topbar-actions > .secondary-button {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 360px) {
  .quick-stats span {
    gap: 3px;
    padding: 0 4px;
    font-size: 0.62rem;
  }
}

/* Poster layout fix for public launch */
.poster-wrap,
.shelf-media,
.update-media,
.watch-hub-poster {
  background:
    radial-gradient(circle at 50% 24%, rgba(100, 216, 255, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), transparent),
    #101722;
}

.poster,
.shelf-media img,
.update-media img,
.watch-hub-image,
.popular-item img,
.admin-preview img {
  object-fit: cover !important;
  object-position: center;
  padding: 0;
}

.detail-cover {
  position: relative;
  overflow: hidden;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: cover !important;
  background-color: #101722;
}

.detail-cover::after {
  position: absolute;
  inset: 0;
  min-height: 0 !important;
  pointer-events: none;
}
