:root {
  --mtc-bg: #ffffff;
  --mtc-text: #0f172a;
  --mtc-muted: #475569;
  --mtc-border: #dbe2eb;
  --mtc-shadow: 0 16px 44px -28px rgba(15, 23, 42, 0.35);
  --mtc-radius: 18px;
  --mtc-primary: #0f172a;
  --mtc-primary-hover: #1e293b;
}

html,
body {
  max-width: 100%;
}

body {
  overflow-x: hidden;
}

#mt-consent-root {
  position: fixed;
  inset: 0;
  z-index: 99999;
  pointer-events: none;
  font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--mtc-text);
  overflow-x: clip;
}

.cookie-banner,
#mt-consent,
.mt-consent,
.mtc-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.mtc-hidden {
  display: none !important;
}

.mtc-banner {
  pointer-events: auto;
  left: 16px;
  right: 16px;
  margin-left: auto;
  margin-right: auto;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: auto;
  max-width: 980px;
  border-radius: var(--mtc-radius);
  border: 1px solid var(--mtc-border);
  background: var(--mtc-bg);
  box-shadow: var(--mtc-shadow);
  padding: 14px 16px;
  box-sizing: border-box;
  overflow: hidden;
}

.mtc-banner--enter {
  animation: mtcBannerIn 0.28s ease both;
}

@keyframes mtcBannerIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mtc-banner__content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.mtc-banner__left {
  min-width: 0;
  flex: 1 1 auto;
}

.mtc-banner__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mtc-banner__icon {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  position: static !important;
  transform: none !important;
  color: #334155;
  flex: 0 0 20px !important;
}

.mtc-banner__icon svg {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  display: block !important;
  position: static !important;
  inset: auto !important;
  transform: none !important;
}

.mtc-banner svg,
.mtc-banner img,
.mtc-banner .mtc-banner__icon,
.mtc-banner .mtc-banner__icon * {
  max-width: 24px !important;
  max-height: 24px !important;
}

.mtc-banner .mtc-banner__title,
.mtc-banner .mtc-banner__desc,
.mtc-banner .mtc-banner__actions,
.mtc-banner .mtc-btn {
  max-width: none !important;
  max-height: none !important;
}

.mtc-banner__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.mtc-banner__desc {
  margin: 4px 0 0;
  color: var(--mtc-muted);
  font-size: 14px;
  line-height: 1.35;
  max-width: 58ch;
}

.cookie-banner p,
.mtc-banner p {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mtc-banner__actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
}

.cookie-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mtc-btn {
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.mtc-btn:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

.mtc-btn--primary {
  background: var(--mtc-primary);
  color: #fff;
}

.mtc-btn--primary:hover {
  background: var(--mtc-primary-hover);
}

.mtc-btn--ghost {
  border-color: var(--mtc-border);
  background: #fff;
  color: var(--mtc-text);
}

.mtc-btn--ghost:hover {
  background: #f8fafc;
}

.mtc-btn--link {
  background: transparent;
  border-color: transparent;
  color: #475569;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding-left: 4px;
  padding-right: 4px;
}

.mtc-btn--link:hover {
  color: var(--mtc-text);
}

.mtc-chip {
  pointer-events: auto;
  position: fixed;
  right: calc(12px + env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  border: 1px solid var(--mtc-border);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 10px 26px -20px rgba(15, 23, 42, 0.35);
  color: #334155;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-sizing: border-box;
  max-width: min(260px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.mtc-chip:hover {
  background: #f8fafc;
}

.mtc-chip:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

#mt-consent-root[data-mt-page-context='editor'] .mtc-chip {
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 1024px) {
  #mt-consent-root[data-mt-page-context='editor'] .mtc-chip {
    top: 96px;
    right: 16px;
    bottom: auto;
    max-width: 220px;
  }
}

.mtc-backdrop {
  pointer-events: auto;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: grid;
  place-items: center;
  padding: 16px;
}

.mtc-modal {
  width: min(620px, 100%);
  border-radius: 20px;
  border: 1px solid var(--mtc-border);
  background: #fff;
  box-shadow: 0 28px 60px -34px rgba(15, 23, 42, 0.5);
  overflow: hidden;
}

.mtc-modal__head {
  padding: 18px 20px 12px;
  border-bottom: 1px solid #eef2f7;
}

.mtc-modal__title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mtc-modal__title {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  font-weight: 700;
}

.mtc-modal__close {
  border: 1px solid var(--mtc-border);
  background: #fff;
  color: var(--mtc-text);
  border-radius: 10px;
  width: 36px;
  height: 36px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.mtc-modal__desc {
  margin: 8px 0 0;
  color: var(--mtc-muted);
  font-size: 14px;
  line-height: 1.4;
}

.mtc-modal__body {
  padding: 14px 20px;
  display: grid;
  gap: 10px;
}

.mtc-row {
  border: 1px solid #eef2f7;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mtc-row__text strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
}

.mtc-row__text span {
  display: block;
  margin-top: 3px;
  color: var(--mtc-muted);
  font-size: 13px;
  line-height: 1.35;
}

.mtc-switch {
  display: inline-flex;
  align-items: center;
}

.mtc-switch input {
  appearance: none;
  width: 46px;
  height: 26px;
  background: #cbd5e1;
  border-radius: 999px;
  position: relative;
  margin: 0;
  cursor: pointer;
  transition: background 0.18s ease;
}

.mtc-switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
  transition: transform 0.18s ease;
}

.mtc-switch input:checked {
  background: #0f172a;
}

.mtc-switch input:checked::after {
  transform: translateX(20px);
}

.mtc-switch input:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.mtc-switch input:focus-visible {
  outline: 2px solid #94a3b8;
  outline-offset: 2px;
}

.mtc-modal__foot {
  border-top: 1px solid #eef2f7;
  padding: 14px 20px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mtc-modal__note {
  margin: 0 0 10px;
  color: var(--mtc-muted);
  font-size: 13px;
  line-height: 1.35;
  width: 100%;
}

@media (max-width: 920px) {
  .mtc-banner {
    left: 12px;
    right: 12px;
    width: auto;
    max-width: calc(100% - 24px);
    padding: 12px 14px;
  }

  .mtc-banner__content {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .mtc-banner__actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .mtc-banner {
    left: 8px;
    right: 8px;
    width: auto;
    max-width: calc(100% - 16px);
    padding: 10px 12px;
    border-radius: 14px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  .mtc-banner__content {
    gap: 8px;
  }

  .mtc-banner__title {
    font-size: 15px;
  }

  .mtc-banner__desc {
    margin-top: 2px;
    font-size: 12.5px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 100%;
  }

  .mtc-banner__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: flex-start;
  }

  .mtc-btn {
    width: auto;
    text-align: center;
    font-size: 12px;
    padding: 8px 10px;
    border-radius: 10px;
  }

  .mtc-btn--link {
    flex-basis: 100%;
    text-align: left;
    width: 100%;
    padding: 0;
    margin-top: 1px;
  }

  .mtc-chip {
    right: calc(8px + env(safe-area-inset-right, 0px));
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    font-size: 11px;
    padding: 7px 10px;
    max-width: min(220px, calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  }

  #mt-consent-root[data-mt-page-context='editor'] .mtc-chip {
    top: auto;
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  }

  .mtc-modal__head,
  .mtc-modal__body,
  .mtc-modal__foot {
    padding-left: 14px;
    padding-right: 14px;
  }
}

@media (max-width: 390px) {
  .mtc-banner {
    left: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    padding: 9px 11px;
  }

  .mtc-banner__content {
    gap: 6px;
  }

  .mtc-banner__title {
    font-size: 14px;
  }

  .mtc-banner__desc {
    display: none;
  }
}
