:root {
  --hmc-bg: var(--sis-bg-deep, #020b13);
  --hmc-surface: var(--sis-surface, #071c2b);
  --hmc-border: rgba(239, 201, 111, 0.34);
  --hmc-gold: var(--sis-gold-bright, #efc96f);
  --hmc-text: var(--sis-text, #f7f3e8);
  --hmc-muted: var(--sis-muted, #a8bac8);
  --hmc-focus: var(--sis-blue-soft, #77d9ff);
}

.hmc-consent[hidden],
.hmc-dialog[hidden] {
  display: none !important;
}

.hmc-banner {
  position: fixed;
  z-index: 999990;
  right: 18px;
  bottom: 18px;
  left: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  max-width: 1180px;
  margin-inline: auto;
  padding: 22px;
  color: var(--hmc-text);
  background: rgba(2, 11, 19, 0.97);
  background: color-mix(in srgb, var(--hmc-bg) 94%, transparent);
  border: 1px solid var(--hmc-border);
  border-radius: 18px;
  box-shadow: 0 18px 65px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(16px);
}

.hmc-banner h2,
.hmc-dialog h2,
.hmc-category h3,
.hmc-category strong {
  color: var(--hmc-text);
}

.hmc-banner h2,
.hmc-dialog h2 {
  margin: 0 0 8px;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

.hmc-banner p,
.hmc-dialog p,
.hmc-category span span,
.hmc-category div p {
  margin: 0;
  color: var(--hmc-muted);
  line-height: 1.55;
}

.hmc-banner a,
.hmc-dialog a {
  color: var(--hmc-gold);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.hmc-button,
.hmc-footer-link,
.hmc-floating-link,
.hmc-icon-button {
  appearance: none;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.hmc-button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--hmc-border);
  border-radius: 10px;
  font-weight: 700;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hmc-button:hover {
  transform: translateY(-1px);
}

.hmc-button--primary,
.hmc-button--secondary {
  min-width: 150px;
}

.hmc-button--primary {
  color: #07131c;
  background: var(--hmc-gold);
  border-color: var(--hmc-gold);
}

.hmc-button--secondary {
  color: var(--hmc-text);
  background: transparent;
}

.hmc-button--text {
  color: var(--hmc-gold);
  background: transparent;
  border-color: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hmc-button:focus-visible,
.hmc-footer-link:focus-visible,
.hmc-floating-link:focus-visible,
.hmc-icon-button:focus-visible,
.hmc-switch input:focus-visible + span {
  outline: 3px solid var(--hmc-focus);
  outline-offset: 3px;
}

.hmc-dialog {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.hmc-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 4, 8, 0.76);
  backdrop-filter: blur(7px);
}

.hmc-dialog__panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 40px));
  overflow: auto;
  color: var(--hmc-text);
  background: var(--hmc-bg);
  border: 1px solid var(--hmc-border);
  border-radius: 18px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6);
}

.hmc-dialog__header,
.hmc-dialog__footer {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 22px;
}

.hmc-dialog__header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.hmc-dialog__footer {
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hmc-icon-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  color: var(--hmc-text);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
}

.hmc-categories {
  display: grid;
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.hmc-category {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 20px 22px;
  background: var(--hmc-surface);
}

.hmc-category h3,
.hmc-category strong {
  display: block;
  margin: 0 0 6px;
  font-size: 1rem;
}

.hmc-always-active {
  color: var(--hmc-gold);
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.hmc-switch {
  position: relative;
  display: inline-flex;
}

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

.hmc-switch span {
  position: relative;
  display: block;
  width: 52px;
  height: 30px;
  background: #53616c;
  border-radius: 999px;
  transition: background 160ms ease;
}

.hmc-switch span::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  background: #fff;
  border-radius: 50%;
  transition: transform 160ms ease;
}

.hmc-switch input:checked + span {
  background: var(--hmc-gold);
}

.hmc-switch input:checked + span::after {
  transform: translateX(22px);
}

.hmc-footer-link {
  padding: 0;
  color: inherit;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hmc-floating-link {
  position: fixed;
  z-index: 999980;
  left: 14px;
  bottom: 14px;
  padding: 8px 12px;
  color: var(--hmc-text);
  background: var(--hmc-surface);
  border: 1px solid var(--hmc-border);
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  font-size: 0.82rem;
}

.hmc-dialog-open {
  overflow: hidden;
}

.hmc-embed,
.hmc-embed iframe {
  width: 100%;
}

.hmc-embed iframe {
  display: block;
  border: 0;
}

.hmc-embed-placeholder {
  display: grid;
  place-items: center;
  gap: 12px;
  min-height: 260px;
  padding: 28px;
  color: var(--hmc-text);
  text-align: center;
  background: var(--hmc-surface);
  border: 1px solid var(--hmc-border);
  border-radius: 14px;
}

.hmc-embed-placeholder p {
  max-width: 620px;
  margin: 0;
  color: var(--hmc-muted);
}

@media (max-width: 820px) {
  .hmc-banner {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .hmc-banner .hmc-actions,
  .hmc-dialog__footer,
  .hmc-dialog__footer .hmc-actions {
    align-items: stretch;
  }

  .hmc-dialog__footer {
    flex-direction: column;
  }

  .hmc-button--primary,
  .hmc-button--secondary {
    flex: 1 1 180px;
  }
}

@media (max-width: 560px) {
  .hmc-banner {
    right: 8px;
    bottom: 8px;
    left: 8px;
    padding: 17px;
  }

  .hmc-banner .hmc-actions,
  .hmc-dialog__footer .hmc-actions {
    display: grid;
    width: 100%;
  }

  .hmc-button {
    width: 100%;
  }

  .hmc-dialog {
    padding: 8px;
  }

  .hmc-dialog__panel {
    max-height: calc(100vh - 16px);
  }

  .hmc-category {
    padding: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hmc-button,
  .hmc-switch span,
  .hmc-switch span::after {
    transition: none;
  }
}
