/* Reusable controls, cards, feedback and data-display components. */

/* Buttons ------------------------------------------------------------- */
.btn,
.button {
  position: relative;
  display: inline-block;
  min-height: 60px;
  min-height: var(--control-height, 60px);
  padding: 16px 26px;
  border: 1px solid #4a5260;
  border-color: var(--color-control-border, #4a5260);
  border-radius: 10px;
  border-radius: var(--radius-md, 10px);
  background: #282d37;
  background: var(--color-surface-soft, #282d37);
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
  font-size: 19px;
  font-size: var(--font-size-md, 19px);
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  white-space: nowrap;
  -webkit-transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, -webkit-transform 120ms ease-out, -webkit-box-shadow 120ms ease-out;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out, box-shadow 120ms ease-out;
}

.btn:hover,
.button:hover,
.btn:focus,
.button:focus,
.btn.is-focused,
.button.is-focused {
  border-color: #7d8fbf;
  background: #303641;
  background: var(--color-surface-hover, #303641);
  color: #ffffff;
  -webkit-box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  box-shadow: var(--shadow-control, 0 8px 22px rgba(0, 0, 0, 0.24));
}

.btn:active,
.button:active {
  -webkit-box-shadow: none;
  box-shadow: none;
  -webkit-transform: translateY(1px);
  transform: translateY(1px);
}

.btn[disabled],
.button[disabled],
.btn[aria-disabled="true"],
.button[aria-disabled="true"] {
  border-color: #333945;
  border-color: var(--color-border, #333945);
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
  color: #929aa7;
  color: var(--color-text-muted, #929aa7);
  -webkit-box-shadow: none;
  box-shadow: none;
  -webkit-transform: none;
  transform: none;
}

.btn-primary,
.button-primary {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #7189d8;
  background: var(--color-accent, #7189d8);
  color: #0c0e13;
}

.btn-primary:hover,
.btn-primary:focus,
.button-primary:hover,
.button-primary:focus {
  border-color: #93a8ec;
  border-color: var(--color-accent-strong, #93a8ec);
  background: #8299e3;
  background: var(--color-accent-hover, #8299e3);
  color: #090b0e;
}

.btn-secondary,
.button-secondary {
  border-color: #4e5665;
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
}

.btn-ghost,
.button-ghost {
  border-color: transparent;
  background: transparent;
  color: #c5cad2;
  color: var(--color-text-soft, #c5cad2);
}

.btn-ghost:hover,
.btn-ghost:focus,
.button-ghost:hover,
.button-ghost:focus {
  border-color: #333945;
  border-color: var(--color-border, #333945);
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
}

.btn-gold {
  border-color: #c7a96a;
  border-color: var(--color-gold, #c7a96a);
  background: rgba(199, 169, 106, 0.18);
  background: var(--color-gold-soft, rgba(199, 169, 106, 0.18));
  color: #e7d3a8;
}

.btn-danger {
  border-color: #c66f77;
  border-color: var(--color-danger, #c66f77);
  background: rgba(198, 111, 119, 0.18);
  background: var(--color-danger-soft, rgba(198, 111, 119, 0.18));
  color: #efc1c5;
}

.btn-success {
  border-color: #66aa86;
  border-color: var(--color-success, #66aa86);
  background: rgba(102, 170, 134, 0.18);
  background: var(--color-success-soft, rgba(102, 170, 134, 0.18));
  color: #bce1cc;
}

.btn-small,
.btn-sm {
  min-height: 48px;
  min-height: var(--control-height-sm, 48px);
  padding: 10px 18px;
  font-size: 16px;
  line-height: 26px;
}

.btn-large,
.btn-lg {
  min-height: 64px;
  padding: 18px 32px;
  font-size: 21px;
  line-height: 26px;
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-icon,
.button-icon {
  display: inline-block;
  margin-right: 9px;
  font-size: 24px;
  font-size: var(--control-icon-size, 24px);
  line-height: 1;
  vertical-align: -0.12em;
}

.button-note {
  display: block;
  margin-top: 1px;
  color: inherit;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.1;
  opacity: 0.82;
}

.icon-btn {
  display: inline-block;
  width: 60px;
  width: var(--control-height, 60px);
  min-width: 60px;
  min-width: var(--control-height, 60px);
  height: 60px;
  height: var(--control-height, 60px);
  padding: 0;
  border: 1px solid #4a5260;
  border-color: var(--color-control-border, #4a5260);
  border-radius: 10px;
  border-radius: var(--radius-md, 10px);
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
  font-size: 24px;
  font-size: var(--control-icon-size, 24px);
  line-height: 58px;
  text-align: center;
  vertical-align: middle;
  -webkit-transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, -webkit-transform 120ms ease-out, -webkit-box-shadow 120ms ease-out;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out, box-shadow 120ms ease-out;
}

@supports (display: flex) {
  .icon-btn,
  .row-arrow,
  .favorite-button,
  .card-favorite,
  .card-quick-action,
  .empty-icon,
  .error-icon,
  .loading-icon,
  .pagination a,
  .pagination button {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    line-height: 1;
  }
}

.icon-btn:hover,
.icon-btn:focus,
.icon-btn.is-focused {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #303641;
  background: var(--color-surface-hover, #303641);
  -webkit-box-shadow: 0 8px 22px rgba(0, 0, 0, 0.24);
  box-shadow: var(--shadow-control, 0 8px 22px rgba(0, 0, 0, 0.24));
}

.icon-btn.active,
.icon-btn.is-active,
.icon-btn[aria-pressed="true"] {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: rgba(113, 137, 216, 0.18);
  background: var(--color-accent-soft, rgba(113, 137, 216, 0.18));
  color: #d9e0fa;
}

.icon-btn:active {
  -webkit-box-shadow: none;
  box-shadow: none;
  -webkit-transform: translateY(1px);
  transform: translateY(1px);
}

.icon-btn[disabled],
.icon-btn[aria-disabled="true"] {
  border-color: #333945;
  border-color: var(--color-border, #333945);
  background: #181b21;
  background: var(--color-surface, #181b21);
  color: #6f7783;
  color: var(--color-text-dim, #6f7783);
  -webkit-box-shadow: none;
  box-shadow: none;
  -webkit-transform: none;
  transform: none;
}

.profile-button,
.avatar {
  overflow: hidden;
  border-radius: 999px;
  border-radius: var(--radius-round, 999px);
}

@supports (display: flex) {
  .avatar {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    line-height: 1;
  }
}

.avatar {
  display: inline-block;
  width: 46px;
  height: 46px;
  background: #7189d8;
  background: var(--color-accent, #7189d8);
  color: #101216;
  font-size: 18px;
  font-weight: 800;
  line-height: 46px;
  text-align: center;
  vertical-align: middle;
}

.row-arrow {
  width: 52px;
  min-width: 52px;
  height: 52px;
  min-height: 52px;
  padding: 0;
  line-height: 50px;
}

/* Forms --------------------------------------------------------------- */
.field,
.form-field {
  display: inline-block;
  width: 100%;
  margin-bottom: 22px;
  font-size: 19px;
  vertical-align: top;
}

.field-label,
.form-label {
  display: block;
  margin-bottom: 9px;
  color: #c5cad2;
  color: var(--color-text-soft, #c5cad2);
  font-size: 17px;
  font-weight: 700;
}

.field-help,
.form-help {
  display: block;
  margin-top: 8px;
  color: #929aa7;
  color: var(--color-text-muted, #929aa7);
  font-size: 15px;
  line-height: 1.45;
}

.input,
.select,
.textarea,
.form-control,
input[type="text"],
input[type="search"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="file"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 60px;
  min-height: var(--control-height, 60px);
  padding: 14px 18px;
  border: 1px solid #414855;
  border-radius: 10px;
  border-radius: var(--radius-md, 10px);
  background: #181b21;
  background: var(--color-surface, #181b21);
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
  font-size: 19px;
  line-height: 1.35;
  -webkit-transition: border-color 120ms ease-out, background-color 120ms ease-out;
  transition: border-color 120ms ease-out, background-color 120ms ease-out;
}

input[type="search"] {
  -webkit-appearance: none;
  appearance: none;
}

input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  display: none;
  -webkit-appearance: none;
}

input[type="file"] {
  padding-top: 14px;
}

textarea,
.textarea {
  min-height: 160px;
  line-height: 1.5;
}

.input:hover,
.select:hover,
.textarea:hover,
.form-control:hover,
input:hover,
select:hover,
textarea:hover {
  border-color: #5a6373;
}

.compact-select {
  width: auto;
  min-width: 220px;
  min-height: 60px;
  min-height: var(--control-height, 60px);
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 16px;
}

.input:focus,
.select:focus,
.textarea:focus,
.form-control:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
}

.input[disabled],
.select[disabled],
.textarea[disabled],
.form-control[disabled],
input[disabled],
select[disabled],
textarea[disabled] {
  border-color: #333945;
  border-color: var(--color-border, #333945);
  background: #15181d;
  color: #6f7783;
  color: var(--color-text-dim, #6f7783);
}

.input[readonly],
.textarea[readonly],
.form-control[readonly],
input[readonly],
textarea[readonly] {
  border-color: #333945;
  border-color: var(--color-border, #333945);
  background: #181b21;
  background: var(--color-surface, #181b21);
  color: #c5cad2;
  color: var(--color-text-soft, #c5cad2);
}

input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
  color: #6f7783;
  color: var(--color-text-dim, #6f7783);
}

input::-moz-placeholder,
textarea::-moz-placeholder {
  color: #6f7783;
  color: var(--color-text-dim, #6f7783);
  opacity: 1;
}

input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
  color: #6f7783;
}

.field.is-error .input,
.field.is-error .select,
.field.is-error .textarea,
.input.is-error {
  border-color: #c66f77;
  border-color: var(--color-danger, #c66f77);
}

.field-error {
  display: block;
  margin-top: 8px;
  color: #df9ca2;
  font-size: 15px;
}

.search-input-wrap,
.input-with-icon {
  position: relative;
}

.search-input-wrap .input,
.search-input-wrap input,
.input-with-icon .input {
  padding-left: 56px;
}

.search-input-icon,
.input-icon {
  position: absolute;
  top: 50%;
  left: 18px;
  z-index: 2;
  width: 24px;
  height: 24px;
  margin-top: -12px;
  color: #929aa7;
  color: var(--color-text-muted, #929aa7);
  font-size: 24px;
  line-height: 24px;
  pointer-events: none;
}

.search-input-wrap .clear-input,
.input-with-action .input-action {
  position: absolute;
  top: 50%;
  right: 6px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  margin-top: -24px;
}

.checkbox-row,
.radio-row,
.toggle-row {
  display: block;
  min-height: 56px;
  padding: 14px 0;
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
}

.checkbox-row input,
.radio-row input {
  display: inline-block;
  width: 24px;
  height: 24px;
  min-height: 0;
  margin-right: 12px;
  padding: 0;
  vertical-align: -5px;
}

@supports (display: flex) {
  .checkbox-row,
  .radio-row,
  .toggle-row {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
  }

  .checkbox-row input,
  .radio-row input {
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 24px;
    flex: 0 0 24px;
    vertical-align: middle;
  }
}

.switch {
  position: relative;
  display: inline-block;
  width: 64px;
  height: 36px;
  vertical-align: middle;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.switch-track {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border: 2px solid #4a5260;
  border-radius: 999px;
  background: #282d37;
}

.switch-track:after {
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c5cad2;
  content: "";
  -webkit-transition: left 120ms ease-out, background-color 120ms ease-out;
  transition: left 120ms ease-out, background-color 120ms ease-out;
}

.switch input:checked + .switch-track {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #7189d8;
  background: var(--color-accent, #7189d8);
}

.switch input:checked + .switch-track:after {
  left: 33px;
  background: #ffffff;
}

.switch input:focus + .switch-track {
  outline: 3px solid #aab9f3;
  outline: 3px solid var(--color-focus, #aab9f3);
  outline-offset: 3px;
  -webkit-box-shadow: 0 0 0 4px rgba(170, 185, 243, 0.46);
  box-shadow: var(--focus-ring, 0 0 0 4px rgba(170, 185, 243, 0.46));
}

/* Text-pill fallback used by the static settings markup. */
.checkbox-row.switch {
  width: auto;
  height: auto;
  min-height: 48px;
  padding: 4px 0;
}

.switch > span:not(.switch-track) {
  display: block;
  min-width: 96px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid #4a5260;
  border-radius: 999px;
  background: #282d37;
  color: #c5cad2;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}

.switch input:checked + span:not(.switch-track) {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: rgba(113, 137, 216, 0.18);
  background: var(--color-accent-soft, rgba(113, 137, 216, 0.18));
  color: #f1f3f6;
}

.switch input:focus + span:not(.switch-track) {
  outline: 3px solid #aab9f3;
  outline: 3px solid var(--color-focus, #aab9f3);
  outline-offset: 3px;
  -webkit-box-shadow: 0 0 0 4px rgba(170, 185, 243, 0.46);
  box-shadow: var(--focus-ring, 0 0 0 4px rgba(170, 185, 243, 0.46));
}

.switch input[disabled] + .switch-track,
.switch input[disabled] + span:not(.switch-track) {
  cursor: default;
  opacity: 0.55;
}

/* Badges, filters and progress --------------------------------------- */
.badge,
.chip,
.status-pill,
.quality-badge {
  display: inline-block;
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid #414855;
  border-radius: 999px;
  border-radius: var(--radius-round, 999px);
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
  color: #c5cad2;
  color: var(--color-text-soft, #c5cad2);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  vertical-align: middle;
  white-space: nowrap;
}

.quality-badge,
.badge-accent,
.badge.is-active,
.status-pill.is-active,
.chip.active,
.chip.is-active,
.chip[aria-pressed="true"] {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: rgba(113, 137, 216, 0.18);
  background: var(--color-accent-soft, rgba(113, 137, 216, 0.18));
  color: #d9e0fa;
}

.badge-gold,
.status-favorite {
  border-color: #c7a96a;
  border-color: var(--color-gold, #c7a96a);
  background: rgba(199, 169, 106, 0.18);
  background: var(--color-gold-soft, rgba(199, 169, 106, 0.18));
  color: #e8d5ad;
}

.badge-success,
.status-ready,
.status-watched {
  border-color: #66aa86;
  border-color: var(--color-success, #66aa86);
  background: rgba(102, 170, 134, 0.18);
  background: var(--color-success-soft, rgba(102, 170, 134, 0.18));
  color: #bee1cd;
}

.badge-warning,
.status-processing {
  border-color: #d0a65d;
  border-color: var(--color-warning, #d0a65d);
  background: rgba(208, 166, 93, 0.18);
  background: var(--color-warning-soft, rgba(208, 166, 93, 0.18));
  color: #ead2a6;
}

.badge-danger,
.status-error {
  border-color: #c66f77;
  border-color: var(--color-danger, #c66f77);
  background: rgba(198, 111, 119, 0.18);
  background: var(--color-danger-soft, rgba(198, 111, 119, 0.18));
  color: #efc1c5;
}

.chip {
  min-height: 48px;
  padding: 13px 18px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
}

.chip:hover,
.chip:focus {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #303641;
  background: var(--color-surface-hover, #303641);
}

.chip:active {
  -webkit-transform: translateY(1px);
  transform: translateY(1px);
}

.chip[disabled],
.chip[aria-disabled="true"] {
  border-color: #333945;
  border-color: var(--color-border, #333945);
  background: #181b21;
  background: var(--color-surface, #181b21);
  color: #6f7783;
  color: var(--color-text-dim, #6f7783);
  -webkit-transform: none;
  transform: none;
}

.chip-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chip-list > * {
  display: inline-block;
  margin: 0 8px 8px 0;
}

.chip-clear {
  border-color: #75444a;
  color: #efc1c5;
}

.segmented-control,
.tabs,
.season-tabs {
  display: inline-block;
  padding: 5px;
  border: 1px solid #333945;
  border: 1px solid var(--color-border, #333945);
  border-radius: 10px;
  background: #181b21;
  background: var(--color-surface, #181b21);
  font-size: 0;
  white-space: nowrap;
}

.segmented-control > *,
.tabs > *,
.season-tabs > * {
  display: inline-block;
  min-height: 50px;
  margin: 0 3px;
  padding: 13px 20px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: #c5cad2;
  color: var(--color-text-soft, #c5cad2);
  font-size: 16px;
  font-weight: 700;
  line-height: 22px;
  vertical-align: middle;
  -webkit-transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
}

.segmented-control > *:hover,
.segmented-control > *:focus,
.tabs > *:hover,
.tabs > *:focus,
.season-tabs > *:hover,
.season-tabs > *:focus {
  border-color: #4a5260;
  border-color: var(--color-control-border, #4a5260);
  background: #282d37;
  background: var(--color-surface-soft, #282d37);
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
}

.segmented-control > *.active,
.segmented-control > *.is-active,
.segmented-control > *[aria-selected="true"],
.segmented-control > *[aria-pressed="true"],
.tabs > *.active,
.tabs > *.is-active,
.tabs > *[aria-selected="true"],
.season-tabs > *.active,
.season-tabs > *.is-active,
.season-tabs > *[aria-selected="true"] {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: rgba(113, 137, 216, 0.18);
  background: var(--color-accent-soft, rgba(113, 137, 216, 0.18));
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
}

.progress-bar,
.card-progress,
.disk-meter,
.upload-progress {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  border-radius: var(--radius-round, 999px);
  background: #333945;
  background: var(--color-border, #333945);
  -webkit-box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.38);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.38);
}

.progress-bar > span,
.progress-bar > i,
.card-progress > span,
.card-progress > i,
.disk-meter > span,
.disk-meter > i,
.upload-progress > span,
.upload-progress > i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #7189d8;
  background: var(--color-accent, #7189d8);
  -webkit-transition: width 180ms ease-out;
  transition: width 180ms ease-out;
}

.progress-bar.is-complete > span,
.progress-bar.is-complete > i {
  background: #66aa86;
  background: var(--color-success, #66aa86);
}

.progress-labels {
  display: block;
  margin-top: 8px;
  color: #929aa7;
  color: var(--color-text-muted, #929aa7);
  font-size: 15px;
}

@supports (display: flex) {
  .progress-labels {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
  }
}

/* Media card ---------------------------------------------------------- */
.media-card,
.card {
  position: relative;
  min-width: 0;
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
  vertical-align: top;
}

.card-link,
.media-card-inner {
  position: relative;
  display: block;
  overflow: visible;
  border: 2px solid transparent;
  border-radius: 12px;
  border-radius: var(--radius-card, 12px);
  background: #181b21;
  background: var(--color-surface, #181b21);
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
  -webkit-box-shadow: 0 5px 16px rgba(0, 0, 0, 0.24);
  box-shadow: var(--shadow-sm, 0 5px 16px rgba(0, 0, 0, 0.24));
  -webkit-transition: border-color 120ms ease-out, background-color 120ms ease-out, -webkit-transform 120ms ease-out, -webkit-box-shadow 120ms ease-out;
  transition: border-color 120ms ease-out, background-color 120ms ease-out, transform 120ms ease-out, box-shadow 120ms ease-out;
}

.media-card:hover .card-link,
.media-card:hover .media-card-inner,
.media-card:focus .card-link,
.media-card:focus .media-card-inner,
.media-card.is-focused .card-link,
.media-card.is-focused .media-card-inner,
.card-link:hover,
.card-link:focus,
.media-card-inner:hover,
.media-card-inner:focus {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
  color: #ffffff;
  -webkit-box-shadow: 0 14px 40px rgba(4, 6, 10, 0.62);
  box-shadow: var(--shadow-focus, 0 14px 40px rgba(4, 6, 10, 0.62));
  -webkit-transform: scale(1.018);
  transform: scale(1.018);
}

.card-link:focus,
.media-card-inner:focus {
  outline-offset: 2px;
}

.poster-wrap,
.card-poster,
.poster-placeholder {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 0;
  padding-top: 150%;
  padding-top: var(--poster-ratio, 150%);
  border-radius: 10px 10px 0 0;
  background: #282d37;
  background: var(--color-surface-soft, #282d37);
}

.poster-wrap img,
.card-poster img,
.poster-placeholder img,
.poster-image {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-placeholder:before {
  position: absolute;
  top: 12%;
  right: 12%;
  bottom: 12%;
  left: 12%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  content: "";
}

.poster-placeholder:after {
  position: absolute;
  top: 50%;
  right: 16px;
  left: 16px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  content: attr(data-title);
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}

.poster-tone-1 { background: #273852; background: linear-gradient(145deg, #243247, #54516a); }
.poster-tone-2 { background: #314449; background: linear-gradient(145deg, #263a3c, #59645c); }
.poster-tone-3 { background: #4b353d; background: linear-gradient(145deg, #3b2933, #76504c); }
.poster-tone-4 { background: #3b3654; background: linear-gradient(145deg, #302d4a, #625776); }
.poster-tone-5 { background: #4a4131; background: linear-gradient(145deg, #3b3629, #74664c); }
.poster-tone-6 { background: #29444d; background: linear-gradient(145deg, #263d47, #4d6c70); }
.poster-tone-7 { background: #3b454e; background: linear-gradient(145deg, #2c3943, #56606c); }
.poster-tone-8 { background: #543d37; background: linear-gradient(145deg, #40302d, #735c4f); }
.poster-tone-9 { background: #2d3e57; background: linear-gradient(145deg, #26344c, #4b6274); }
.poster-tone-10 { background: #493550; background: linear-gradient(145deg, #372c44, #6c4f68); }
.poster-tone-11 { background: #35483c; background: linear-gradient(145deg, #283c35, #57705b); }
.poster-tone-12 { background: #4f4936; background: linear-gradient(145deg, #3c3a2e, #736c4f); }

/* Numbered aliases used by demo data. All artwork remains local CSS. */
.poster-01 { background: #273852; background: linear-gradient(145deg, #1d2a3d 0%, #40577b 58%, #696076 100%); }
.poster-02 { background: #314449; background: linear-gradient(145deg, #203638 0%, #4e6561 62%, #7b7560 100%); }
.poster-03 { background: #4b353d; background: linear-gradient(145deg, #31232d 0%, #684448 60%, #9b725d 100%); }
.poster-04 { background: #3b3654; background: linear-gradient(145deg, #282541 0%, #554b72 58%, #79718c 100%); }
.poster-05 { background: #4a4131; background: linear-gradient(145deg, #302d23 0%, #655b43 62%, #8d7e5c 100%); }
.poster-06 { background: #29444d; background: linear-gradient(145deg, #1c353e 0%, #40626b 60%, #668282 100%); }
.poster-07 { background: #3b454e; background: linear-gradient(145deg, #25323c 0%, #4c5b69 57%, #777f86 100%); }
.poster-08 { background: #543d37; background: linear-gradient(145deg, #352824 0%, #6c4e43 60%, #92735a 100%); }
.poster-09 { background: #2d3e57; background: linear-gradient(145deg, #1e2e47 0%, #415d7c 58%, #6e8293 100%); }
.poster-10 { background: #493550; background: linear-gradient(145deg, #30243c 0%, #644b69 62%, #8b7186 100%); }
.poster-11 { background: #35483c; background: linear-gradient(145deg, #22362e 0%, #4c6955 62%, #71846d 100%); }
.poster-12 { background: #4f4936; background: linear-gradient(145deg, #333126 0%, #6d674a 60%, #94865e 100%); }
.poster-13 { background: #314254; background: linear-gradient(155deg, #222d3a 0%, #52627a 54%, #5f504f 100%); }
.poster-14 { background: #533a48; background: linear-gradient(155deg, #372733 0%, #704f61 58%, #8e765e 100%); }
.poster-15 { background: #30494a; background: linear-gradient(155deg, #213434 0%, #4f6c6c 58%, #7c8270 100%); }
.poster-16 { background: #48405b; background: linear-gradient(155deg, #302b43 0%, #635979 60%, #8d7a80 100%); }
.poster-17 { background: #564536; background: linear-gradient(155deg, #392e25 0%, #735d45 58%, #9c825f 100%); }

.poster-art,
.poster-initials,
.poster-title-art,
.poster-placeholder > span:first-child {
  position: absolute;
  top: 50%;
  right: 18px;
  left: 18px;
  z-index: 2;
  color: rgba(255, 255, 255, 0.84);
  font-size: 27px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.16;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.42);
  text-transform: uppercase;
  -webkit-transform: translateY(-50%);
  transform: translateY(-50%);
}

.poster-wrap > .poster-placeholder,
.card-poster > .poster-placeholder {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding-top: 0;
  border-radius: inherit;
}

.favorite-mark,
.watched-mark {
  display: inline-block;
  min-width: 32px;
  height: 32px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(9, 11, 14, 0.82);
  color: #f1d897;
  font-size: 17px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  vertical-align: middle;
}

@supports (display: flex) {
  .favorite-mark,
  .watched-mark {
    display: -webkit-inline-box;
    display: -webkit-inline-flex;
    display: inline-flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    line-height: 1;
  }
}

.poster-wrap > .favorite-mark,
.poster-wrap > .watched-mark,
.episode-thumb > .favorite-mark,
.episode-thumb > .watched-mark,
.list-thumb > .favorite-mark,
.list-thumb > .watched-mark {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}

.episode-thumb > .status-pill,
.list-thumb > .status-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
}

.watched-mark {
  border-color: #66aa86;
  border-color: var(--color-success, #66aa86);
  background: rgba(31, 66, 48, 0.9);
  color: #d6f2e0;
}

.poster-wrap > .badge,
.card-poster > .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
}

.card-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: auto;
  left: 0;
  overflow: hidden;
  height: 0;
  min-height: 0;
  padding: 150% 12px 0;
  padding-top: var(--poster-ratio, 150%);
  border-radius: 10px 10px 0 0;
  background: rgba(9, 11, 14, 0.72);
  background: linear-gradient(to bottom, rgba(9, 11, 14, 0), rgba(9, 11, 14, 0.92));
  pointer-events: none;
}

.card-overlay > span {
  position: absolute;
  right: 12px;
  bottom: 14px;
  left: 12px;
  color: #f1f3f6;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.card-badges,
.card-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
}

@supports (display: flex) {
  .card-badges {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
  }
}

.card-status {
  right: 12px;
  left: auto;
  max-width: 85%;
  overflow: hidden;
  padding: 6px 10px;
  border: 1px solid #4a5260;
  border-color: var(--color-control-border, #4a5260);
  border-radius: 999px;
  border-radius: var(--radius-round, 999px);
  background: rgba(9, 11, 14, 0.88);
  color: #f1f3f6;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-badges > *,
.card-status > * {
  margin-right: 5px;
  margin-bottom: 5px;
}

.card-badges > *:last-child,
.card-status > *:last-child {
  margin-right: 0;
}

.favorite-button,
.card-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: #181b21;
  background: rgba(24, 27, 33, 0.88);
  color: #f1f3f6;
  font-size: 22px;
  line-height: 46px;
  text-align: center;
  -webkit-transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, -webkit-transform 120ms ease-out;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out;
}

.favorite-button:hover,
.favorite-button:focus,
.card-favorite:hover,
.card-favorite:focus,
.card-quick-action:hover,
.card-quick-action:focus {
  border-color: #c7a96a;
  border-color: var(--color-gold, #c7a96a);
  background: #38301f;
  color: #f1d897;
}

.favorite-button:active,
.card-favorite:active,
.card-quick-action:active {
  -webkit-transform: translateY(1px);
  transform: translateY(1px);
}

.media-card.is-favorite .favorite-button,
.media-card.is-favorite .card-favorite,
.favorite-button.active,
.favorite-button[aria-pressed="true"] {
  border-color: #c7a96a;
  border-color: var(--color-gold, #c7a96a);
  background: #54482e;
  color: #f1d897;
}

.card-progress {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  z-index: 4;
  width: auto;
  height: 6px;
  background: rgba(255, 255, 255, 0.28);
}

.card-body {
  min-height: 100px;
  padding: 15px 14px 16px;
}

.card-title {
  display: block;
  overflow: hidden;
  margin: 0 0 7px;
  color: #f1f3f6;
  color: var(--color-text, #f1f3f6);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta,
.card-subtitle {
  display: block;
  overflow: hidden;
  color: #929aa7;
  color: var(--color-text-muted, #929aa7);
  font-size: 15px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-submeta {
  display: block;
  overflow: hidden;
  margin: 5px 0 0;
  color: #7189d8;
  color: var(--color-accent, #7189d8);
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-quick-action {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 8;
  width: 48px;
  min-width: 48px;
  height: 48px;
  min-height: 48px;
  padding: 0;
  border: 1px solid #c7a96a;
  border-color: var(--color-gold, #c7a96a);
  border-radius: 50%;
  background: rgba(9, 11, 14, 0.88);
  color: #f1d897;
  font-size: 22px;
  line-height: 46px;
  text-align: center;
  -webkit-transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, -webkit-transform 120ms ease-out;
  transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out, transform 120ms ease-out;
}

.favorite-toggle[aria-pressed="true"] {
  border-color: #c7a96a;
  border-color: var(--color-gold, #c7a96a);
  color: #f1d897;
}

.watched-toggle[aria-pressed="true"] {
  border-color: #66aa86;
  border-color: var(--color-success, #66aa86);
  color: #bee1cd;
}

.card-meta > span:after {
  margin: 0 6px;
  color: #59616d;
  content: "\2022";
}

.card-meta > span:last-child:after {
  display: none;
}

.media-card.is-processing .poster-wrap,
.media-card.is-processing .card-poster {
  opacity: 0.76;
}

.media-card.has-error .card-link,
.media-card.has-error .media-card-inner {
  border-color: #8e5057;
}

.status-overlay {
  position: absolute;
  right: 12px;
  bottom: 18px;
  left: 12px;
  z-index: 4;
  padding: 10px 12px;
  border-radius: 6px;
  background: rgba(9, 11, 14, 0.9);
  color: #f1f3f6;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
}

/* Panels, feedback and utility components ---------------------------- */
.panel,
.surface-card {
  padding: 28px;
  border: 1px solid #333945;
  border: 1px solid var(--color-border, #333945);
  border-radius: 16px;
  border-radius: var(--radius-lg, 16px);
  background: #181b21;
  background: var(--color-surface, #181b21);
  -webkit-box-shadow: 0 5px 16px rgba(0, 0, 0, 0.24);
  box-shadow: var(--shadow-sm, 0 5px 16px rgba(0, 0, 0, 0.24));
}

.panel-title {
  margin-bottom: 20px;
  font-size: 24px;
}

.alert,
.notice {
  margin-bottom: 22px;
  padding: 17px 20px;
  border: 1px solid #414855;
  border-radius: 10px;
  background: #20242c;
  color: #c5cad2;
  line-height: 1.5;
}

.alert-success { border-color: #66aa86; background: #192a22; color: #bee1cd; }
.alert-warning { border-color: #d0a65d; background: #2c271a; color: #ead2a6; }
.alert-error { border-color: #c66f77; background: #2d1d20; color: #efc1c5; }
.alert-info { border-color: #73a7c7; background: #19262d; color: #c1dce9; }

.breadcrumb {
  margin: 0 0 24px;
  padding: 0;
  color: #929aa7;
  list-style: none;
}

.breadcrumb li {
  display: inline-block;
  font-size: 16px;
}

.breadcrumb li:after {
  margin: 0 10px;
  color: #6f7783;
  content: "/";
}

.breadcrumb li:last-child:after {
  display: none;
}

.empty-state,
.error-state,
.loading-state,
.no-results {
  width: 100%;
  min-height: 320px;
  padding: 68px 32px;
  border: 1px dashed #414855;
  border-radius: 16px;
  border-radius: var(--radius-lg, 16px);
  background: #181b21;
  background: var(--color-surface, #181b21);
  color: #929aa7;
  color: var(--color-text-muted, #929aa7);
  text-align: center;
}

.empty-icon,
.error-icon,
.loading-icon {
  display: block;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  border: 1px solid #414855;
  border-radius: 50%;
  background: #20242c;
  color: #929aa7;
  font-size: 34px;
  line-height: 70px;
}

@supports (display: flex) {
  .empty-icon,
  .error-icon,
  .loading-icon {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    line-height: 1;
  }
}

.error-state,
.has-error-state {
  border-color: #75444a;
}

.error-state .error-icon {
  border-color: #c66f77;
  color: #df9ca2;
}

.empty-state h2,
.empty-state h3,
.error-state h2,
.error-state h3,
.loading-state h2,
.loading-state h3 {
  margin-bottom: 10px;
  color: #f1f3f6;
}

.empty-state p,
.error-state p,
.loading-state p {
  max-width: 620px;
  margin-right: auto;
  margin-bottom: 24px;
  margin-left: auto;
}

.loading-spinner {
  display: inline-block;
  width: 54px;
  height: 54px;
  margin-bottom: 20px;
  border: 5px solid #333945;
  border-top-color: #7189d8;
  border-top-color: var(--color-accent, #7189d8);
  border-radius: 50%;
  -webkit-animation: cinema-spin 900ms linear infinite;
  animation: cinema-spin 900ms linear infinite;
}

@-webkit-keyframes cinema-spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

@keyframes cinema-spin {
  to { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
}

.skeleton {
  border-radius: 6px;
  background: #282d37;
  background: var(--color-surface-soft, #282d37);
  color: transparent !important;
}

.is-loading .media-card,
.is-loading .interactive-content {
  pointer-events: none;
}

.toast-stack {
  position: fixed;
  right: 32px;
  bottom: 32px;
  z-index: 120;
  z-index: var(--z-toast, 120);
  width: 420px;
  max-width: 90%;
}

.toast {
  display: block;
  margin-top: 12px;
  padding: 18px 20px;
  border: 1px solid #4a5260;
  border-left: 5px solid #7189d8;
  border-left-color: var(--color-accent, #7189d8);
  border-radius: 10px;
  background: #20242c;
  background: var(--color-surface-raised, #20242c);
  color: #f1f3f6;
  -webkit-box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  box-shadow: var(--shadow-md, 0 12px 30px rgba(0, 0, 0, 0.32));
}

.toast-success { border-left-color: #66aa86; }
.toast-warning { border-left-color: #d0a65d; }
.toast-error { border-left-color: #c66f77; }

.toast-title {
  display: block;
  margin-bottom: 4px;
  font-weight: 700;
}

.toast-message {
  display: block;
  color: #c5cad2;
  color: var(--color-text-soft, #c5cad2);
  font-size: 16px;
}

.modal-backdrop {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 80;
  z-index: var(--z-overlay, 80);
  padding: 40px;
  overflow-y: auto;
  background: rgba(7, 9, 12, 0.9);
  text-align: center;
}

.modal-backdrop.is-open {
  display: block;
}

.modal {
  display: inline-block;
  width: 720px;
  max-width: 100%;
  margin: 5vh auto;
  padding: 32px;
  border: 1px solid #414855;
  border-radius: 16px;
  background: #20242c;
  text-align: left;
  vertical-align: middle;
  -webkit-box-shadow: 0 20px 54px rgba(0, 0, 0, 0.42);
  box-shadow: var(--shadow-lg, 0 20px 54px rgba(0, 0, 0, 0.42));
}

.modal-header,
.modal-footer {
  display: block;
}

@supports (display: flex) {
  .modal-header,
  .modal-footer {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: justify;
    -webkit-justify-content: space-between;
    justify-content: space-between;
  }
}

.modal-header {
  margin-bottom: 24px;
}

.modal-header h2,
.modal-header h3 {
  margin-bottom: 0;
}

.modal-footer {
  margin-top: 28px;
  -webkit-box-pack: end;
  -webkit-justify-content: flex-end;
  justify-content: flex-end;
}

.modal-footer > * {
  margin-left: 12px;
}

.modal-footer > *:first-child {
  margin-left: 0;
}

.pagination {
  margin: 28px 0 0;
  padding: 0;
  text-align: center;
  list-style: none;
}

.pagination li {
  display: inline-block;
  margin: 4px;
}

.pagination a,
.pagination button {
  display: block;
  min-width: 52px;
  min-height: 52px;
  padding: 13px 16px;
  border: 1px solid #414855;
  border-radius: 8px;
  background: #20242c;
  color: #f1f3f6;
  font-weight: 700;
}

@supports (display: flex) {
  .pagination a,
  .pagination button {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    justify-content: center;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 1;
  }
}

.pagination .active a,
.pagination .active button,
.pagination a[aria-current="page"] {
  border-color: #7189d8;
  background: rgba(113, 137, 216, 0.18);
}

.pagination a:hover,
.pagination a:focus,
.pagination button:hover,
.pagination button:focus {
  border-color: #7189d8;
  border-color: var(--color-accent, #7189d8);
  background: #303641;
  background: var(--color-surface-hover, #303641);
}

.no-js .requires-js,
.no-js .row-navigation,
.no-js .keyboard-panel,
.no-js .toast-stack {
  display: none !important;
}

.js .no-js-only {
  display: none !important;
}
