:root {
  --bg: #f2f3f4;
  --panel: #ffffff;
  --panel-2: #f7f8fa;
  --text: #111318;
  --muted: #5a6472;
  --brand: #ff7828;
  --danger: #b2322b;
  --border: #d8dde3;
  --btn-bg: #0f172a;
  --btn-fg: #ffffff;
  --btn-hover: #ff7828;
  --focus: #ff7828;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    16px/1.5 Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a:hover {
  text-decoration: none;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
strong {
  font-weight: 700;
}

.wrap {
  width: min(1240px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 14px 0;
}

.header-left {
  justify-self: start;
}

.header-right {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: block;
  justify-self: center;
  width: min(640px, 78vw);
  height: 96px;
  overflow: visible;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
}

.menu-btn {
  position: fixed;
  top: calc(0.75em + env(safe-area-inset-top));
  left: calc(0.75em + env(safe-area-inset-left));
  z-index: 1200;

  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid #d8dde3;
  background: #0f172a;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  background: #ff7828;
}

.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 1200;
}

.menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(300px, 85vw);
  background: var(--bg);
  border-right: 1px solid var(--border);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  z-index: 1300;
  padding: 14px;
  transform: translateX(-105%);
  transition: transform 0.18s ease;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}

.menu-panel.open {
  transform: translateX(0);
}

.menu-title {
  margin: 2px 0 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-title-img {
  display: block;
  height: 40px;
  width: auto;
  max-width: 100%;
}

.menu-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.menu-user-block {
  padding: 2px 0;
  display: grid;
  gap: 10px;
}

.menu-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel);
}

.user-pill {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.92rem;
}

.menu-user-pill {
  width: 100%;
  justify-content: flex-start;
  min-height: 44px;
  border-radius: 12px;
}

.menu-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: none;
  font-size: 16px;
  font-weight: 700;
  transition:
    transform 0.06s ease,
    opacity 0.15s ease,
    background 0.15s ease;
}

.menu-link:hover {
  color: var(--btn-fg);
  background: var(--btn-hover);
  transform: translateY(-1px);
}

.menu-link.is-active {
  color: var(--btn-fg);
  background: var(--btn-hover);
}

.menu-link-button {
  text-align: center;
  cursor: pointer;
  font: inherit;
}

.menu-link-danger {
  color: var(--btn-fg);
}

.menu-link-danger:hover {
  color: var(--btn-fg);
  background: var(--btn-hover);
}

.menu-divider {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.menu-spacer {
  flex: 1;
}

main.wrap {
  flex: 1 0 auto;
  padding: 28px 0 44px;
}

.flash {
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid transparent;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    margin 0.28s ease,
    padding 0.28s ease;
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}

.flash-success {
  background: rgba(62, 155, 98, 0.12);
  border-color: rgba(62, 155, 98, 0.28);
  color: #1e5b39;
}

.flash-error {
  background: rgba(178, 50, 43, 0.12);
  border-color: rgba(178, 50, 43, 0.28);
  color: #7a241f;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 24px;
}

.hero-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.hero h1,
.show-meta h1,
.card h1 {
  margin: 0 0 8px;
}
.hero p,
.muted,
.show-meta p {
  color: var(--muted);
}
.hero > div:first-child {
  max-width: 760px;
}

.shows-hero {
  align-items: center;
}

.shows-search-wrap {
  flex: 1 1 auto;
  width: 100%;
  max-width: 560px;
}

.shows-search-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}

.show-card.is-hidden-by-filter {
  display: none;
}

.home-user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
}

.home-avatar {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel);
  flex: 0 0 auto;
}

.home-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--muted);
}

.home-user-greeting {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.home-insights {
  margin: 4px 0 18px;
  max-width: 640px;
}

.home-insight-static,
.home-rotator-item {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.home-insight-static strong,
.home-insight-value {
  color: var(--text);
  font-weight: 700;
}

.home-insight-key {
  margin-right: 6px;
  color: var(--muted);
}

.home-rotator {
  position: relative;
  min-height: 3.4rem;
}

.home-rotator-frame {
  display: grid;
  gap: 8px;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 0.42s ease,
    transform 0.42s ease;
}

.home-rotator-frame.is-fading {
  opacity: 0;
  transform: translateY(5px);
}

.home-rotator-item {
  margin: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.show-grid {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.shows-groups {
  display: grid;
  gap: 16px;
}

.shows-group {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  overflow: hidden;
}

.shows-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 8px 10px;
  font-weight: 700;
}

.shows-group summary::-webkit-details-marker {
  display: none;
}

.shows-group summary::after {
  content: "▾";
  color: var(--muted);
  transition: transform 0.2s ease;
}

.shows-group[open] summary::after {
  transform: rotate(180deg);
}

.shows-group-title {
  font-size: 1.02rem;
}

.shows-group-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  margin-left: auto;
  margin-right: 10px;
  white-space: nowrap;
}

.shows-group .show-grid {
  padding: 4px;
}

.shows-group-empty {
  margin: 2px 8px 10px;
  grid-column: 1 / -1;
}

.shows-group-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.show-card {
  display: flex;
  padding: 0;
  overflow: hidden;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.show-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 120, 40, 0.35);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.12);
}

.show-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
}

.poster-frame {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #f7f8fa, #e9edf1);
}

.poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  height: auto;
  object-fit: cover;
  object-position: center top;
  display: block;
  background: #e9edf1;
  transition: transform 0.35s ease;
}

.show-card .poster {
  border-bottom: 1px solid var(--border);
}
.show-card:hover .poster {
  transform: scale(1.025);
}

.poster-sheen {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.18),
    transparent 30%,
    rgba(0, 0, 0, 0.03)
  );
  pointer-events: none;
}

.poster.large {
  width: 220px;
  min-width: 220px;
  height: 320px;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.poster-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  background: var(--panel-2);
}

.card-body {
  padding: 18px;
  display: grid;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.show-card-header {
  display: grid;
  gap: 8px;
  justify-items: start;
  min-width: 0;
}

.show-title {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.3;
  min-width: 0;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.show-complete {
  flex: 0 0 auto;
  align-self: flex-start;
  color: var(--text);
  background: rgba(255, 120, 40, 0.12);
  border: 1px solid rgba(255, 120, 40, 0.22);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.show-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.show-metric {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1.2;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

.show-metric strong {
  color: var(--text);
  font-weight: 700;
}
.show-progress {
  margin: 2px 0 0;
}

.show-summary-line {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.45;
}

.progress {
  width: 100%;
  height: 12px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  margin: 12px 0 8px;
}

.progress-bar {
  height: 100%;
  background: var(--brand);
}

.btn {
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: none;
  border-radius: 12px;
  padding: 8px 12px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  min-height: 44px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    transform 0.06s ease,
    opacity 0.15s ease,
    background 0.15s ease;
}

.btn:hover {
  background: var(--btn-hover);
  transform: translateY(-1px);
}
.btn:focus,
.btn:active {
  text-decoration: none;
}
.btn:active {
  transform: none;
}
.btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}
.btn-compact {
  padding: 8px 12px;
}

.btn.secondary {
  background: var(--btn-bg);
  color: var(--btn-fg);
}

.btn.secondary:hover {
  background: var(--btn-hover);
}
.btn.danger {
  background: var(--danger);
}
.btn.danger:hover {
  background: #cc4138;
}

.button-row,
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row {
  align-items: flex-start;
  justify-content: flex-end;
}

.home-btn-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  width: 100%;
  max-width: 220px;
}

.home-btn-stack .btn {
  width: 100%;
  text-align: center;
}

.page-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.page-actions form {
  margin: 0;
}

.page-actions .btn {
  min-height: 40px;
  border-radius: 10px;
  padding: 8px 14px;
}

.narrow {
  max-width: 560px;
}
.stack {
  display: grid;
  gap: 12px;
}

label {
  font-weight: 600;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.password-wrap {
  position: relative;
}
.password-wrap input {
  padding-right: 3.2em;
}
.password-toggle {
  position: absolute;
  top: 1px;
  bottom: 1px;
  right: 1px;
  background: transparent;
  border: none;
  padding: 0 0.55em;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--accent, #e85d19);
  border-radius: 0 9px 9px 0;
}
.password-toggle .password-icon {
  display: block;
  width: 24px;
  height: 24px;
}
.password-toggle .password-icon--hide {
  display: none;
}
.password-toggle.is-revealed .password-icon--show {
  display: none;
}
.password-toggle.is-revealed .password-icon--hide {
  display: block;
}
.password-toggle:hover {
  color: var(--accent-hover, #c0440e);
}
.password-toggle:focus-visible {
  outline: 2px solid var(--accent, #e85d19);
  outline-offset: 2px;
  border-radius: 4px;
}

.auth-card {
  margin: 0 auto;
}
.auth-form {
  margin-top: 12px;
}

.show-search {
  position: relative;
}

.show-search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
  max-height: 290px;
  overflow: auto;
  z-index: 900;
  padding: 6px;
  overscroll-behavior: contain;
}

.show-search-result {
  width: 100%;
  display: grid;
  gap: 2px;
  text-align: left;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  cursor: pointer;
}

.show-search-result:hover,
.show-search-result.is-active {
  background: var(--panel-2);
}

.show-search-result-title {
  font-weight: 700;
  line-height: 1.25;
}

.show-search-result-meta {
  font-size: 0.86rem;
  color: var(--muted);
}

.add-show-layout {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}

.add-show-card {
  max-width: 860px;
}

.add-show-form {
  flex: 1 1 0;
  min-width: 0;
  max-width: 500px;
}

.add-show-preview {
  flex: 0 0 180px;
  visibility: hidden;
}

.add-show-preview.is-visible {
  visibility: visible;
}

.add-show-preview-img {
  width: 180px;
  height: 260px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
  display: block;
}

.is-login-scene main.wrap {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
}

.is-login-scene main.wrap::before {
  content: "";
  position: fixed;
  inset: 70px -16vw -8vh -16vw;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(
      40% 30% at 18% 22%,
      rgba(255, 120, 40, 0.2),
      transparent 70%
    ),
    radial-gradient(
      36% 26% at 78% 28%,
      rgba(15, 23, 42, 0.12),
      transparent 70%
    ),
    radial-gradient(
      45% 36% at 52% 74%,
      rgba(255, 120, 40, 0.13),
      transparent 72%
    );
  filter: blur(26px);
  animation: loginAmbientDrift 12s ease-in-out infinite alternate;
}

.login-card {
  position: relative;
  overflow: hidden;
}

.login-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.08;
  background: repeating-linear-gradient(
    180deg,
    rgba(15, 23, 42, 0.26) 0px,
    rgba(15, 23, 42, 0.26) 1px,
    transparent 1px,
    transparent 3px
  );
}

.login-title {
  display: inline-block;
}

.login-title.is-tuning {
  animation: loginTitleTuneIn 0.58s ease-out both;
}

.login-now-showing {
  margin: 10px 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.login-now-prefix {
  color: var(--brand);
  font-weight: 700;
  margin-right: 4px;
}

.login-now-text {
  display: inline-block;
  min-height: 1.2em;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
}

.login-now-text.is-swapping {
  opacity: 0;
  transform: translateY(-3px);
}

.btn[data-login-submit].is-submitting {
  background: linear-gradient(90deg, var(--btn-bg), #22345e, var(--btn-bg));
  background-size: 220% 100%;
  animation: loginSubmitSweep 1s linear infinite;
}

@keyframes loginAmbientDrift {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(0, -8px, 0) scale(1.03);
  }
}

@keyframes loginTitleTuneIn {
  0% {
    opacity: 0;
    transform: translateY(-2px) scale(1.01);
    filter: blur(6px);
  }
  45% {
    opacity: 1;
    transform: translateY(0) scale(1.005);
    filter: blur(0);
  }
  58% {
    transform: translateX(-1px);
  }
  76% {
    transform: translateX(1px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: none;
  }
}

@keyframes loginSubmitSweep {
  from {
    background-position: 0% 50%;
  }
  to {
    background-position: 220% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .is-login-scene main.wrap::before,
  .login-title.is-tuning,
  .btn[data-login-submit].is-submitting {
    animation: none !important;
  }

  .login-now-text,
  .login-title {
    transition: none !important;
  }
}

.profile-card {
  max-width: 920px;
  margin: 0 auto;
}
.profile-heading-logo {
  display: block;
  height: 52px;
  width: auto;
  max-width: min(320px, 72vw);
  margin: 0 0 8px;
}
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 20px;
}
.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.profile-form {
  gap: 16px;
}
.profile-avatar-large {
  width: 120px;
  height: 120px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--panel-2);
  flex: 0 0 auto;
}
.profile-avatar-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.file-input {
  display: block;
  margin-top: 6px;
}
.form-help {
  margin: 8px 0 0;
  font-size: 0.9rem;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 400;
}
.home-panel {
  align-items: center;
}
.info-grid {
  margin-top: 6px;
}
.info-card h2 {
  margin-top: 0;
}

.info-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.home-counter-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.home-counter-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.home-counter-label {
  color: var(--muted);
}

.home-counter-value {
  font-size: 1.45rem;
  line-height: 1;
  color: var(--text);
}

.home-counter-divider {
  margin: 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.home-rec {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.home-rec-form {
  margin: 0;
}

.home-rec-button {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--panel-2);
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.home-rec-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition:
    opacity 0.36s ease,
    transform 0.6s ease;
}

.home-rec-button:hover .home-rec-image {
  transform: scale(1.03);
}

.home-rec-overlay {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 3px;
  padding: 12px;
  color: #fff;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.78),
    rgba(0, 0, 0, 0.2) 72%,
    rgba(0, 0, 0, 0)
  );
}

.home-rec-title {
  font-size: 1rem;
  font-weight: 800;
}

.home-rec-summary {
  font-size: 0.85rem;
  opacity: 0.94;
  line-height: 1.35;
}

.home-rec-cta {
  font-size: 0.76rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.9;
}

.home-rec-button.is-fading .home-rec-image,
.home-rec-button.is-fading .home-rec-overlay {
  opacity: 0.2;
}

.home-rec-hint {
  margin: 0;
  font-size: 0.85rem;
}

.show-header {
  display: flex;
  gap: 24px;
  margin-bottom: 20px;
}

.show-meta {
  flex: 1;
}

.stats-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 18px 0 10px;
}

.stat {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  min-width: 136px;
}

.stat strong {
  display: block;
  font-size: 1.2rem;
}

.stat span {
  color: var(--muted);
  font-size: 0.9rem;
}

.episode-list,
.season-list {
  display: grid;
  gap: 10px;
}

.season-list {
  gap: 12px;
}

.season-group {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.season-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  font-weight: 700;
}

.season-group summary::-webkit-details-marker {
  display: none;
}

.season-group summary::after {
  content: "▾";
  color: var(--muted);
  transition: transform 0.2s ease;
}

.season-group[open] summary::after {
  transform: rotate(180deg);
}

.season-label {
  transition:
    color 0.2s ease,
    opacity 0.2s ease;
}

.season-group.is-complete .season-label {
  color: var(--muted);
  opacity: 0.8;
}

.season-meta {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.season-group .episode-list {
  padding: 0 12px 12px;
}

.season-actions {
  padding: 0 12px 10px;
}

.season-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.season-toggle-row input {
  width: 16px;
  height: 16px;
}

.episodes-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 4px 0 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
}

.bulk-toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: pointer;
}

.bulk-toggle-row input {
  width: 17px;
  height: 17px;
}

.bulk-toggle-meta {
  color: var(--muted);
  font-size: 0.92rem;
}

.episode-row {
  display: grid;
  grid-template-columns: auto 90px 1fr 110px;
  gap: 12px;
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.episode-row.is-watched {
  opacity: 0.75;
}
.episode-row.is-watched .episode-title {
  text-decoration: line-through;
}

.episode-code,
.episode-date {
  color: var(--muted);
  font-size: 0.92rem;
}

.empty {
  text-align: center;
  padding: 24px;
}

.hub-footer {
  background: #0f172a;
  color: #ffffff;
  text-align: center;
  padding: 16px;
  margin-top: auto;
}

.hub-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity 0.16s ease,
    transform 0.16s ease,
    background 0.16s ease,
    visibility 0.16s ease;
  z-index: 1400;
}

.back-to-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--btn-hover);
}

@media (max-width: 760px) {
  .header-left {
    display: flex;
    align-items: center;
  }

  .menu-btn {
    position: static;
    top: auto;
    left: auto;
  }

  .header-row {
    grid-template-columns: auto 1fr auto;
    gap: 12px;
  }

  .brand {
    justify-self: center;
    width: min(320px, 64vw);
    height: 62px;
  }

  .hero,
  .show-header,
  .profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-panel {
    padding: 18px;
  }

  .shows-hero {
    gap: 12px;
  }

  .shows-hero .btn {
    width: 100%;
  }

  .shows-search-wrap {
    max-width: none;
  }

  .shows-search-input {
    min-height: 48px;
  }

  .button-row {
    justify-content: flex-start;
  }
  .poster.large {
    width: 100%;
    height: auto;
    min-width: 0;
  }
  .back-to-top {
    right: 14px;
    bottom: 14px;
  }
  .show-card-header {
    flex-direction: column;
    align-items: flex-start;
  }
  .actions,
  .button-row {
    width: 100%;
  }

  .episodes-toolbar {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .episode-row {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "check title"
      "code date";
  }

  .episode-row input {
    grid-area: check;
  }
  .episode-title {
    grid-area: title;
  }
  .episode-code {
    grid-area: code;
  }
  .episode-date {
    grid-area: date;
  }

  .page-actions {
    width: 100%;
    gap: 8px;
  }

  .page-actions .btn,
  .page-actions form {
    width: 100%;
  }

  .show-search-results {
    max-height: 35vh;
  }
}
