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

html.khcmp-modal-open,
body.khcmp-modal-open {
  overflow: hidden;
}

.khcmp-banner,
.khcmp-modal,
.khcmp-floating,
.khcmp-button,
.khcmp-policy {
  font-family: var(--khcmp-font, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif);
}

.khcmp-banner {
  position: fixed;
  left: 24px;
  right: 24px;
  top: auto !important;
  bottom: 24px !important;
  z-index: 99998;
  max-width: 980px;
  margin: 0 auto !important;
  padding: 20px;
  border: 1px solid #d8e1e8;
  border-radius: 8px;
  background: #fff;
  color: var(--khcmp-brand, #17324d);
  box-shadow: 0 18px 60px rgba(23, 50, 77, 0.2);
}

.khcmp-banner h2,
.khcmp-modal h2 {
  margin: 0 0 8px;
  color: var(--khcmp-brand, #17324d);
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: 0;
}

.khcmp-banner p,
.khcmp-modal p {
  margin: 0 0 14px;
  color: #334a5f;
  font-size: 15px;
  line-height: 1.55;
}

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

.khcmp-button {
  min-height: 42px;
  border: 1px solid var(--khcmp-brand, #17324d);
  border-radius: 6px;
  background: #fff;
  color: var(--khcmp-brand, #17324d);
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.khcmp-button:hover,
.khcmp-button:focus {
  outline: 3px solid var(--khcmp-accent, #d9eaf7);
  outline-offset: 2px;
}

.khcmp-button--primary {
  background: var(--khcmp-brand, #17324d);
  color: #fff;
}

.khcmp-links {
  margin-top: 12px;
  color: #4b6174;
  font-size: 13px;
}

.khcmp-links--modal {
  border-top: 1px solid #e5edf3;
  padding-top: 14px;
}

.khcmp-links a {
  color: var(--khcmp-brand, #17324d);
  text-decoration: underline;
}

.khcmp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: rgba(12, 27, 42, 0.48);
}

.khcmp-modal {
  position: fixed;
  top: 50% !important;
  left: 50%;
  z-index: 100000;
  width: min(720px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow: auto;
  transform: translate(-50%, -50%) !important;
  border-radius: 8px;
  background: #fff;
  color: var(--khcmp-brand, #17324d);
  padding: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.khcmp-modal__header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.khcmp-close {
  width: 38px;
  height: 38px;
  border: 1px solid #d8e1e8;
  border-radius: 6px;
  background: #fff;
  color: var(--khcmp-brand, #17324d);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.khcmp-category {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  border-top: 1px solid #e5edf3;
  padding: 16px 0;
}

.khcmp-category h3 {
  margin: 0 0 6px;
  color: var(--khcmp-brand, #17324d);
  font-size: 16px;
  letter-spacing: 0;
}

.khcmp-category p {
  margin: 0;
}

.khcmp-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 30px;
}

.khcmp-switch input {
  position: absolute;
  opacity: 0;
}

.khcmp-switch span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #b8c4cf;
  cursor: pointer;
}

.khcmp-switch span::before {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform 0.18s ease;
}

.khcmp-switch input:checked + span {
  background: var(--khcmp-brand, #17324d);
}

.khcmp-switch input:focus + span {
  outline: 3px solid var(--khcmp-accent, #d9eaf7);
  outline-offset: 2px;
}

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

.khcmp-floating {
  position: fixed;
  left: 18px;
  right: auto;
  bottom: 18px;
  z-index: 99997;
  border: 1px solid #d8e1e8;
  border-radius: 6px;
  background: #fff;
  color: var(--khcmp-brand, #17324d);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(23, 50, 77, 0.12);
  cursor: pointer;
  opacity: 0.86;
}

.khcmp-floating:hover,
.khcmp-floating:focus {
  opacity: 1;
  outline: 3px solid var(--khcmp-accent, #d9eaf7);
  outline-offset: 2px;
}

.khcmp-policy table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
}

.khcmp-policy th,
.khcmp-policy td {
  border: 1px solid #d8e1e8;
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.khcmp-policy th {
  background: var(--khcmp-accent, #d9eaf7);
  color: var(--khcmp-brand, #17324d);
}

.wpcf7 form .khcmp-cf7-privacy-note {
  margin: 14px 0 8px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.5;
}

.wpcf7 form .khcmp-cf7-privacy-note a,
.wpcf7 form .khcmp-cf7-privacy-check a {
  color: var(--khcmp-brand, #17324d);
  text-decoration: underline;
}

.wpcf7 form .khcmp-cf7-privacy-check {
  margin: 10px 0 18px;
  color: #334a5f;
  font-size: 14px;
  line-height: 1.45;
}

.wpcf7 form .khcmp-cf7-privacy-check .wpcf7-list-item {
  margin: 0;
}

.wpcf7 form .khcmp-cf7-privacy,
.wpcf7 form .khcmp-cf7-privacy a,
.wpcf7 form .khcmp-cf7-privacy .wpcf7-list-item-label {
  font-size: 14px !important;
  line-height: 1.5 !important;
  font-weight: 400 !important;
}

.wpcf7 form .khcmp-cf7-privacy-check label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.wpcf7 form .khcmp-cf7-privacy-check input[type="checkbox"] {
  flex: 0 0 auto;
  margin-top: 0.2em;
}

.wpcf7 form .khcmp-cf7-privacy-check input[type="checkbox"]:focus {
  outline: 3px solid var(--khcmp-accent, #d9eaf7);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  .khcmp-banner {
    left: 10px;
    right: 10px;
    top: auto !important;
    bottom: 10px !important;
    max-height: none;
    overflow: visible;
    padding: 12px;
  }

  .khcmp-banner h2 {
    margin-bottom: 6px;
    font-size: 18px;
    line-height: 1.2;
  }

  .khcmp-modal h2 {
    margin-bottom: 4px;
    font-size: 17px;
    line-height: 1.18;
  }

  .khcmp-banner p {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.38;
  }

  .khcmp-modal p {
    margin-bottom: 7px;
    font-size: 12px;
    line-height: 1.3;
  }

  .khcmp-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .khcmp-button {
    width: 100%;
    min-height: 36px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .khcmp-modal .khcmp-actions {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .khcmp-category {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 8px 0;
  }

  .khcmp-category h3 {
    margin-bottom: 3px;
    font-size: 14px;
  }

  .khcmp-category p {
    font-size: 12px;
    line-height: 1.3;
  }

  .khcmp-switch {
    width: 44px;
    height: 26px;
  }

  .khcmp-switch span::before {
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
  }

  .khcmp-switch input:checked + span::before {
    transform: translateX(18px);
  }

  .khcmp-modal {
    width: calc(100vw - 16px);
    max-height: 74vh;
    padding: 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .khcmp-modal__header {
    align-items: flex-start;
  }

  .khcmp-close {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    font-size: 20px;
  }

  .khcmp-links {
    margin-top: 7px;
    font-size: 11px;
    line-height: 1.2;
  }

  .khcmp-floating {
    left: 12px;
    right: auto;
    bottom: 12px;
    max-width: calc(100vw - 24px);
    padding: 7px 9px;
    font-size: 11px;
  }
}

@media (max-width: 380px), (max-height: 680px) {
  .khcmp-banner {
    padding: 10px;
  }

  .khcmp-banner h2,
  .khcmp-modal h2 {
    font-size: 16px;
  }

  .khcmp-banner p {
    font-size: 11.5px;
  }

  .khcmp-modal {
    max-height: 72vh;
    padding: 10px;
  }
}

@media (max-width: 360px) {
  .khcmp-banner {
    left: 8px;
    right: 8px;
    bottom: 8px !important;
    padding: 10px;
  }

  .khcmp-banner h2 {
    margin-bottom: 5px;
    font-size: 16px;
  }

  .khcmp-banner p {
    margin-bottom: 8px;
    font-size: 12px;
    line-height: 1.32;
  }

  .khcmp-button {
    min-height: 34px;
    padding: 6px 7px;
    font-size: 12px;
  }
}
