.kg-page--wide {
  max-width: var(--kg-wrap, 1400px);
}

.remimat__intro,
.remimat__hint {
  color: #5f6475;
  line-height: 1.6;
}

.remimat__alert {
  margin: 0 0 18px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 15px;
}

.remimat__alert--info {
  background: #eef2ff;
  color: #3730a3;
}

.remimat__alert--error {
  background: #fff2f2;
  color: #c62828;
}

.remimat__alert--ok {
  background: #eefaf0;
  color: #2e7d32;
}

.remimat__form {
  background: #fff;
  border-radius: 24px;
  padding: 32px 28px;
  border: 1px solid rgba(77, 89, 246, 0.08);
  box-shadow: none;
}

.remimat__code-input {
  width: 100%;
  height: 56px;
  border-radius: 16px;
  border: 2px solid #dfe5ff;
  background: #f7f9ff;
  padding: 0 16px;
  font-size: 17px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.remimat__code-input:focus {
  outline: none;
  border-color: #4d59f6;
  box-shadow: 0 0 0 4px rgba(77, 89, 246, 0.14);
}

.remimat__package {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 20px;
  padding: 22px 24px;
  box-shadow: none;
}

.remimat-pk__crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.remimat-pk__crumb a {
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.remimat-pk__crumb a:hover {
  text-decoration: underline;
}

.remimat-pk__crumb-sep {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 600;
}

.remimat-pk__crumb [aria-current="page"] {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
}

.remimat-pk__section,
.remimat-pk__long {
  background: #fff;
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 18px;
  border: 1px solid rgba(77, 89, 246, 0.08);
  box-shadow: none;
}

.kg-page .edu-add-code-btn,
.remimat__submit {
  border-radius: 999px;
}

.remimat__subtitle {
  margin: 28px 0 12px;
  font-size: 20px;
  font-weight: 800;
}

.kg-btn--ghost {
  margin-left: 8px;
  background: transparent;
  border: 2px solid currentColor;
}

.remimat__label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.remimat__packages {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
}

.remimat__package h2 {
  margin: 0 0 8px;
  color: #4d59f6;
}

.remimat-pk__head {
  margin-bottom: 18px;
}

.remimat-pk__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin: 0 0 14px;
}

.remimat-pk__title-row .kg-article__title {
  margin: 0;
}

.remimat-pk__unlock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin: 0 0 18px;
  padding: 12px 14px 12px 12px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 18px;
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
}

.remimat-pk__unlock-text {
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.remimat-pk__unlock-btn {
  margin-left: auto;
}

@media (max-width: 767px) {
  .remimat__form {
    padding: 20px 16px;
    border-radius: 18px;
  }

  .remimat--activate .edu-add-code-btn,
  .remimat__form .edu-add-code-btn,
  .remimat__submit {
    width: 100%;
    margin-left: 0;
  }

  .kg-btn--ghost {
    margin-left: 0;
  }

  .remimat-pk__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .remimat-pk__title-row .kg-article__title {
    font-size: 24px;
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .remimat-pk__desc {
    font-size: 16px;
  }

  .remimat-pk__unlock {
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
  }

  .remimat-pk__unlock-text {
    font-size: 15px;
  }

  .remimat-pk__unlock-btn {
    margin-left: 0;
    width: 100%;
  }

  .remimat-pk__section,
  .remimat-pk__long {
    padding: 16px;
    border-radius: 16px;
  }

  .remimat-pk__section--media {
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  .remimat-pk__section h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }

  .remimat-pk__media-head {
    padding: 12px;
    min-height: 44px;
  }

  .remimat-pk__media-title {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .remimat-pk__frame-wrap {
    aspect-ratio: auto;
    height: min(68dvh, 560px);
    min-height: 280px;
  }

  .remimat-pk__lock-overlay {
    padding: 10px;
  }

  .remimat-pk__lock-card {
    padding: 12px 14px;
    gap: 4px;
    border-radius: 16px;
  }

  .remimat-pk__lock-mark {
    width: 36px;
    height: 36px;
    margin-bottom: 0;
    border-radius: 12px;
  }

  .remimat-pk__lock-mark .remimat-pk__lock {
    width: 18px;
    height: 18px;
  }

  .remimat-pk__lock-card strong {
    font-size: 15px;
  }

  .remimat-pk__lock-card span:last-child {
    font-size: 12px;
  }

  .remimat-pk__player-actions .kg-btn {
    width: 100%;
  }

  .remimat-pk__gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .remimat-pk__card {
    padding: 10px;
  }

  .remimat-pk__card h3 {
    font-size: 14px;
  }

  .remimat-pk__card .kg-btn {
    width: 100%;
  }

  .remimat-pk__links li {
    flex-wrap: wrap;
    align-items: center;
  }

  .remimat-pk__links .kg-btn {
    width: 100%;
  }

  .remimat-pk__long {
    overflow-wrap: anywhere;
  }

  .remimat-pk__long img,
  .remimat-pk__long iframe,
  .remimat-pk__long video,
  .remimat-pk__long table {
    max-width: 100%;
    height: auto;
  }

  .remimat-modal {
    z-index: 200;
    height: 100dvh;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .remimat-modal__close {
    margin: max(12px, env(safe-area-inset-top, 0px)) 12px 0;
  }

  .remimat-modal__frame {
    margin: 10px 12px 12px;
  }
}

.remimat-pk__unlock--foot {
  margin: 4px 0 18px;
}

.remimat-pk__desc {
  color: #fff;
  font-size: 17px;
}

.remimat-pk {
  min-width: 0;
  width: 100%;
}

.remimat-pk__badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: none;
}

.remimat-pk__badge--owned {
  color: #15803d;
}

.remimat-pk__badge--locked {
  color: #dc2626;
}

.remimat-pk__status {
  display: inline-flex;
  margin-top: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  background: #fff;
}

.remimat-pk__section h2 {
  margin: 0 0 16px;
  color: #4d59f6;
  font-size: 22px;
  letter-spacing: -0.02em;
}

.remimat-pk__long h2 {
  margin: 0 0 12px;
  color: #222;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.remimat-pk__long p {
  color: #6b7280;
  font-size: 16px;
  line-height: 1.65;
}

.remimat-pk__group {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 8px 14px;
  margin-bottom: 10px;
}

.remimat-pk__group summary {
  cursor: pointer;
  font-weight: 800;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.remimat-pk__group summary::-webkit-details-marker {
  display: none;
}

.remimat-pk__media-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.remimat-pk__section--media {
  padding: 0;
  background: transparent;
  border: 0;
}

.remimat-pk__media {
  display: block;
  margin: 0;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(77, 89, 246, 0.08);
  overflow: hidden;
}

.remimat-pk__media-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.remimat-pk__media-head::-webkit-details-marker {
  display: none;
}

.remimat-pk__media-title {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 800;
  color: #1f2433;
  letter-spacing: 0.01em;
}

.remimat-pk__media-head::after {
  content: "";
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-left: 2px;
  border-right: 2px solid #9aa3c7;
  border-bottom: 2px solid #9aa3c7;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.remimat-pk__media[open] .remimat-pk__media-head::after {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.remimat-pk__media-body {
  padding: 0;
}

.remimat-pk__media-index {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: #eef1ff;
  color: #4d59f6;
  font-size: 13px;
  font-weight: 800;
}

.remimat-pk__media-desc {
  margin: 0;
  padding: 0 16px 12px;
  color: #5f6475;
  font-size: 15px;
}

.remimat-pk__player {
  overflow: hidden;
  border-radius: 0;
  background: #fff;
  isolation: isolate;
}

.remimat-pk__player-actions {
  margin: 0;
  padding: 12px 16px 16px;
}

.remimat-pk__frame-wrap {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background: #fff;
  overflow: hidden;
  border-radius: inherit;
}

.remimat-pk__frame-wrap iframe {
  width: 100%;
  height: 100%;
  max-width: 100%;
  border: 0;
  display: block;
  background: #fff;
  border-radius: inherit;
}

.remimat-pk__frame-wrap.is-locked iframe {
  filter: blur(12px) saturate(1.05);
  transform: scale(1.04);
  pointer-events: none;
}

.remimat-pk__lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.28);
  pointer-events: none;
}

.remimat-pk__lock-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: min(420px, 100%);
  padding: 22px 26px;
  text-align: center;
  color: #2b3350;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.remimat-pk__lock-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 6px;
  border-radius: 16px;
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid rgba(220, 38, 38, 0.14);
}

.remimat-pk__lock-mark .remimat-pk__lock {
  width: 22px;
  height: 22px;
}

.remimat-pk__lock-card strong {
  font-size: 18px;
  font-weight: 800;
  color: #1f2433;
}

.remimat-pk__lock-card span:last-child {
  font-size: 14px;
  font-weight: 600;
  color: #5f6475;
  line-height: 1.4;
}

.remimat-pk__summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 4px;
  border-bottom: 1px solid #ececec;
}

.remimat-pk__summary-row:last-child {
  border-bottom: 0;
}

.remimat-pk__summary-label {
  min-width: 0;
}

.remimat-pk__item-state {
  flex-shrink: 0;
  display: inline-flex;
  color: #9a9a9a;
}

.remimat-pk__check {
  color: #16a34a;
}

.remimat-pk__lock {
  color: #dc2626;
}

.remimat-pk__foot {
  margin: 8px 0 18px;
}

.remimat__hint--light,
.remimat__hint--light a {
  color: #fff;
}

.remimat-pk__count {
  color: #6b7280;
  font-weight: 600;
  margin-left: 8px;
}

.remimat-pk__gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 12px;
}

.remimat-pk__card {
  background: #f7f9ff;
  border-radius: 14px;
  padding: 12px;
}

.remimat-pk__card img,
.remimat-pk__fallback,
.remimat-pk__pdf-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(160deg, #8ea4ff, #5b67f5);
}

.remimat-pk__pdf-thumb {
  display: block;
  width: 100%;
  height: auto;
  background: #eef1ff;
}

.remimat-pk__fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
}

.remimat-pk__card h3 {
  margin: 10px 0 4px;
  font-size: 15px;
}

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

.remimat-pk__links li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #eee;
}

.remimat-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, 0.86);
  z-index: 200;
  display: flex;
  flex-direction: column;
}

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

.remimat-modal__close {
  align-self: flex-end;
  margin: 12px 16px 0;
  background: #fff;
  border: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
}

.remimat-modal__frame {
  flex: 1;
  margin: 12px 16px 16px;
}

.remimat-modal__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
  background: #000;
}

.kg-page .edu-add-code-btn {
  background: linear-gradient(#5f63ff, #4d59f6);
  color: #fff;
}

.kg-page .edu-add-code-btn:hover,
.kg-page .edu-add-code-btn:focus-visible {
  background: linear-gradient(#4d59f6, #3f48d6);
  color: #fff;
}

.remimat__submit {
  width: 100%;
  min-height: 54px;
  margin-top: 8px;
}

.remimat__required {
  color: #dc2626;
}

.remimat--auth .kg-article__title {
  margin-bottom: 10px;
}

.remimat--activate {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.remimat--activate .kg-article__title {
  margin-bottom: 12px;
}

.remimat--activate .remimat__intro {
  color: #fff;
  margin: 0 0 22px;
  font-size: 17px;
  font-weight: 600;
}

.remimat--activate .edu-add-code-box {
  width: 100%;
  max-width: none;
}

.kg-page .remimat--activate .edu-add-code-btn {
  background: #fff;
  color: var(--kg-card-bar, #4d59f6);
  min-width: 220px;
}

.kg-page .remimat--activate .edu-add-code-btn:hover,
.kg-page .remimat--activate .edu-add-code-btn:focus-visible {
  background: #f5f7ff;
  color: var(--kg-card-bar, #4d59f6);
}

.remimat-activate__form {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  width: 100%;
}

.remimat-activate__form .remimat__code-input {
  background: #fff;
  border: 0;
  border-radius: 999px;
  height: 52px;
  box-shadow: none;
}

.remimat-activate__form .remimat__code-input:focus {
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.28);
}

.kg-page .remimat-activate__form .edu-add-code-btn {
  width: 100%;
  min-width: 0;
}

.remimat-devices {
  background: #fff;
  color: #1c1f2e;
  border-radius: 20px;
  padding: 22px 24px;
  margin: 0 0 18px;
  border: 1px solid rgba(77, 89, 246, 0.12);
}

.remimat--auth .remimat-devices {
  background: #f7f9ff;
  margin-top: 12px;
}

.remimat-devices--blocked {
  border-color: #f3c4c4;
  background: #fff8f8;
}

.remimat-devices__title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 800;
  color: #1c1f2e;
}

.remimat-devices--blocked .remimat-devices__title {
  color: #ED1D24;
}

.remimat-devices__bundle {
  margin: 0 0 10px;
  font-weight: 700;
  color: #1c1f2e;
}

.remimat-devices__lead {
  margin: 0 0 16px;
  color: #5f6475;
  line-height: 1.55;
}

.remimat-devices__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.remimat-devices__item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #f7f9ff;
  border: 1px solid rgba(77, 89, 246, 0.1);
}

.remimat-devices--blocked .remimat-devices__item,
.remimat--auth .remimat-devices__item {
  background: #fff;
}

.remimat-devices__item.is-current {
  border-color: #4d59f6;
  background: #eef2ff;
}

.remimat-devices__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.remimat-devices__meta strong {
  color: #1c1f2e;
}

.remimat-devices__meta span {
  color: #5f6475;
  font-size: 14px;
}

.kg-page .remimat-devices__btn,
.kg-main--page .remimat-devices .remimat-devices__btn {
  margin-left: 0;
  min-height: 40px;
  padding: 0 14px;
  font-size: 14px;
  color: #4d59f6;
  background: #fff;
  border: 2px solid #4d59f6;
}

.kg-page .remimat-devices__btn:hover,
.kg-page .remimat-devices__btn:focus-visible,
.kg-main--page .remimat-devices .remimat-devices__btn:hover,
.kg-main--page .remimat-devices .remimat-devices__btn:focus-visible {
  background: #4d59f6;
  color: #fff;
  border-color: #4d59f6;
}

.remimat-devices__manage {
  margin: 16px 0 0;
}
