.np-cookie-root {
  --np-cc-bg: #ffffff;
  --np-cc-text: #1c1c1e;
  --np-cc-muted: #636366;
  --np-cc-border: rgba(0, 0, 0, 0.1);
  --np-cc-accent: #00d188;
  --np-cc-accent-text: #ffffff;
  --np-cc-secondary: #f2f2f7;
  --np-cc-overlay: rgba(0, 0, 0, 0.45);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  .np-cookie-root {
    --np-cc-bg: #1c1c1e;
    --np-cc-text: #f5f5f7;
    --np-cc-muted: #aeaeb2;
    --np-cc-border: rgba(255, 255, 255, 0.12);
    --np-cc-secondary: #2c2c2e;
    --np-cc-overlay: rgba(0, 0, 0, 0.6);
  }
}

.np-cookie-banner {
  position: fixed;
  z-index: 10050;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom, 0));
  pointer-events: none;
}

.np-cookie-banner[hidden],
.np-cookie-modal[hidden] {
  display: none !important;
}

.np-cookie-banner__panel {
  pointer-events: auto;
  max-width: 680px;
  margin: 0 auto;
  background: var(--np-cc-bg);
  color: var(--np-cc-text);
  border: 1px solid var(--np-cc-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
  padding: 16px 16px 14px;
}

.np-cookie-banner__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 8px;
  line-height: 1.25;
}

.np-cookie-banner__text {
  font-size: 15px;
  line-height: 1.4;
  color: var(--np-cc-muted);
  margin: 0 0 14px;
}

.np-cookie-banner__text a {
  color: var(--np-cc-accent);
  text-decoration: underline;
}

.np-cookie-banner__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 540px) {
  .np-cookie-banner__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }

  .np-cookie-banner__actions .np-cookie-btn--primary {
    margin-left: auto;
  }
}

.np-cookie-btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  min-height: 44px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
}

@media (min-width: 540px) {
  .np-cookie-btn {
    width: auto;
    min-width: 140px;
  }
}

.np-cookie-btn--primary {
  background: var(--np-cc-accent);
  color: var(--np-cc-accent-text);
}

.np-cookie-btn--secondary {
  background: var(--np-cc-secondary);
  color: var(--np-cc-text);
}

.np-cookie-btn--ghost {
  background: transparent;
  color: var(--np-cc-muted);
  border: 1px solid var(--np-cc-border);
}

.np-cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 10060;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0));
}

@media (min-width: 640px) {
  .np-cookie-modal {
    align-items: center;
  }
}

.np-cookie-modal__backdrop {
  position: absolute;
  inset: 0;
  background: var(--np-cc-overlay);
}

.np-cookie-modal__panel {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: min(90vh, 640px);
  overflow: auto;
  background: var(--np-cc-bg);
  color: var(--np-cc-text);
  border-radius: 16px;
  border: 1px solid var(--np-cc-border);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  padding: 18px 16px 16px;
}

.np-cookie-modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.np-cookie-modal__close {
  appearance: none;
  border: 0;
  background: var(--np-cc-secondary);
  color: var(--np-cc-text);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}

.np-cookie-option {
  border: 1px solid var(--np-cc-border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}

.np-cookie-option__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.np-cookie-option__label {
  font-size: 16px;
  font-weight: 600;
}

.np-cookie-option__hint {
  font-size: 13px;
  line-height: 1.35;
  color: var(--np-cc-muted);
  margin: 6px 0 0;
}

.np-cookie-switch {
  position: relative;
  width: 51px;
  height: 31px;
  flex-shrink: 0;
}

.np-cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.np-cookie-switch__track {
  position: absolute;
  inset: 0;
  background: #e5e5ea;
  border-radius: 999px;
  transition: background 0.2s;
  cursor: pointer;
}

.np-cookie-switch__track::after {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.np-cookie-switch input:checked + .np-cookie-switch__track {
  background: var(--np-cc-accent);
}

.np-cookie-switch input:checked + .np-cookie-switch__track::after {
  transform: translateX(20px);
}

.np-cookie-switch input:disabled + .np-cookie-switch__track {
  opacity: 0.55;
  cursor: not-allowed;
}

.np-cookie-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

@media (min-width: 480px) {
  .np-cookie-modal__actions {
    flex-direction: row;
    justify-content: flex-end;
  }
}

.np-cookie-reopen {
  position: fixed;
  z-index: 10040;
  left: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0));
  appearance: none;
  border: 1px solid var(--np-cc-border);
  background: var(--np-cc-bg);
  color: var(--np-cc-muted);
  font-size: 12px;
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.np-cookie-reopen[hidden] {
  display: none !important;
}

body.np-cookie-modal-open {
  overflow: hidden;
}
