* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f7f8fc;
  color: #1f2937;
  line-height: 1.4;
}

.container {
  width: min(100%, 1720px);
  margin: 0 auto;
  padding: 1.25rem;
}

.page-header h1 {
  margin: 0 0 0.3rem;
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  padding-top: 2.5rem;
  padding-bottom: 2rem;
}

.app-header h1 {
  font-size: clamp(2rem, 5vw, 3.7rem);
  letter-spacing: -0.055em;
  line-height: 1;
}

.app-header nav {
  display: flex;
  gap: 1rem;
}

.app-header nav a {
  color: #1d4ed8;
  font-weight: 700;
  text-decoration: none;
}

.eyebrow {
  color: #2563eb;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 0.35rem;
}

.catalog-shell {
  background: radial-gradient(circle at 100% 0%, #dbeafe 0, #eff6ff 29%, #fff 65%);
  border: 1px solid #dbeafe;
  border-radius: 20px;
  box-shadow: 0 12px 36px rgba(30, 64, 175, 0.09);
  padding: clamp(1.25rem, 4vw, 3rem);
  margin-bottom: 3rem;
}

.catalog-intro h2,
.admin-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.2rem);
  letter-spacing: -0.035em;
}

.catalog-intro > p:last-child,
.admin-heading > p:last-child {
  color: #4b5563;
  margin: 0.5rem 0 1.35rem;
}

.catalog-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px auto auto;
  gap: 0.6rem;
}

.catalog-search input,
.catalog-search select,
.catalog-search button {
  min-height: 48px;
}

.catalog-search button {
  padding-inline: 1.15rem;
}

.catalog-message {
  min-height: 1.4rem;
  color: #475569;
  margin: 1rem 0;
}

.catalog-message.error {
  color: #b91c1c;
}

.catalog-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.title-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.title-card > img,
.poster-placeholder {
  aspect-ratio: 2 / 3;
  background: #e2e8f0;
  object-fit: cover;
  width: 100%;
}

.poster-placeholder {
  align-items: center;
  color: #64748b;
  display: flex;
  justify-content: center;
}

.title-card-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 0.9rem;
}

.title-card h3 {
  font-size: 1.08rem;
  line-height: 1.2;
  margin: 0.15rem 0 0.35rem;
}

.content-type {
  color: #2563eb;
  font-size: 0.73rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin: 0;
  text-transform: uppercase;
}

.title-meta {
  color: #64748b;
  font-size: 0.82rem;
  margin: 0;
}

.overview {
  color: #475569;
  display: -webkit-box;
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  margin: 0.75rem 0 1rem;
  overflow: hidden;
}

.title-card button {
  align-self: flex-start;
  margin-top: auto;
}

.provider-admin {
  scroll-margin-top: 1rem;
}

.admin-heading {
  margin-bottom: 1rem;
}

.sr-only {
  height: 1px;
  margin: -1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.page-header p {
  margin: 0;
  color: #4b5563;
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

/* .page-layout sets display: grid at the same specificity as the browser's
   default [hidden] rule, so an ID + attribute selector is needed here to
   actually hide #adminPanel (the Administration section body) while it is
   locked. */
#adminPanel[hidden] {
  display: none;
}

.panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem;
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

.panel-wide {
  padding-bottom: 1.15rem;
}

.toolbar {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.toolbar input,
.toolbar select,
.toolbar button {
  padding: 0.55rem 0.65rem;
}

.toolbar input {
  min-width: 280px;
  flex: 1;
}

.toolbar select {
  min-width: 220px;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1150px;
}

th,
td {
  border-bottom: 1px solid #e5e7eb;
  padding: 0.75rem 0.55rem;
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 0.82rem;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

td {
  font-size: 0.95rem;
}

td.col-order {
  width: 90px;
}

td.col-provider {
  min-width: 220px;
}

td.col-category {
  min-width: 170px;
}

td.col-country {
  min-width: 160px;
}

td.col-integration {
  min-width: 180px;
}

td.col-status {
  min-width: 220px;
}

td.col-actions {
  min-width: 320px;
}

.provider-name {
  font-weight: 600;
}

.provider-slug {
  margin-top: 0.2rem;
  color: #6b7280;
  font-size: 0.82rem;
}

.status-summary {
  font-size: 0.9rem;
}

.status-summary small {
  display: block;
  color: #6b7280;
  margin-top: 0.2rem;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

button {
  border: 1px solid #2563eb;
  border-radius: 6px;
  background: #2563eb;
  color: #fff;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

button:hover {
  opacity: 0.96;
}

button.secondary {
  border-color: #4b5563;
  background: #4b5563;
}

button.danger {
  border-color: #b91c1c;
  background: #b91c1c;
}

button.outline {
  background: #fff;
  color: #334155;
  border-color: #cbd5e1;
}

input,
textarea,
select {
  font: inherit;
  padding: 0.55rem 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  width: 100%;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid #bfdbfe;
  border-color: #2563eb;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.form-section {
  margin: 0;
  padding: 0.8rem;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  display: grid;
  gap: 0.7rem;
}

.form-section legend {
  padding: 0 0.35rem;
  font-size: 0.92rem;
  font-weight: 600;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}

.toggle-row {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.55rem;
}

.toggle-row input {
  width: auto;
  margin-top: 0.1rem;
}

.toggle-row small {
  display: block;
  color: #6b7280;
  margin-top: 0.15rem;
}

.actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.message {
  min-height: 1.2rem;
  color: #1d4ed8;
  margin: 0.2rem 0 0;
}

.logo-preview-wrapper {
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  padding: 0.55rem;
}

#logoPreview {
  width: 100%;
  max-height: 110px;
  object-fit: contain;
  display: block;
  margin-bottom: 0.3rem;
}

.hint {
  margin: 0;
  color: #6b7280;
  font-size: 0.82rem;
}

.integration-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.integration-preview-grid p {
  margin: 0;
  font-size: 0.88rem;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  border: 1px solid;
  font-size: 0.76rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-pill.not-configured {
  color: #6b7280;
  background: #f9fafb;
  border-color: #d1d5db;
}

.status-pill.planned {
  color: #7c3aed;
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.status-pill.configured {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #93c5fd;
}

.status-pill.connected {
  color: #047857;
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.status-pill.error {
  color: #b91c1c;
  background: #fef2f2;
  border-color: #fca5a5;
}

dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 760px;
  width: calc(100% - 2rem);
}

#titleViewDialog {
  max-width: 900px;
}

.title-dialog-card {
  max-height: min(900px, calc(100vh - 2rem));
  overflow-y: auto;
  padding: 0;
  position: relative;
}

.dialog-close {
  align-items: center;
  border-radius: 999px;
  display: flex;
  font-size: 1.5rem;
  height: 36px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  width: 36px;
  z-index: 1;
}

.title-backdrop {
  display: block;
  height: min(320px, 34vw);
  object-fit: cover;
  width: 100%;
}

.title-detail-content {
  padding: clamp(1rem, 3vw, 2rem);
}

.title-detail-content h2 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.05em;
  line-height: 1;
  margin: 0.2rem 0 0.5rem;
}

.detail-overview {
  font-size: 1.02rem;
  max-width: 68ch;
}

.embed-player-section {
  margin: 2rem 0;
}

.embed-player-section h3 {
  margin: 0;
}

.embed-player-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
}

.embed-player-actions .hint {
  margin: 0;
}

.embed-player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1rem 0;
}

.embed-player-controls {
  align-items: flex-end;
}

.embed-player-stage:fullscreen {
  background: #0f172a;
  position: relative;
}

/* In full screen the controls overlay the video and appear only while hovering the full screen area */
.embed-player-stage:fullscreen .embed-player-controls {
  background: linear-gradient(rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0));
  color: #e2e8f0;
  left: 0;
  margin: 0;
  opacity: 0;
  padding: 0.75rem;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  visibility: hidden;
  z-index: 3;
}

.embed-player-stage:fullscreen.controls-visible .embed-player-controls,
.embed-player-stage:fullscreen .embed-player-controls:has(input:focus) {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.embed-fullscreen-hotzone {
  display: none;
}

/* Transparent strip above the iframe so mouse movement at the top edge is detectable */
.embed-player-stage:fullscreen .embed-fullscreen-hotzone {
  display: block;
  height: 110px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  z-index: 2;
}

.embed-player-stage:fullscreen .embed-player-frame {
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
  height: 100%;
  width: 100%;
}

.embed-player-controls label {
  display: grid;
  gap: 0.3rem;
  min-width: 120px;
}

.embed-player-controls input {
  min-height: 40px;
  width: 120px;
}

.embed-player-frame {
  aspect-ratio: 16 / 9;
  background: #0f172a;
  border-radius: 10px;
  overflow: hidden;
  width: 100%;
}

.embed-player-frame iframe {
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}

.viewing-tip-notice {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  color: #475569;
  font-size: 0.86rem;
  line-height: 1.5;
  margin: 0 0 1rem;
  padding: 0.65rem 0.9rem;
}

.viewing-tip-notice a {
  color: #1d4ed8;
  font-weight: 600;
}

.viewing-tip-notice a:hover {
  opacity: 0.8;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.genres span {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  color: #1d4ed8;
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

.cast {
  color: #475569;
}

.availability-section {
  border-top: 1px solid #e2e8f0;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}

.availability-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.availability-heading h3 {
  font-size: 1.35rem;
  margin: 0;
}

.availability-group h4 {
  font-size: 0.92rem;
  margin: 1.3rem 0 0.55rem;
}

.availability-options {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.availability-option {
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding: 0.65rem;
}

.availability-option strong,
.availability-option small {
  display: block;
}

.availability-option small {
  color: #64748b;
  min-height: 1em;
}

.watch-link {
  color: #1d4ed8;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.dialog-card {
  padding: 1rem;
}

.provider-view-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.provider-view-grid p {
  margin: 0.3rem 0;
}

.integration-status-list {
  padding-left: 1rem;
}

.integration-status-list li {
  margin: 0.35rem 0;
}

.providers-cards {
  display: none;
}

.provider-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 0.8rem;
  background: #fff;
  margin-bottom: 0.65rem;
}

.provider-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.provider-card p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

.provider-card .actions-cell {
  margin-top: 0.6rem;
}

@media (max-width: 980px) {
  .integration-preview-grid {
    grid-template-columns: 1fr;
  }

  .provider-view-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .table-wrapper {
    display: none;
  }

  .providers-cards {
    display: block;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0.9rem;
  }

  .toolbar input,
  .toolbar select,
  .toolbar button {
    width: 100%;
    min-width: 0;
  }

  .app-header,
  .availability-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-search {
    grid-template-columns: 1fr;
  }
}

body {
  background:
    radial-gradient(ellipse at 8% 4%, rgba(18, 137, 226, 0.16), transparent 33rem),
    radial-gradient(ellipse at 92% 24%, rgba(129, 63, 230, 0.12), transparent 30rem),
    #080d19;
  color: #e8eef8;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.55;
}

.container {
  width: min(100%, 1480px);
  padding-inline: clamp(1rem, 3vw, 2rem);
}

.app-header {
  align-items: center;
  background: linear-gradient(118deg, #111d35 0%, #10182c 54%, #211344 100%);
  border: 1px solid rgba(133, 170, 231, 0.16);
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.28), inset 0 1px rgba(255, 255, 255, 0.04);
  margin-top: 1.25rem;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2.4rem);
  position: relative;
}

.app-header::after {
  background: linear-gradient(90deg, #16d5e9, #7972ff, #e047db);
  bottom: 0;
  content: "";
  height: 2px;
  left: 8%;
  opacity: 0.8;
  position: absolute;
  right: 8%;
}

.brand-lockup {
  align-items: center;
  display: flex;
  gap: clamp(1rem, 2.5vw, 2rem);
  min-width: 0;
}

.brand-logo {
  border: 1px solid rgba(104, 196, 255, 0.24);
  border-radius: 18px;
  box-shadow: 0 8px 35px rgba(0, 170, 255, 0.16);
  flex: 0 0 auto;
  height: clamp(88px, 11vw, 142px);
  object-fit: cover;
  width: clamp(88px, 11vw, 142px);
}

.brand-copy {
  max-width: 740px;
}

.app-header h1 {
  color: #f8fbff;
  font-size: clamp(2rem, 4.5vw, 3.6rem);
  letter-spacing: -0.055em;
  line-height: 1.04;
  margin: 0 0 0.6rem;
}

.page-header p {
  color: #aab8d0;
  margin: 0;
}

.brand-copy .eyebrow,
.eyebrow {
  color: #66dff1;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
}

.app-header nav {
  align-self: flex-start;
  flex: 0 0 auto;
  gap: 0.55rem;
}

.app-header nav a {
  border: 1px solid rgba(156, 177, 219, 0.2);
  border-radius: 999px;
  color: #dce8fb;
  font-size: 0.92rem;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.app-header nav a:hover {
  background: rgba(89, 204, 239, 0.12);
  border-color: rgba(89, 204, 239, 0.55);
  transform: translateY(-1px);
}

.catalog-shell {
  background:
    radial-gradient(ellipse at 95% 0%, rgba(42, 104, 201, 0.22), transparent 32rem),
    linear-gradient(145deg, #111b30, #0d1424 68%);
  border: 1px solid rgba(130, 160, 208, 0.19);
  border-radius: 24px;
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.2);
  margin-bottom: 3rem;
  padding: clamp(1.25rem, 4vw, 3rem);
}

.catalog-intro h2,
.admin-heading h2 {
  color: #f4f7ff;
  font-size: clamp(1.65rem, 3.5vw, 2.5rem);
  letter-spacing: -0.045em;
}

.catalog-intro > p:last-child,
.admin-heading > p:last-child {
  color: #a9b7ce;
}

.catalog-search {
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.catalog-clear-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 48px;
  padding-inline: 0.8rem !important;
  position: relative;
}

.catalog-clear-button > span {
  font-size: 1.45rem;
  line-height: 1;
}

.catalog-clear-button::after {
  background: #0b1220;
  border: 1px solid #405273;
  border-radius: 7px;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.35);
  color: #edf4ff;
  content: attr(data-tooltip);
  font-size: 0.8rem;
  left: 50%;
  opacity: 0;
  padding: 0.35rem 0.55rem;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(-0.2rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.catalog-clear-button:hover::after,
.catalog-clear-button:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

input,
textarea,
select {
  background: #0b1220;
  border: 1px solid #2b3953;
  border-radius: 10px;
  color: #edf4ff;
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #73819a;
}

input:focus,
textarea:focus,
select:focus {
  border-color: #44cbe4;
  box-shadow: 0 0 0 3px rgba(68, 203, 228, 0.15);
  outline: none;
}

button {
  background: linear-gradient(115deg, #168ecb, #5864e8);
  border: 1px solid rgba(111, 202, 255, 0.35);
  border-radius: 10px;
  box-shadow: 0 5px 18px rgba(40, 108, 222, 0.2);
  font-weight: 700;
  padding: 0.6rem 0.95rem;
  transition: filter 150ms ease, transform 150ms ease;
}

button:hover {
  filter: brightness(1.12);
  opacity: 1;
  transform: translateY(-1px);
}

button.secondary,
button.outline {
  background: #172238;
  border-color: #35445e;
  color: #dbe7f9;
  box-shadow: none;
}

button.danger {
  background: #8d283e;
  border-color: #c64a61;
}

.catalog-message {
  color: #aab8d0;
  margin: 1.2rem 0;
}

.catalog-message.error {
  color: #ff9ca8;
}

.catalog-results {
  gap: 1.15rem;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.title-card,
.provider-card {
  background: #111b2c;
  border: 1px solid #26354d;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.19);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.title-card:hover,
.provider-card:hover {
  border-color: #42688f;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  transform: translateY(-3px);
}

.title-card > img,
.poster-placeholder {
  background: #18243a;
}

.title-card-content {
  padding: 1rem;
}

.title-card h3 {
  color: #f1f5fc;
}

.content-type {
  color: #62d8e8;
}

.title-meta,
.overview,
.hint,
.provider-slug,
.status-summary small {
  color: #9aaac2;
}

.overview {
  line-height: 1.55;
}

.provider-admin {
  scroll-margin-top: 1rem;
}

.admin-heading {
  margin: 0 0 1.2rem;
}

.admin-heading-row,
.user-admin-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.admin-heading-row > div > p,
.user-admin-heading > div > p:last-child {
  color: #a9b7ce;
  margin: 0.5rem 0 0;
}

.user-admin-panel {
  margin-bottom: 2rem;
  scroll-margin-top: 1rem;
}

.user-admin-heading {
  margin-bottom: 1rem;
}

.user-admin-heading h2 {
  color: #f4f7ff;
  font-size: clamp(1.45rem, 3vw, 2rem);
  margin: 0;
}

.user-table {
  min-width: 850px;
}

.user-table td:nth-child(2) {
  overflow-wrap: anywhere;
}

.user-state {
  border: 1px solid #35445e;
  border-radius: 999px;
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  white-space: nowrap;
}

.user-state.active {
  background: rgba(22, 163, 74, 0.15);
  border-color: rgba(74, 222, 128, 0.45);
  color: #86efac;
}

.user-state.inactive,
.user-state.expired {
  background: rgba(220, 38, 38, 0.12);
  border-color: rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.user-state.pending-approval,
.user-state.pending-verification,
.user-state.pending-pin {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(250, 204, 21, 0.4);
  color: #fde047;
}

.account-toggle {
  border-radius: 999px;
  min-width: 4.25rem;
}

.account-toggle.is-on {
  background: linear-gradient(115deg, #12804b, #16a765);
  border-color: #42ce84;
}

.account-toggle.is-off {
  background: #313d52;
  border-color: #52627c;
}

.account-toggle:disabled,
button:disabled {
  cursor: wait;
  filter: grayscale(0.45);
  opacity: 0.65;
  transform: none;
}

.user-admin-cards {
  display: none;
}

.user-admin-card {
  background: #111b2c;
  border: 1px solid #26354d;
  border-radius: 14px;
  min-width: 0;
  padding: 1rem;
}

.user-admin-card h3 {
  color: #f1f5fc;
  margin: 0 0 0.4rem;
}

.user-admin-card p {
  margin: 0.45rem 0;
  overflow-wrap: anywhere;
}

.user-admin-card a,
.user-table a {
  color: #8bd9f4;
}

.user-admin-card-action {
  margin-top: 0.8rem;
}

.user-admin-panel .message.error {
  color: #ff9ca8;
}

.mobile-admin-notice {
  display: none;
}

.panel {
  background: linear-gradient(145deg, #111b2d, #0e1625);
  border: 1px solid rgba(130, 160, 208, 0.16);
  border-radius: 18px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
  padding: clamp(1rem, 2vw, 1.5rem);
}

.toolbar {
  align-items: center;
  gap: 0.7rem;
}

.table-wrapper {
  border: 1px solid #26354b;
  border-radius: 12px;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

th {
  background: #19253a;
  color: #b9c8de;
}

td {
  border-color: #243248;
  color: #dbe5f3;
}

tbody tr:hover {
  background: rgba(78, 137, 201, 0.08);
}

.provider-name {
  color: #f2f6fc;
}

.form-section {
  background: rgba(255, 255, 255, 0.015);
  border-color: #2a3850;
  border-radius: 12px;
  padding: 1rem;
}

.form-section legend {
  color: #d9e5f6;
}

label {
  color: #c4d0e2;
}

.toggle-row small {
  color: #91a1ba;
}

.logo-preview-wrapper {
  border-color: #364660;
  border-radius: 10px;
}

.status-pill.not-configured {
  background: #202b3d;
  border-color: #4b5a70;
  color: #bbc6d5;
}

.status-pill.configured {
  background: #102e42;
  border-color: #26749b;
  color: #83e2fa;
}

.status-pill.connected {
  background: #10352f;
  border-color: #27816c;
  color: #86e5c3;
}

.status-pill.planned {
  background: #2a2043;
  border-color: #7656b2;
  color: #ceb8ff;
}

.status-pill.error {
  background: #3b202c;
  border-color: #a84b5d;
  color: #ffadba;
}

dialog {
  background: #111b2c;
  border: 1px solid #31415b;
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
  color: #e8eef8;
}

.dialog-card {
  background: #111b2c;
}

.title-dialog-card {
  background: #0e1727;
}

.title-detail-content h2,
.availability-heading h3,
.availability-group h4,
.provider-card h3 {
  color: #f1f5fc;
}

.availability-section {
  border-color: #29374e;
}

.availability-option {
  background: #141f32;
  border-color: #2a3a53;
}

.watch-link {
  color: #65d7ed;
}

.genres span {
  background: #172d42;
  border-color: #245673;
  color: #8ce7f4;
}

.cast {
  color: #aab8cf;
}

.credits-release {
  border-top: 1px solid rgba(165, 182, 214, 0.28);
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
}

.credits-release p:not(.eyebrow) {
  color: #c7d3ea;
  margin: 0.45rem 0;
}

.credits-release strong {
  color: #f3f7ff;
}

dialog::backdrop {
  background: rgba(2, 6, 16, 0.78);
  backdrop-filter: blur(5px);
}

.dialog-close {
  background: rgba(8, 13, 25, 0.82);
  border-color: rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 1.6rem;
}

.embed-player-frame {
  border: 1px solid #30405a;
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.32);
}

@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-header nav {
    align-self: auto;
    margin-left: calc(clamp(88px, 11vw, 142px) + clamp(1rem, 2.5vw, 2rem));
  }
}

@media (max-width: 520px) {
  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
  }

  .brand-logo {
    height: 92px;
    width: 92px;
  }

  .app-header nav {
    margin-left: 0;
  }

  .catalog-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .title-card-content {
    padding: 0.75rem;
  }

  .title-card h3 {
    font-size: 0.98rem;
  }

  .overview {
    -webkit-line-clamp: 3;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.page-layout {
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}

.page-layout > .panel,
.panel-wide,
.table-wrapper {
  min-width: 0;
  max-width: 100%;
}

.table-wrapper {
  overscroll-behavior-x: contain;
}

.title-card,
.title-card-content,
.provider-card,
.provider-card * {
  min-width: 0;
}

.overview,
.provider-slug,
.status-summary,
.integration-preview-grid p {
  overflow-wrap: anywhere;
}

.actions-cell {
  min-width: 0;
}

@media (max-width: 900px) {
  .table-wrapper {
    display: none;
  }

  .providers-cards {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }

  .provider-card {
    margin: 0;
  }

  .page-layout {
    display: none;
  }

  .admin-heading-row,
  .user-admin-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-table-wrapper {
    display: none;
  }

  .user-admin-cards {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }

  .mobile-admin-notice {
    background: #111b2d;
    border: 1px solid rgba(130, 160, 208, 0.2);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
    color: #aab8d0;
    display: block;
    margin: 0;
    padding: 1rem 1.1rem;
  }
}

@media (max-width: 680px) {
  .container {
    padding: 0.75rem;
  }

  .app-header {
    align-items: stretch;
    gap: 1.15rem;
    margin-top: 0.75rem;
    padding: 1rem;
  }

  .brand-lockup {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
  }

  .brand-logo {
    height: 76px;
    width: 76px;
    border-radius: 14px;
  }

  .app-header h1 {
    font-size: clamp(1.85rem, 8vw, 2.6rem);
    line-height: 1.08;
    overflow-wrap: anywhere;
  }

  .brand-copy .eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.12em;
  }

  .app-header nav {
    align-self: stretch;
    flex-wrap: wrap;
    margin: 0;
  }

  .catalog-shell {
    border-radius: 18px;
    margin-bottom: 2rem;
    padding: 1rem;
  }

  .catalog-intro h2,
  .admin-heading h2 {
    font-size: clamp(1.45rem, 7vw, 2rem);
    overflow-wrap: anywhere;
  }

  .catalog-search {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-search input,
  .catalog-search select,
  .catalog-search button,
  .toolbar input,
  .toolbar select,
  .toolbar button {
    min-width: 0;
    width: 100%;
  }

  .catalog-results {
    grid-template-columns: minmax(0, 1fr);
  }

  .title-card {
    display: grid;
    grid-template-columns: minmax(76px, 28%) minmax(0, 1fr);
  }

  .title-card > img,
  .poster-placeholder {
    height: 100%;
    min-height: 150px;
    aspect-ratio: auto;
  }

  .title-card-content {
    padding: 0.75rem;
  }

  .title-card h3 {
    font-size: 1rem;
    overflow-wrap: anywhere;
  }

  .overview {
    -webkit-line-clamp: 3;
    margin: 0.5rem 0 0.75rem;
  }

  .title-card button {
    justify-self: start;
    max-width: 100%;
    white-space: normal;
  }

  .page-layout {
    gap: 0.85rem;
  }

  .panel {
    border-radius: 14px;
    padding: 0.85rem;
  }

  .integration-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .integration-preview-grid p {
    line-height: 1.7;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr));
  }

  .actions button,
  .actions-cell button {
    min-height: 42px;
  }

  .availability-heading {
    align-items: flex-start;
  }

  .availability-options {
    grid-template-columns: minmax(0, 1fr);
  }

  .embed-player-actions {
    justify-content: flex-start;
  }

  #titleViewDialog,
  dialog {
    max-height: calc(100dvh - 1rem);
    width: calc(100% - 1rem);
  }

  .title-dialog-card {
    max-height: calc(100dvh - 1rem);
  }

  .title-backdrop {
    height: clamp(140px, 42vw, 240px);
  }
}

@media (max-width: 380px) {
  .container {
    padding: 0.55rem;
  }

  .catalog-shell {
    padding: 0.8rem;
  }

  .app-header {
    padding: 0.85rem;
  }

  .panel {
    padding: 0.7rem;
  }

  .form-section {
    padding: 0.7rem;
  }

  .provider-card {
    padding: 0.7rem;
  }

  .provider-card .actions-cell {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .provider-card .actions-cell button {
    min-width: 0;
    padding-inline: 0.4rem;
    white-space: normal;
  }

  .availability-option {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* ==========================================================================
   Subscriber authentication (PIN gate) — dialog, playback placeholder, lock
   control. Reuses the existing dark dialog/button/input conventions above.
   ========================================================================== */

#authLockButton,
#adminLockButton {
  min-height: 40px;
}

.auth-dialog-card {
  max-width: 420px;
  padding: clamp(1.5rem, 4vw, 2.25rem);
}

.auth-view h3 {
  color: #f4f7ff;
  font-size: 1.5rem;
  letter-spacing: -0.03em;
  margin: 0.3rem 0 0.6rem;
}

.auth-view form {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.auth-view label {
  color: #c3d0e6;
  display: grid;
  font-size: 0.88rem;
  font-weight: 600;
  gap: 0.35rem;
}

#pinInput,
#createPinInput,
#confirmPinInput,
#adminPinInput,
#adminSetupPinInput,
#adminSetupConfirmInput {
  font-size: 1.5rem;
  letter-spacing: 0.5em;
  text-align: center;
}

#pinInput::placeholder,
#adminPinInput::placeholder,
#adminSetupPinInput::placeholder,
#adminSetupConfirmInput::placeholder {
  letter-spacing: 0.5em;
}

.auth-hint {
  color: #9aaac2;
  font-size: 0.9rem;
  margin: 0.4rem 0 0;
}

.auth-error {
  color: #ff9ca8;
  font-size: 0.88rem;
  margin: 0.75rem 0 0;
  min-height: 1.1em;
}

.auth-switch {
  border-top: 1px solid #26354d;
  color: #9aaac2;
  font-size: 0.9rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
}

.link-button {
  background: none;
  border: none;
  box-shadow: none;
  color: #65d7ed;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0;
  text-decoration: underline;
}

.link-button:hover {
  filter: none;
  opacity: 0.85;
  transform: none;
}

.auth-view[hidden] {
  display: none;
}

.playback-placeholder {
  align-items: center;
  background: linear-gradient(150deg, #111b2c, #0b1220);
  border: 1px solid #26354d;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  justify-content: center;
  padding: clamp(2rem, 6vw, 3.5rem) 1.5rem;
  text-align: center;
}

.playback-placeholder p {
  color: #9aaac2;
  margin: 0;
}

.playback-placeholder button {
  font-size: 1.05rem;
  padding: 0.75rem 1.75rem;
}

.watch-history {
  margin-bottom: 3rem;
}

.watch-history-heading {
  align-items: start;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.watch-history-heading h2,
.watch-history-heading h3 {
  color: #f4f7ff;
  margin: 0;
}

.watch-history-heading p:last-child {
  color: #a9b7ce;
  margin: 0.35rem 0 0;
}

.watch-history-list {
  display: grid;
  gap: 0.75rem;
}

.watch-history-item {
  align-items: center;
  background: #101a2e;
  border: 1px solid #293a59;
  border-radius: 12px;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 58px minmax(0, 1fr);
  padding: 0.7rem;
}

.watch-history-item img,
.watch-history-poster-placeholder {
  background: #17243b;
  border-radius: 8px;
  height: 78px;
  object-fit: cover;
  width: 58px;
}

.watch-history-poster-placeholder {
  align-items: center;
  color: #a9b7ce;
  display: flex;
  font-size: 0.7rem;
  justify-content: center;
  text-align: center;
}

.watch-history-item h3 {
  color: #edf4ff;
  margin: 0.1rem 0;
}

.watch-history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.admin-history-details {
  border-top: 1px solid #293a59;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
}

.admin-history-row {
  align-items: center;
  border-bottom: 1px solid #293a59;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 0.65rem 0;
}

.admin-music-permission {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-width: 190px;
}

.admin-music-permission > span {
  color: #b9c8de;
  flex: 1 1 100%;
  font-size: 0.82rem;
  font-weight: 700;
}

.admin-music-permission button {
  min-height: 38px;
}

.user-admin-card .admin-music-permission {
  align-items: flex-start;
}

@media (max-width: 520px) {
  .watch-history-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .auth-dialog-card {
    max-width: none;
  }
}

.app-footer {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 1.5rem;
  padding-bottom: 2.75rem;
  padding-top: 0.5rem;
  text-align: center;
}

.footer-logo {
  border: 1px solid rgba(104, 196, 255, 0.24);
  border-radius: 14px;
  box-shadow: 0 8px 35px rgba(0, 170, 255, 0.16);
  height: clamp(52px, 7vw, 78px);
  margin-bottom: 0.6rem;
  object-fit: cover;
  width: clamp(52px, 7vw, 78px);
}

.footer-socials {
  background: linear-gradient(135deg, #4c1d95, #6d28d9 55%, #7c3aed);
  border-radius: 999px;
  box-shadow: 0 14px 40px rgba(76, 29, 149, 0.35);
  display: flex;
  gap: 0.85rem;
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0.7rem 1.1rem;
}

.footer-socials li {
  display: flex;
}

.social-icon {
  align-items: center;
  border-radius: 50%;
  color: #fff;
  display: flex;
  height: 42px;
  justify-content: center;
  transition: transform 160ms ease, box-shadow 160ms ease;
  width: 42px;
}

.social-icon svg {
  height: 21px;
  width: 21px;
}

.social-icon:hover,
.social-icon:focus-visible {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
  transform: translateY(-2px);
}

.social-facebook {
  background: #1877f2;
}

.social-instagram {
  background: radial-gradient(circle at 30% 110%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.social-whatsapp {
  background: #25d366;
}

.social-x {
  background: #14171a;
}

.footer-copyright {
  color: #dce8fb;
  font-size: 0.95rem;
  margin: 0;
}

.footer-credit {
  color: #8fa0bd;
  font-size: 0.85rem;
  margin: 0.15rem 0 0;
}

.footer-tmdb-credit {
  display: inline-flex;
  margin-top: 0.7rem;
  position: relative;
}

.footer-tmdb-credit img {
  background: #fff;
  border-radius: 5px;
  display: block;
  height: 15px;
  padding: 0.25rem 0.4rem;
  width: auto;
}

.footer-tmdb-credit::after {
  background: #111b30;
  border: 1px solid #35445e;
  border-radius: 8px;
  bottom: calc(100% + 0.6rem);
  color: #edf4ff;
  content: attr(data-credits);
  font-size: 0.8rem;
  font-weight: 400;
  left: 50%;
  line-height: 1.4;
  opacity: 0;
  padding: 0.55rem 0.75rem;
  pointer-events: none;
  position: absolute;
  text-align: center;
  transform: translate(-50%, 4px);
  transition: opacity 150ms ease, transform 150ms ease;
  visibility: hidden;
  width: min(19rem, calc(100vw - 2rem));
  z-index: 2;
}

.footer-tmdb-credit:hover::after,
.footer-tmdb-credit:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
  visibility: visible;
}

.footer-tmdb-credit:focus-visible {
  border-radius: 6px;
  outline: 3px solid #66dff1;
  outline-offset: 4px;
}

@media (max-width: 520px) {
  .footer-socials {
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
  }

  .social-icon {
    height: 38px;
    width: 38px;
  }

  .social-icon svg {
    height: 19px;
    width: 19px;
  }
}

.movie-discovery {
  background:
    radial-gradient(ellipse at 95% 0%, rgba(42, 104, 201, 0.16), transparent 28rem),
    linear-gradient(145deg, #111b30, #0d1424 68%);
  border: 1px solid rgba(130, 160, 208, 0.19);
  border-radius: 20px;
  margin-bottom: 1.25rem;
  padding: clamp(1.1rem, 3vw, 2rem);
}

.movie-discovery-heading h2 {
  color: #f4f7ff;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.04em;
  margin: 0;
}

.movie-discovery-heading > p:last-child {
  color: #a9b7ce;
  margin: 0.45rem 0 1.2rem;
}

.movie-discovery-controls {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 680px;
}

.movie-discovery-controls label {
  color: #dbe7f9;
  display: grid;
  font-weight: 700;
  gap: 0.4rem;
}

.movie-discovery-controls select {
  width: 100%;
}

.movie-discovery-status {
  color: #aab8d0;
  margin: 1rem 0;
  min-height: 1.4rem;
}

.movie-discovery-status.error {
  color: #ff9ca8;
}

.movie-discovery-results {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 235px), 1fr));
  grid-auto-rows: 14rem;
  min-height: 15rem;
}

@media (min-width: 900px) {
  .movie-discovery-results {
    min-height: 74rem;
  }
}

.movie-discovery-card {
  height: 14rem;
  overflow: hidden;
  background: rgba(17, 27, 44, 0.82);
  border: 1px solid #26354d;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
  min-height: 14rem;
  padding: 1rem;
}

.movie-discovery-skeleton {
  border-color: rgba(130, 160, 208, 0.12);
}

.skeleton-line,
.skeleton-button {
  animation: discovery-shimmer 1.4s ease-in-out infinite;
  background: linear-gradient(90deg, #1b2940 25%, #263751 50%, #1b2940 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  display: block;
}

.skeleton-title {
  height: 1.2rem;
  margin-bottom: 0.35rem;
  width: 76%;
}

.skeleton-meta {
  height: 0.85rem;
  width: 92%;
}

.skeleton-meta:last-of-type {
  width: 64%;
}

.skeleton-button {
  border-radius: 10px;
  height: 42px;
  margin-top: auto;
  width: 88px;
}

@keyframes discovery-shimmer {
  to {
    background-position: -200% 0;
  }
}

.movie-discovery-card h3 {
  color: #f4f7ff;
  font-size: 1.08rem;
  line-height: 1.25;
  margin: 0 0 0.15rem;
  overflow-wrap: anywhere;
}

.movie-discovery-card p {
  color: #a9b7ce;
  font-size: 0.9rem;
  margin: 0;
}

.movie-discovery-card p strong {
  color: #dbe7f9;
}

.movie-discovery-card button {
  align-self: flex-start;
  margin-top: 0.4rem;
  min-height: 42px;
  min-width: 88px;
}

.movie-discovery-pagination,
.catalog-pagination {
  align-items: center;
  display: flex;
  gap: 0.8rem;
  justify-content: center;
  margin-top: 1.2rem;
}

.movie-discovery-pagination span,
.catalog-pagination span {
  color: #dbe7f9;
  font-variant-numeric: tabular-nums;
  min-width: 6.5rem;
  text-align: center;
}

.movie-discovery-pagination .movie-discovery-page-jump,
.catalog-pagination .catalog-page-jump {
  min-width: 0;
}

.movie-discovery-pagination .movie-discovery-page-jump span,
.catalog-pagination .catalog-page-jump span {
  min-width: 0;
}

.movie-discovery-pagination input,
.catalog-pagination input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(160, 190, 230, 0.4);
  border-radius: 8px;
  color: #fff;
  font: inherit;
  margin: 0 0.25rem;
  padding: 0.3rem 0.2rem;
  text-align: center;
  width: 4.5rem;
  -moz-appearance: textfield;
}

.movie-discovery-pagination input::-webkit-outer-spin-button,
.movie-discovery-pagination input::-webkit-inner-spin-button,
.catalog-pagination input::-webkit-outer-spin-button,
.catalog-pagination input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.movie-discovery button:focus-visible {
  outline: 3px solid #66dff1;
  outline-offset: 3px;
}

@media (max-width: 520px) {
  .movie-discovery {
    border-radius: 18px;
    padding: 1rem;
  }

  @media (prefers-reduced-motion: reduce) {
    .skeleton-line,
    .skeleton-button {
      animation: none;
    }
  }

  .movie-discovery-controls {
    grid-template-columns: minmax(0, 1fr);
  }

  .movie-discovery-pagination,
  .catalog-pagination {
    gap: 0.45rem;
  }

  .movie-discovery-pagination button,
  .catalog-pagination button {
    min-height: 42px;
    padding-inline: 0.65rem;
  }
}

.music-page {
  background:
    radial-gradient(ellipse at 5% 0%, rgba(39, 113, 207, 0.17), transparent 32rem),
    #0a101d;
  color: #e8eef8;
  min-height: 100vh;
}

.music-header {
  align-items: center;
}

.music-header nav {
  align-items: center;
}

.music-header nav a {
  border: 1px solid rgba(156, 177, 219, 0.2);
  border-radius: 999px;
  color: #dce8fb;
  padding: 0.55rem 0.9rem;
  text-decoration: none;
}

.music-header nav button {
  min-height: 42px;
}

.music-main {
  display: grid;
  gap: 1rem;
}

.music-search-form {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  margin-top: 0.9rem;
}

.music-search-form input {
  min-width: 0;
  width: 100%;
}

.music-search-clear-button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  min-width: 48px;
  padding-inline: 0.8rem !important;
  position: relative;
}

.music-search-clear-button > span {
  font-size: 1.45rem;
  line-height: 1;
}

.music-search-clear-button::after {
  background: #0b1220;
  border: 1px solid #405273;
  border-radius: 7px;
  box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.35);
  color: #edf4ff;
  content: attr(data-tooltip);
  font-size: 0.8rem;
  left: 50%;
  opacity: 0;
  padding: 0.35rem 0.55rem;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 0.55rem);
  transform: translateX(-50%) translateY(-0.2rem);
  transition: opacity 0.15s ease, transform 0.15s ease;
  white-space: nowrap;
  z-index: 10;
}

.music-search-clear-button:hover::after,
.music-search-clear-button:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.music-search-results {
  margin-top: 1rem;
}

.music-search-result {
  background: #101a2e;
  border: 1px solid #293a59;
  border-radius: 12px;
  padding: 1rem;
}

.music-search-result h3 {
  color: #f2f6fc;
  margin: 0;
}

.music-search-result .hint {
  margin: 0.35rem 0 0;
}

.music-provider-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.9rem;
}

.music-provider-links a {
  text-decoration: none;
}

.music-section-heading {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.music-section-heading h2,
.music-section-heading h3,
.selected-playlist h3 {
  color: #f2f6fc;
  margin: 0;
}

.music-section-heading h2 {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.music-section-heading h3 {
  font-size: 1.15rem;
}

.music-page .hint {
  color: #a9b7ce;
}

.music-page .message {
  min-height: 1.3em;
}

.music-page .message.error {
  color: #ff9ca8;
}

.soundcloud-player {
  aspect-ratio: 16 / 6;
  background: #0b1220;
  border: 1px solid #26354d;
  border-radius: 14px;
  display: grid;
  min-height: 190px;
  overflow: hidden;
  place-items: center;
}

.soundcloud-player iframe {
  border: 0;
  height: 100%;
  min-height: 190px;
  width: 100%;
}

.soundcloud-player > .hint {
  padding: 1rem;
}

.music-discovery-link {
  align-items: center;
  border: 1px solid rgba(156, 177, 219, 0.28);
  border-radius: 10px;
  color: #8bd9f4;
  display: inline-flex;
  min-height: 42px;
  padding: 0.5rem 0.8rem;
  text-decoration: none;
}

.music-track-form,
.music-create-form {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.music-track-form-row {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: minmax(0, 1fr) auto;
}

.music-track-form-row input {
  min-width: 0;
  width: 100%;
}

.music-track-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.music-track-actions label {
  margin-left: 0.2rem;
}

.music-track-actions select {
  min-width: 180px;
}

.music-library-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.music-library-section {
  min-width: 0;
}

.music-usage {
  color: #91a1ba;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.music-list {
  display: grid;
  gap: 0.65rem;
}

.music-list-item {
  align-items: center;
  background: #101a2e;
  border: 1px solid #293a59;
  border-radius: 12px;
  display: flex;
  gap: 0.8rem;
  justify-content: space-between;
  min-width: 0;
  padding: 0.75rem;
}

.music-list-item > a,
.music-playlist-items a {
  color: #8bd9f4;
  min-width: 0;
  overflow-wrap: anywhere;
}

.music-playlist-card > div:first-child {
  min-width: 0;
}

.music-playlist-card p {
  margin: 0.2rem 0 0;
}

.music-item-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.music-item-actions button {
  min-height: 38px;
  padding: 0.45rem 0.7rem;
}

.selected-playlist {
  border-top: 1px solid #293a59;
  margin-top: 1rem;
  padding-top: 1rem;
}

.music-playlist-items {
  display: grid;
  gap: 0.55rem;
  list-style-position: inside;
  margin: 0.75rem 0 0;
  padding: 0;
}

.music-playlist-items li {
  align-items: center;
  background: #101a2e;
  border: 1px solid #293a59;
  border-radius: 10px;
  display: flex;
  gap: 0.6rem;
  justify-content: space-between;
  padding: 0.55rem;
}

.music-page [hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .music-library-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .music-header {
    align-items: flex-start;
  }

  .music-header nav {
    align-self: flex-start;
    margin: 0;
  }
}

@media (max-width: 520px) {
  .music-search-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .music-search-form button {
    width: 100%;
  }

  .music-track-form-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .music-track-form-row button {
    width: 100%;
  }

  .music-section-heading,
  .music-list-item,
  .music-playlist-items li {
    align-items: flex-start;
    flex-direction: column;
  }

  .music-item-actions {
    width: 100%;
  }

  .music-item-actions button {
    flex: 1 1 auto;
  }

  .music-track-actions select {
    flex: 1 1 100%;
    min-width: 0;
  }

  .soundcloud-player {
    aspect-ratio: 4 / 3;
  }
}
