.is-epwatch-modal-open {
  overflow: hidden;
}

.epwatch-modal {
  position: fixed;
  z-index: 1450;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
}

.epwatch-modal[hidden] {
  display: none;
}

.epwatch-modal__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: rgba(4, 7, 12, .62);
  backdrop-filter: blur(12px);
}

.epwatch-modal__dialog {
  position: relative;
  overflow: hidden;
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  border: 1px solid var(--kh-line);
  border-radius: 25px;
  color: var(--kh-text);
  background: var(--kh-surface);
  box-shadow: var(--kh-shadow-lg);
  backdrop-filter: blur(30px) saturate(145%);
}

.epwatch-modal__dialog > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 28px 19px;
  border-bottom: 1px solid var(--kh-line);
}

.epwatch-modal__dialog header p {
  margin: 0 0 4px;
  color: var(--kh-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.epwatch-modal__dialog h2 {
  margin: 0;
  font-size: clamp(20px, 4vw, 27px);
}

.epwatch-modal__dialog header > button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--kh-line);
  border-radius: 50%;
  color: inherit;
  background: var(--kh-surface-soft);
  font-size: 25px;
  cursor: pointer;
}

.epwatch-modal__body {
  overflow: auto;
  max-height: calc(100vh - 210px);
  padding: 22px 28px;
}

.epwatch-modal__message {
  min-height: 20px;
  margin: 0;
  padding: 0 28px 22px;
  color: var(--kh-text-soft);
  font-size: 13px;
}

.epwatch-modal__message.is-error {
  color: var(--kh-danger);
}

.epwatch-modal__message.is-success {
  color: var(--kh-success);
}

.epwatch-loading {
  display: grid;
  min-height: 230px;
  place-items: center;
  align-content: center;
  color: var(--kh-text-soft);
}

.epwatch-loading span {
  width: 34px;
  height: 34px;
  border: 3px solid var(--kh-line-strong);
  border-top-color: var(--kh-accent);
  border-radius: 50%;
  animation: epwatch-spin .8s linear infinite;
}

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

.epwatch-current {
  margin-bottom: 24px;
}

.epwatch-current h3,
.epwatch-form h3 {
  margin: 0 0 13px;
  font-size: 17px;
}

.epwatch-current__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 1px solid var(--kh-line);
  border-radius: 14px;
  background: var(--kh-surface-solid);
}

.epwatch-current__item + .epwatch-current__item {
  margin-top: 8px;
}

.epwatch-current__item > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.epwatch-current__item strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epwatch-current__item small {
  margin-top: 3px;
  color: var(--kh-text-soft);
}

.epwatch-current__item button {
  border: 0;
  color: var(--kh-danger);
  background: transparent;
  font-weight: 750;
  cursor: pointer;
}

.epwatch-form {
  display: grid;
  gap: 14px;
}

.epwatch-field {
  display: grid;
  gap: 7px;
}

.epwatch-field[hidden] {
  display: none;
}

.epwatch-field > span {
  color: var(--kh-text-soft);
  font-size: 13px;
  font-weight: 750;
}

.epwatch-field select {
  width: 100%;
  min-height: 48px;
  padding: 0 42px 0 14px;
  border: 1px solid var(--kh-line-strong);
  border-radius: 13px;
  color: inherit;
  background: var(--kh-surface-solid);
  font: inherit;
}

.epwatch-form__hint {
  margin: 0;
  color: var(--kh-text-soft);
  font-size: 13px;
  line-height: 1.55;
}

.epwatch-submit,
.epwatch-connect button {
  min-height: 49px;
  padding: 0 20px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--kh-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.epwatch-submit:disabled,
.epwatch-connect button:disabled {
  opacity: .55;
}

.epwatch-connect {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.epwatch-connect__icon {
  display: grid;
  width: 58px;
  height: 58px;
  margin-bottom: 16px;
  place-items: center;
  border-radius: 18px;
  color: #fff;
  background: var(--kh-accent);
  font-size: 25px;
}

.epwatch-connect h3 {
  margin: 0;
  font-size: 21px;
}

.epwatch-connect p {
  max-width: 440px;
  margin: 10px 0 20px;
  color: var(--kh-text-soft);
  line-height: 1.55;
}

.card-action--notify {
  border-color: rgba(var(--kh-accent-rgb), .34);
}

[data-theme="dark"] .epwatch-modal__dialog,
.theme-dark .epwatch-modal__dialog {
  color: var(--kh-text);
  background: var(--kh-surface-solid);
}

[data-theme="dark"] .epwatch-field select {
  background: var(--kh-surface-soft);
}

@media (max-width: 620px) {
  .epwatch-modal {
    padding: 0;
    place-items: end center;
  }

  .epwatch-modal__dialog {
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
  }

  .epwatch-modal__dialog > header,
  .epwatch-modal__body {
    padding-right: 20px;
    padding-left: 20px;
  }

  .epwatch-modal__message {
    padding-right: 20px;
    padding-left: 20px;
  }
}

.epwatch-cabinet-heading {
  align-items: center;
}

.epwatch-refresh,
.epwatch-cabinet-section__head button {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--kh-line);
  border-radius: 11px;
  color: inherit;
  background: transparent;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

.epwatch-account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 28px;
  border: 1px solid var(--kh-line);
  border-radius: 20px;
  background: var(--kh-surface-solid);
}

.epwatch-account-card.is-linked {
  border-color: color-mix(in srgb, var(--kh-success) 26%, var(--kh-line));
  background: color-mix(in srgb, var(--kh-success) 6%, var(--kh-surface-solid));
}

.epwatch-account-card__copy {
  min-width: 0;
}

.epwatch-account-card__status {
  color: var(--kh-accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.epwatch-account-card.is-linked .epwatch-account-card__status {
  color: var(--kh-success);
}

.epwatch-account-card h2 {
  margin: 6px 0 7px;
  font-size: 21px;
}

.epwatch-account-card p {
  max-width: 660px;
  margin: 0;
  color: var(--kh-text-soft);
  line-height: 1.5;
}

.epwatch-link-button {
  min-width: 145px;
  min-height: 45px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: var(--kh-accent);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.epwatch-link-button.is-danger {
  color: #a13b42;
  border: 1px solid rgb(161 59 66 / 22%);
  background: transparent;
}

.epwatch-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 8px;
}

.epwatch-stats article {
  display: flex;
  min-height: 92px;
  padding: 18px 20px;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--kh-line);
  border-radius: 17px;
  background: var(--catalog-surface, #fff);
}

.epwatch-stats strong {
  font-size: 27px;
}

.epwatch-stats span {
  color: var(--kh-text-soft);
  font-size: 13px;
}

.epwatch-cabinet-message {
  min-height: 22px;
  margin: 8px 0;
  color: var(--kh-text-soft);
  font-size: 13px;
}

.epwatch-cabinet-message.is-error {
  color: #b23c43;
}

.epwatch-cabinet-section {
  margin-top: 28px;
}

.epwatch-cabinet-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 13px;
}

.epwatch-cabinet-section__head span {
  color: var(--kh-accent);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.epwatch-cabinet-section__head h2 {
  margin: 3px 0 0;
  font-size: 21px;
}

.epwatch-cabinet-section__head a {
  color: var(--kh-accent);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

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

.epwatch-subscription {
  position: relative;
  display: grid;
  min-width: 0;
  grid-template-columns: 58px minmax(0, 1fr) 30px;
  gap: 13px;
  padding: 12px;
  border: 1px solid var(--kh-line);
  border-radius: 17px;
  background: var(--catalog-surface, #fff);
}

.epwatch-subscription__poster {
  display: grid;
  overflow: hidden;
  width: 58px;
  height: 82px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--kh-accent);
  text-decoration: none;
}

.epwatch-subscription__poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.epwatch-subscription > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
}

.epwatch-subscription > div a {
  overflow: hidden;
  color: inherit;
  font-weight: 800;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epwatch-subscription > div span,
.epwatch-subscription > div small {
  overflow: hidden;
  margin-top: 5px;
  color: var(--kh-text-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epwatch-subscription > button {
  align-self: start;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #a13b42;
  background: rgb(161 59 66 / 8%);
  font-size: 20px;
  cursor: pointer;
}

.epwatch-schedule-list,
.epwatch-recent-list {
  overflow: hidden;
  border: 1px solid var(--kh-line);
  border-radius: 17px;
  background: var(--catalog-surface, #fff);
}

.epwatch-schedule-item {
  display: grid;
  grid-template-columns: 105px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  color: inherit;
  text-decoration: none;
}

.epwatch-schedule-item + .epwatch-schedule-item,
.epwatch-recent-item + .epwatch-recent-item {
  border-top: 1px solid var(--kh-line);
}

.epwatch-schedule-item time,
.epwatch-schedule-item > span:last-child,
.epwatch-recent-item time {
  color: var(--kh-accent);
  font-size: 12px;
  font-weight: 750;
}

.epwatch-schedule-item > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.epwatch-schedule-item small,
.epwatch-recent-item small {
  overflow: hidden;
  margin-top: 3px;
  color: var(--kh-text-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.epwatch-schedule-item.is-aired {
  opacity: .65;
}

.epwatch-recent-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  color: inherit;
  text-decoration: none;
}

.epwatch-recent-item > span {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.epwatch-recent-item.is-unread::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  content: "";
  border-radius: 50%;
  background: #e5484d;
}

.epwatch-cabinet-empty {
  padding: 28px;
  border: 1px dashed var(--kh-line-strong);
  border-radius: 17px;
  color: var(--kh-text-soft);
  text-align: center;
}

.epwatch-cabinet-empty strong {
  color: inherit;
}

.epwatch-cabinet-empty p {
  margin: 6px 0 0;
  font-size: 13px;
}

[data-theme="dark"] .epwatch-account-card p,
[data-theme="dark"] .epwatch-stats span,
[data-theme="dark"] .epwatch-subscription > div span,
[data-theme="dark"] .epwatch-subscription > div small,
[data-theme="dark"] .epwatch-schedule-item small,
[data-theme="dark"] .epwatch-recent-item small {
  color: var(--kh-text-soft);
}

@media (max-width: 800px) {
  .epwatch-subscription-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .epwatch-account-card {
    align-items: stretch;
    flex-direction: column;
    padding: 20px;
  }

  .epwatch-link-button {
    width: 100%;
  }

  .epwatch-stats {
    grid-template-columns: 1fr;
  }

  .epwatch-stats article {
    min-height: 72px;
  }

  .epwatch-schedule-item {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  .epwatch-schedule-item > span:last-child {
    display: none;
  }
}
