:root {
  --castrial-ivory: #f6f0e3;
  --castrial-ivory-deep: #e9dfce;
  --castrial-forest: #143d2d;
  --castrial-forest-hover: #0c2d21;
  --castrial-ink: #17241d;
  --castrial-border: #b9ae9c;
}

#castrial-consent-banner,
#castrial-consent-panel {
  box-sizing: border-box;
  color: var(--castrial-ink);
  background: var(--castrial-ivory);
  border: 1px solid var(--castrial-border);
  box-shadow: 0 12px 34px rgba(20, 61, 45, .2);
  font-family: Georgia, "Times New Roman", serif;
}

#castrial-consent-banner {
  position: fixed;
  z-index: 2147483000;
  right: clamp(1rem, 3vw, 2.5rem);
  bottom: 4.65rem;
  left: clamp(1rem, 3vw, 2.5rem);
  max-width: 58rem;
  max-height: calc(100vh - 1.5rem);
  margin-left: auto;
  overflow: auto;
  padding: 1.25rem;
  border-left: 5px solid var(--castrial-forest);
}

#castrial-consent-banner[hidden],
#castrial-consent-panel[hidden] { display: none !important; }

.castrial-consent-title {
  margin: 0 0 .45rem;
  color: var(--castrial-forest);
  font-size: 1.18rem;
  line-height: 1.25;
}

.castrial-consent-copy {
  max-width: 52rem;
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: .96rem;
  line-height: 1.5;
}

.castrial-consent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .65rem;
  margin-top: 1rem;
}

.castrial-consent-button,
#castrial-settings {
  min-height: 2.7rem;
  padding: .65rem .9rem;
  border: 1px solid var(--castrial-forest);
  border-radius: 0;
  cursor: pointer;
  font: 700 .9rem/1.2 Arial, sans-serif;
}

.castrial-consent-button:focus-visible,
#castrial-settings:focus-visible,
.castrial-consent-option input:focus-visible {
  outline: 3px solid #b26a28;
  outline-offset: 3px;
}

.castrial-consent-button--primary,
#castrial-settings {
  color: #fff;
  background: var(--castrial-forest);
}

.castrial-consent-button--primary:hover,
#castrial-settings:hover { background: var(--castrial-forest-hover); }

.castrial-consent-button--secondary {
  color: var(--castrial-forest);
  background: transparent;
}

.castrial-consent-button--secondary:hover { background: var(--castrial-ivory-deep); }

#castrial-settings {
  position: fixed;
  z-index: 2147483001;
  right: 1rem;
  bottom: 1rem;
}

#castrial-consent-panel {
  position: fixed;
  z-index: 2147483002;
  right: 1rem;
  bottom: 4.35rem;
  width: min(30rem, calc(100vw - 2rem));
  max-height: min(42rem, calc(100vh - 6rem));
  overflow: auto;
  padding: 1rem;
}

#castrial-consent-panel .castrial-consent-copy { font-size: .92rem; }

.castrial-consent-options {
  min-width: 0;
  margin: 1rem 0 0;
  padding: .25rem 0 0;
  border: 0;
}

#castrial-consent-banner .castrial-consent-options {
  max-width: 52rem;
}

.castrial-consent-options legend {
  padding: 0;
  color: var(--castrial-forest);
  font: 700 .95rem/1.3 Arial, sans-serif;
}

.castrial-consent-option {
  display: grid;
  grid-template-columns: 1.25rem 1fr;
  column-gap: .55rem;
  align-items: start;
  margin-top: .85rem;
  padding: .8rem;
  border: 1px solid var(--castrial-border);
  background: rgba(255, 255, 255, .28);
  font-family: Arial, sans-serif;
}

.castrial-consent-option input {
  width: 1.05rem;
  height: 1.05rem;
  margin: .13rem 0 0;
  accent-color: var(--castrial-forest);
}

.castrial-consent-option label {
  cursor: pointer;
  color: var(--castrial-forest);
  font: 700 .96rem/1.3 Arial, sans-serif;
}

.castrial-consent-option-help {
  grid-column: 2;
  margin: .25rem 0 0;
  font: .88rem/1.42 Arial, sans-serif;
}

.castrial-consent-note {
  margin: .9rem 0 0;
  font: .85rem/1.4 Arial, sans-serif;
}

@media (max-width: 40rem) {
  #castrial-consent-banner { bottom: 4.2rem; padding: 1rem; }
  .castrial-consent-actions { display: grid; grid-template-columns: 1fr; }
  .castrial-consent-button { width: 100%; }
  #castrial-settings { right: .75rem; bottom: .75rem; }
  #castrial-consent-panel { right: .75rem; bottom: 4.2rem; width: calc(100vw - 1.5rem); }
}
