.echon-consent,
.echon-consent * {
  box-sizing: border-box;
}

.echon-consent {
  position: fixed;
  inset: auto 24px 24px;
  z-index: 9998;
  display: flex;
  justify-content: center;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171714;
}

.echon-consent[hidden],
.echon-consent-dialog[hidden],
.echon-consent-reopen[hidden] {
  display: none;
}

.echon-consent-panel {
  width: min(760px, 100%);
  padding: 22px;
  border: 1px solid #b8ad98;
  border-radius: 16px;
  background: #f1eee4;
  box-shadow: 0 18px 60px rgba(23, 23, 20, 0.18);
}

.echon-consent-copy {
  margin-bottom: 18px;
}

.echon-consent-title {
  margin: 0 0 7px;
  font: 600 20px/1.25 Georgia, "Times New Roman", serif;
}

.echon-consent-text {
  max-width: 650px;
  margin: 0;
  color: #625e55;
  font-size: 14px;
  line-height: 1.55;
}

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

.echon-consent-link {
  margin-right: auto;
  color: #625e55 !important;
  border: 0 !important;
  font-size: 13px;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

.echon-consent-button,
.echon-consent-reopen {
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid #171714;
  border-radius: 10px;
  background: transparent;
  color: #171714;
  font: 700 12px/1 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
}

.echon-consent-button:hover,
.echon-consent-button:focus-visible,
.echon-consent-reopen:hover,
.echon-consent-reopen:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(151, 98, 57, 0.24);
}

.echon-consent-button--primary {
  background: #171714;
  color: #faf7ef;
}

.echon-consent-reopen {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 9997;
  min-height: 36px;
  padding: 0 12px;
  border-color: #b8ad98;
  background: #f1eee4;
  box-shadow: 0 8px 28px rgba(23, 23, 20, 0.14);
  font-size: 11px;
}

.echon-consent-dialog {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 23, 20, 0.58);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171714;
}

.echon-consent-dialog-panel {
  width: min(520px, 100%);
  padding: 28px;
  border: 1px solid #b8ad98;
  border-radius: 16px;
  background: #f1eee4;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.echon-consent-dialog-panel h2 {
  margin: 0 0 8px;
  color: #171714;
  font: 600 30px/1.15 Georgia, "Times New Roman", serif;
}

.echon-consent-dialog-panel > p {
  margin: 0 0 22px;
  color: #625e55;
  font-size: 14px;
  line-height: 1.55;
}

.echon-consent-option {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 20px;
  padding: 16px 0;
  border-top: 1px solid #d8d2c4;
}

.echon-consent-option strong {
  color: #171714;
  font-size: 14px;
}

.echon-consent-option span {
  grid-column: 1;
  color: #625e55;
  font-size: 13px;
  line-height: 1.45;
}

.echon-consent-option input {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: #976239;
}

.echon-consent-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

@media (max-width: 640px) {
  .echon-consent {
    inset: auto 12px 12px;
  }

  .echon-consent-panel {
    padding: 20px;
  }

  .echon-consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .echon-consent-link {
    grid-column: 1 / -1;
    margin: 0 0 5px;
  }

  .echon-consent-button--primary {
    grid-column: 1 / -1;
  }

  .echon-consent-dialog {
    align-items: end;
    padding: 12px;
  }

  .echon-consent-dialog-panel {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding: 24px 20px;
  }

  .echon-consent-dialog-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .echon-consent-panel,
  .echon-consent-dialog-panel {
    animation: echon-consent-in 180ms ease-out;
  }

  @keyframes echon-consent-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}
