:root {
  --bg-start: hsl(222, 47%, 7%);
  --bg-end: hsl(224, 32%, 11%);
  --text: hsl(210, 40%, 98%);
  --muted: hsl(215, 20%, 65%);
  --surface: hsla(222, 47%, 10%, 0.6);
  --surface-strong: hsla(222, 47%, 10%, 0.85);
  --surface-soft: hsla(222, 47%, 15%, 0.45);
  --border: hsla(217, 30%, 60%, 0.12);
  --input-bg: hsla(222, 47%, 5%, 0.55);
  --btn-bg: hsla(222, 47%, 18%, 0.6);
  --tab-active-start: hsl(263, 90%, 65%);
  --tab-active-end: hsl(280, 85%, 60%);
  --accent: hsl(263, 90%, 65%);
  --accent-strong: hsl(271, 91%, 60%);
  --danger: hsl(346, 84%, 61%);
  --success: hsl(142, 71%, 45%);
  --warning: hsl(35, 92%, 50%);
  --error: hsl(0, 84%, 60%);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --radius-sm: 10px;
  --wallpaper-url: none;
}

:root[data-theme="light"] {
  --bg-start: hsl(210, 40%, 98%);
  --bg-end: hsl(214, 32%, 91%);
  --text: hsl(222, 47%, 11%);
  --muted: hsl(215, 16%, 47%);
  --surface: hsla(0, 0%, 100%, 0.7);
  --surface-strong: hsla(0, 0%, 100%, 0.92);
  --surface-soft: hsla(210, 40%, 96%, 0.7);
  --border: hsla(217, 20%, 30%, 0.08);
  --input-bg: hsla(0, 0%, 100%, 0.85);
  --btn-bg: hsla(0, 0%, 100%, 0.85);
  --tab-active-start: hsl(263, 90%, 55%);
  --tab-active-end: hsl(280, 85%, 50%);
  --accent: hsl(263, 90%, 55%);
  --accent-strong: hsl(271, 91%, 50%);
  --danger: hsl(346, 84%, 55%);
  --success: hsl(142, 71%, 40%);
  --warning: hsl(35, 92%, 45%);
  --error: hsl(0, 84%, 55%);
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Outfit", "Inter", "Helvetica Neue", Arial, sans-serif;
  background-image:
    radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15), transparent 45rem),
    linear-gradient(180deg, var(--bg-start) 0%, var(--bg-end) 100%);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  transition: background-color 0.3s ease;
}

body.has-wallpaper {
  background-image:
    linear-gradient(180deg, rgba(10, 13, 22, 0.65) 0%, rgba(15, 23, 34, 0.85) 100%),
    var(--wallpaper-url);
  background-size: cover, cover;
  background-position: center, center;
  background-attachment: fixed, fixed;
}

:root[data-theme="light"] body.has-wallpaper {
  background-image:
    linear-gradient(180deg, rgba(248, 250, 252, 0.7) 0%, rgba(226, 232, 240, 0.85) 100%),
    var(--wallpaper-url);
}

.site {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: var(--surface-strong);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  margin-bottom: 24px;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--accent), var(--tab-active-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  opacity: 0.8;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', 'Inter', sans-serif;
}

h3,
h4 {
  margin: 0;
}

h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--text), var(--muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 1.05rem;
  font-weight: 600;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.auth-view {
  display: grid;
  place-items: center;
  min-height: 90vh;
}

.auth-card {
  width: min(440px, 100%);
  display: grid;
  gap: 20px;
  padding: 32px;
}

.muted {
  color: var(--muted);
}

p {
  margin-top: 0;
}

.tabs,
.auth-tabs,
.profile-tabs {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--surface-soft);
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.tabs {
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 600;
  min-height: 38px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.tab-button.active {
  border-color: rgba(255, 255, 255, 0.1);
  background: linear-gradient(135deg, var(--tab-active-start), var(--tab-active-end));
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.profile-tabs {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: flex;
  gap: 6px;
}

.profile-tab-button {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: var(--radius-sm);
  min-height: 36px;
  padding: 6px 14px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profile-tab-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.profile-tab-button.active {
  background: linear-gradient(135deg, var(--tab-active-start), var(--tab-active-end));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.25);
}

.profile-panel {
  display: grid;
  gap: 16px;
  padding-top: 10px;
}

.admin-create-form {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}

.admin-users-list {
  display: grid;
  gap: 10px;
}

.admin-user-card {
  display: grid;
  gap: 12px;
  align-items: center;
  grid-template-columns: minmax(180px, 1fr) auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  padding: 12px;
}

.admin-user-main,
.admin-user-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.admin-user-actions {
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 8px;
  color: var(--text);
  background: var(--input-bg);
  font-size: 0.78rem;
  font-weight: 700;
}

button,
input,
select,
textarea {
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font: inherit;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button {
  cursor: pointer;
  font-weight: 600;
  background: var(--btn-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

button:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

button:active {
  transform: translateY(1px);
}

button[type="submit"], button#confirmMetadataResetBtn {
  background: linear-gradient(135deg, var(--tab-active-start), var(--tab-active-end));
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.3);
}

button[type="submit"]:hover, button#confirmMetadataResetBtn:hover {
  background: linear-gradient(135deg, var(--accent-strong), var(--tab-active-end));
  box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.5);
  border-color: rgba(255, 255, 255, 0.2);
}

.danger-button {
  border-color: rgba(244, 63, 94, 0.3);
  color: var(--danger);
  background: rgba(244, 63, 94, 0.05);
}

.danger-button:hover {
  border-color: var(--danger);
  background: rgba(244, 63, 94, 0.15);
  box-shadow: 0 6px 16px rgba(244, 63, 94, 0.2);
}

.form {
  display: grid;
  gap: 16px;
}

.form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form input,
.form select,
.form textarea {
  color: var(--text);
  font-weight: 400;
  width: 100%;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  border-color: var(--accent);
  background: var(--surface-strong);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.row > * {
  flex: 1 1 180px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(340px, 0.9fr);
  gap: 16px;
  align-items: start;
}

.layout:has(#editForm.hidden) {
  grid-template-columns: 1fr;
}

.shows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 12px;
  max-height: 640px;
  overflow: auto;
  padding-right: 6px;
  border-top: none;
}

.layout:has(#editForm.hidden) .shows {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.show-item {
  text-align: left;
  display: flex;
  gap: 14px;
  padding: 14px;
  min-height: 116px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.show-item:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.3);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.show-item.selected {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 1px var(--accent) inset, 0 8px 24px rgba(99, 102, 241, 0.15);
}

.poster {
  width: 62px;
  min-width: 62px;
  height: 88px;
  border-radius: 6px;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  background: linear-gradient(135deg, var(--surface-soft), var(--btn-bg));
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.poster-image {
  width: 62px;
  min-width: 62px;
  height: 88px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.show-item:hover .poster-image,
.show-item:hover .poster {
  transform: scale(1.06);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.35);
}

.show-content {
  display: grid;
  width: 100%;
  align-content: start;
  gap: 6px;
}

.show-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.show-title {
  font-weight: 700;
  line-height: 1.2;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

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

.status-pill {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-transform: capitalize;
  white-space: nowrap;
}

.status-watching {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.15);
}

.status-completed {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.15);
}

.status-planned {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.15);
}

.status-dropped {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.1);
  border-color: rgba(244, 63, 94, 0.15);
}

.status-on_hold {
  color: #a78bfa;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.15);
}

.mini-progress-track,
.progress-track {
  height: 6px;
  width: 100%;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.mini-progress-fill,
.progress-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 999px;
}

.detail-top {
  display: flex;
  gap: 12px;
  align-items: center;
}

.meta-status {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.detail-poster {
  width: 68px;
  height: 96px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  background-size: cover;
  background-position: center;
}

.progress-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 12px 14px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.next-list {
  display: grid;
  gap: 12px;
}

.hero-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.hero-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
  min-width: 0;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

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

.hero-panel-actions {
  display: inline-flex;
  gap: 8px;
  flex: 0 0 auto;
}

.hero-scroll-button {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 50%;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  line-height: 1;
  background: var(--btn-bg);
  border: 1px solid var(--border);
}

.hero-scroll-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.hero-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 4px 4px 10px;
  min-width: 0;
  max-width: 100%;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hero-row::-webkit-scrollbar {
  display: none;
}

.hero-row.is-empty {
  overflow: hidden;
  padding-bottom: 4px;
}

.hero-row.is-empty p {
  margin: 0;
}

.anime-wallpaper-thumb {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  width: 96px;
  min-width: 96px;
  height: 64px;
  overflow: hidden;
  background: var(--btn-bg);
  transition: all 0.2s ease;
}

.anime-wallpaper-thumb:hover {
  transform: scale(1.05);
  border-color: var(--accent);
}

.anime-wallpaper-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-card {
  flex: 0 0 126px;
  width: 126px;
  min-height: 242px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
  background: var(--btn-bg);
  color: var(--text);
  text-align: left;
  display: grid;
  grid-template-rows: 168px minmax(38px, auto) auto;
  gap: 8px;
  scroll-snap-align: start;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.hero-card:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.hero-card-poster {
  width: 100%;
  height: 168px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.hero-card-title {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  min-height: 2.5em;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.hero-card-meta {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.25;
  white-space: normal;
}

#animeWallpaperGallery.hero-row {
  scrollbar-width: auto;
}

#animeWallpaperGallery.hero-row::-webkit-scrollbar {
  display: block;
}

.next-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.next-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(90deg, rgba(99, 102, 241, 0.08), transparent 45%),
    var(--surface-soft);
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 108px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.next-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateY(-2px);
  background:
    linear-gradient(90deg, rgba(99, 102, 241, 0.12), transparent 50%),
    rgba(255, 255, 255, 0.03);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}

.next-item:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px rgba(99, 102, 241, 0.2),
    0 16px 36px rgba(0, 0, 0, 0.25);
}

.next-item.is-catchup {
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.08), transparent 45%),
    var(--surface-soft);
}

.next-item.is-catchup:hover {
  border-color: rgba(245, 158, 11, 0.35);
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.12), transparent 50%),
    rgba(255, 255, 255, 0.03);
}

.next-item.is-caught-up {
  background:
    linear-gradient(90deg, rgba(16, 185, 129, 0.08), transparent 45%),
    var(--surface-soft);
}

.next-item.is-caught-up:hover {
  border-color: rgba(16, 185, 129, 0.35);
  background:
    linear-gradient(90deg, rgba(16, 185, 129, 0.12), transparent 50%),
    rgba(255, 255, 255, 0.03);
}

.next-item.is-caught-up .next-item-kicker {
  color: var(--success);
}

.next-item-poster {
  width: 62px;
  height: 84px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: var(--btn-bg);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.25);
}

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

.next-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.next-item-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.next-item-main strong {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.next-item-kicker {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.next-item.is-catchup .next-item-kicker {
  color: var(--warning);
}

.next-item-progress-text {
  color: var(--muted);
  font-size: 0.84rem;
}

.next-item-progress-text.is-open-ended {
  color: color-mix(in srgb, var(--warning) 82%, var(--muted));
}

.next-item-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.next-item-facts span {
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 66%, transparent);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.mini-progress-track.is-open-ended {
  background: repeating-linear-gradient(
    135deg,
    color-mix(in srgb, var(--warning) 16%, transparent),
    color-mix(in srgb, var(--warning) 16%, transparent) 6px,
    rgba(100, 116, 139, 0.24) 6px,
    rgba(100, 116, 139, 0.24) 12px
  );
}

.mini-progress-track.is-open-ended .mini-progress-fill {
  background: color-mix(in srgb, var(--warning) 76%, var(--accent));
}

.next-item-date {
  width: fit-content;
  justify-self: end;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-strong) 74%, transparent);
  white-space: nowrap;
}

.next-item-side {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 210px;
}

.next-group-title {
  margin: 6px 0 2px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.pager {
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pager p {
  margin: 0;
  min-width: 180px;
  text-align: center;
}

.pager button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reminder-toggle {
  min-width: 92px;
  min-height: 34px;
  border-radius: 7px;
  padding: 6px 11px;
  background: color-mix(in srgb, var(--surface-strong) 72%, transparent);
  border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: none;
}

.reminder-toggle::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 12%, transparent);
}

.reminder-toggle.active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--btn-bg));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 38%, transparent) inset;
}

.reminder-toggle:hover {
  color: var(--text);
}

.watched-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--btn-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.watched-toggle:hover {
  border-color: var(--accent);
}

.empty-state {
  margin: 4px 0 0;
  padding: 18px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
  text-align: center;
}

.calendar-timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  padding-left: 24px;
}

.calendar-timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--tab-active-end), transparent);
  opacity: 0.4;
}

.calendar-month {
  margin: 16px 0 4px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  position: relative;
}

.calendar-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  background: var(--surface-soft);
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  text-align: left;
  min-height: 80px;
  position: relative;
  transition: all 0.3s ease;
}

.calendar-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  border: 2.5px solid var(--bg-start);
  transition: all 0.3s ease;
  z-index: 2;
}

.calendar-item:hover::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.3);
}

.calendar-item.is-today::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.4);
}

.calendar-item:hover {
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(4px);
  background: rgba(255, 255, 255, 0.02);
}

.calendar-item.is-recent {
  background: var(--surface-soft);
  opacity: 0.85;
}

.calendar-item.is-today {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.05);
}

.calendar-day {
  display: grid;
  gap: 5px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.1;
}

.calendar-day span:last-child {
  width: fit-content;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-strong) 68%, transparent);
  font-size: 0.68rem;
  font-weight: 700;
}

.calendar-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.calendar-main strong {
  overflow-wrap: anywhere;
}

.metadata-health-list {
  display: grid;
  gap: 10px;
}

.metadata-toolbar,
.metadata-toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.metadata-toolbar {
  margin-bottom: 12px;
}

.metadata-toolbar > * {
  flex: 1 1 220px;
}

.metadata-reset-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: 8px;
  background: rgba(244, 63, 94, 0.07);
}

.metadata-reset-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
}

.metadata-health-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 12px;
  background: var(--surface-soft);
}

.metadata-health-poster {
  width: 56px;
  height: 78px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--btn-bg);
}

.metadata-health-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.metadata-health-main strong {
  overflow-wrap: anywhere;
}

.metadata-health-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.metadata-fix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.metadata-status-cached {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 62%, var(--border));
}

.metadata-status-missing {
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 62%, var(--border));
}

.metadata-status-unknown,
.metadata-status-loading {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 62%, var(--border));
}

.stat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.stat-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-value {
  margin: 0;
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.import-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.import-help {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.import-help summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.95rem;
}

.import-help p {
  margin: 10px 0 0;
}

.preview-box {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
}

.option {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  background: var(--surface-soft);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.message {
  min-height: 1.3em;
  color: var(--success);
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--surface-soft);
  border: 1px solid transparent;
  font-weight: 600;
}

.message.is-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
}

.message.is-error {
  color: var(--danger);
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.25);
}

.sr-message {
  position: fixed;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.toast-stack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(390px, calc(100vw - 28px));
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface-strong) 92%, transparent);
  color: var(--text);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
  animation: toastIn 0.22s ease-out;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.98);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.is-success {
  border-color: color-mix(in srgb, var(--success) 38%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--success) 14%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.toast.is-error {
  border-color: color-mix(in srgb, var(--danger) 42%, var(--border));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--danger) 15%, transparent), transparent 42%),
    color-mix(in srgb, var(--surface-strong) 92%, transparent);
}

.toast-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
  background: var(--success);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--success) 25%, transparent);
}

.toast.is-error .toast-icon {
  background: var(--danger);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--danger) 25%, transparent);
}

.toast-body {
  min-width: 0;
  padding-top: 2px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.toast-close {
  width: 30px;
  height: 30px;
  min-height: 30px;
  padding: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.toast-close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--surface-soft) 70%, transparent);
  border-color: var(--border);
  transform: none;
  box-shadow: none;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 22, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 1000;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.modal-card {
  position: relative;
  width: min(860px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalSlideUp {
  from {
    transform: translateY(24px) scale(0.96);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.modal-close {
  position: absolute;
  right: 16px;
  top: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.3rem;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-bg);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-close:hover {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface-soft);
  transform: rotate(90deg);
}

.modal-hero {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.modal-poster {
  width: 170px;
  height: 255px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--surface-soft);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}

.modal-overview {
  color: var(--text);
  margin: 0 0 16px;
  white-space: pre-wrap;
  line-height: 1.6;
}

.detail-grid {
  margin: 0 0 20px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.detail-grid > div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: var(--surface-soft);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.detail-grid dt {
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-grid dd {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.inline-controls {
  display: flex;
  gap: 8px;
}

.inline-controls input {
  flex: 1;
}

.search-results {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-soft);
  display: grid;
  gap: 6px;
  padding: 6px;
}

.search-result-item {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--btn-bg);
  padding: 6px;
}

.search-result-poster {
  width: 42px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.search-result-main {
  display: grid;
  gap: 2px;
}

.search-result-alt {
  color: var(--muted);
  font-size: 0.78rem;
}

.selected-show-panel {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 44%),
    var(--surface-soft);
}

.selected-show-panel.hidden,
.hidden {
  display: none !important;
}

.selected-show-poster {
  width: 76px;
  height: 108px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--btn-bg);
}

.selected-show-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.selected-show-main strong {
  font-size: 1.08rem;
  overflow-wrap: anywhere;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent);
}

@media (max-width: 1020px) {
  .layout,
  .import-options,
  .hero-panels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 740px) {
  .site {
    padding: 0 10px 20px;
  }

  .header-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px;
  }

  .brand {
    text-align: center;
  }

  .actions {
    justify-content: center;
  }

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

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

  .layout:has(#editForm.hidden) .shows {
    grid-template-columns: 1fr;
  }

  .modal-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .modal-poster {
    width: 100%;
    max-width: 260px;
    height: auto;
    aspect-ratio: 2 / 3;
    margin: 0 auto;
  }

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

  .next-item-side {
    grid-column: 1 / -1;
    justify-items: stretch;
    min-width: 0;
  }

  .next-item-date {
    justify-items: start;
    justify-self: start;
  }

  .next-item-actions {
    justify-content: stretch;
  }

  .next-item-actions > * {
    flex: 1 1 150px;
  }

  .watched-toggle {
    justify-content: center;
  }

  .selected-show-panel {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .selected-show-poster {
    width: 58px;
    height: 82px;
  }

  .next-summary {
    grid-template-columns: 1fr;
  }

  .calendar-item {
    grid-template-columns: 1fr;
  }

  .metadata-health-item {
    grid-template-columns: 1fr;
  }

  .metadata-health-poster {
    width: 74px;
    height: 104px;
  }

  .metadata-health-actions {
    justify-content: stretch;
  }

  .metadata-health-actions button {
    flex: 1 1 130px;
  }

  .metadata-fix-row {
    grid-template-columns: 1fr;
  }

  .pager {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .next-summary,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .actions,
  .actions button,
  .auth-tabs .tab-button {
    width: 100%;
  }

  .row > * {
    flex-basis: 100%;
  }
}

/* Modal Tabs */
.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  margin: 16px 0;
  padding-bottom: 8px;
}

.modal-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.modal-tab-btn.active {
  color: var(--accent-light, #8b5cf6);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

/* Season Collapsible Header */
.modal-seasons-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.modal-season-group {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  overflow: hidden;
  transition: all 0.2s ease;
}

.modal-season-group.is-completed {
  border-color: rgba(16, 185, 129, 0.2);
}

.modal-season-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  user-select: none;
  transition: background 0.2s ease;
}

.modal-season-header:hover {
  background: rgba(255, 255, 255, 0.05);
}

.modal-season-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 600;
}

.modal-season-badge {
  font-size: 0.8rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.modal-season-group.is-completed .modal-season-badge {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.modal-season-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  transition: transform 0.2s ease;
}

.modal-season-group.open .modal-season-arrow {
  transform: rotate(90deg);
}

/* Collapsible Content */
.modal-season-content {
  display: none;
  border-top: 1px solid var(--border);
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.1);
}

.modal-season-group.open .modal-season-content {
  display: block;
}

/* Episode List */
.modal-episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.modal-episode-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.modal-episode-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--accent);
}

.modal-episode-item.watched {
  border-color: rgba(16, 185, 129, 0.3);
  background: rgba(16, 185, 129, 0.05);
}

.modal-episode-item span {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-episode-checkbox {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.modal-episode-item.watched .modal-episode-checkbox {
  background: #10b981;
  border-color: #10b981;
}

.modal-episode-checkbox::after {
  content: "✓";
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: none;
}

.modal-episode-item.watched .modal-episode-checkbox::after {
  display: block;
}

/* Continue Watching List */
.modal-continue-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.continue-episode-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.continue-episode-card:hover {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
}

.continue-episode-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.continue-episode-code {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent-light, #8b5cf6);
  letter-spacing: 0.5px;
}

.continue-episode-title {
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-widget {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 600;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: relative;
  cursor: pointer;
  user-select: none;
}

.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--tab-active-start), var(--tab-active-end));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
  overflow: hidden;
}

.user-name {
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-admin-tag {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.dropdown-caret {
  font-size: 0.7rem;
  margin-left: 2px;
  color: var(--muted);
  transition: transform 0.2s ease;
}

.user-profile-widget[aria-expanded="true"] .dropdown-caret {
  transform: rotate(180deg);
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 180px;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1000;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: top right;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-4px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dropdown-item {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  text-align: left;
  justify-content: flex-start;
  transition: all 0.15s ease;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: transparent;
  transform: none;
  box-shadow: none;
}

.dropdown-item.danger-item {
  color: var(--danger);
}

.dropdown-item.danger-item:hover {
  background: rgba(244, 63, 94, 0.08);
}

.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 6px;
}

.app-footer {
  text-align: center;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
}

.app-footer a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.app-footer a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}
