/*
 * Animated select panel (see select-panel.js). Colours follow the surrounding text colour so the panel works on
 * light and dark forms; override the custom properties on .nl-bfe-panel (or a parent) to match a brand:
 *   --nl-bfe-panel-bg  --nl-bfe-panel-border  --nl-bfe-panel-hover  --nl-bfe-panel-accent  --nl-bfe-panel-tick
 *   --nl-bfe-panel-radius  --nl-bfe-panel-muted
 */
.nl-bfe-panel {
  --_border: var(--nl-bfe-panel-border, color-mix(in srgb, currentColor 28%, transparent));
  --_hover: var(--nl-bfe-panel-hover, color-mix(in srgb, currentColor 7%, transparent));
  --_muted: var(--nl-bfe-panel-muted, color-mix(in srgb, currentColor 65%, transparent));
  --_accent: var(--nl-bfe-panel-accent, currentColor);
  --_tick: var(--nl-bfe-panel-tick, #fff);
  position: relative;
  width: 100%;
  border: 1px solid var(--_border);
  border-radius: var(--nl-bfe-panel-radius, 9px);
  background: var(--nl-bfe-panel-bg, transparent);
  color: inherit;
  overflow: hidden;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.nl-bfe-panel:hover { border-color: color-mix(in srgb, currentColor 45%, transparent); }
.nl-bfe-panel.is-open { border-color: color-mix(in srgb, currentColor 60%, transparent); box-shadow: 0 8px 24px rgba(0, 0, 0, .08); }

/* The real select stays in the DOM, visually hidden but still part of the form. */
.nl-bfe-panel__native { position: absolute !important; inline-size: 1px !important; block-size: 1px !important; margin: -1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; border: 0 !important; opacity: .01 !important; pointer-events: none !important; white-space: nowrap !important; }

.nl-bfe-panel__toggle {
  width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 14px 18px; margin: 0; appearance: none; border: 0; border-radius: 0; background: transparent; box-shadow: none;
  color: inherit; font: inherit; text-align: left; text-transform: none; letter-spacing: normal; cursor: pointer;
}
.nl-bfe-panel__toggle:focus { outline: none; }
.nl-bfe-panel__toggle:focus-visible { outline: 2px solid currentColor; outline-offset: -4px; }
.nl-bfe-panel__heading { display: block; min-width: 0; flex: 1; }
.nl-bfe-panel__title { display: block; font-size: 1.05em; line-height: 1.3; font-weight: 700; }
.nl-bfe-panel__summary { display: block; margin-top: 4px; min-height: 1.3em; font-size: .88em; line-height: 1.4; color: var(--_muted); }
.nl-bfe-panel__summary.has-selection { color: inherit; }

/* Rotating plus / close icon */
.nl-bfe-panel__icon { position: relative; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; transition: transform .38s cubic-bezier(.2, .8, .2, 1), background-color .25s ease; }
.nl-bfe-panel__toggle:hover .nl-bfe-panel__icon { background: var(--_hover); }
.nl-bfe-panel__icon::before, .nl-bfe-panel__icon::after { content: ""; position: absolute; top: 50%; left: 50%; width: 16px; height: 2px; border-radius: 2px; background: currentColor; transform: translate(-50%, -50%); }
.nl-bfe-panel__icon::after { transform: translate(-50%, -50%) rotate(90deg); }
.nl-bfe-panel.is-open .nl-bfe-panel__icon { transform: rotate(45deg); }

/* Animated open / close: animating grid rows reaches the natural content height without measuring in JS. */
.nl-bfe-panel__content { display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .42s cubic-bezier(.2, .8, .2, 1), opacity .28s ease, visibility 0s linear .42s; }
.nl-bfe-panel.is-open .nl-bfe-panel__content { grid-template-rows: 1fr; opacity: 1; visibility: visible; transition-delay: 0s; }
.nl-bfe-panel__inner { min-height: 0; overflow: hidden; }
.nl-bfe-panel__options { padding: 0 18px 14px; }

.nl-bfe-panel__option { position: relative; display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px 4px; border-top: 1px solid var(--_border); }
.nl-bfe-panel__option label { flex: 1; display: block; margin: 0; cursor: pointer; }
/* Default (non-Pure) forms: the browser's own checkbox/radio, sitting beside the label. */
.nl-bfe-panel:not(.nl-bfe-panel--pure) .nl-bfe-panel__option input { flex: 0 0 auto; margin: .2em 0 0; order: -1; }
.nl-bfe-panel:not(.nl-bfe-panel--pure) .nl-bfe-panel__option label { padding: 0; }
/* Pure Form: the input is hidden and the site's Pure label styling draws the box. */
.nl-bfe-panel--pure .nl-bfe-panel__option { display: block; padding: 4px 0; }
.nl-bfe-panel--pure .nl-bfe-panel__option input { position: absolute; opacity: 0; pointer-events: none; inline-size: 1px; block-size: 1px; margin: 0; }
.nl-bfe-panel__option-title { display: block; font-weight: 650; line-height: 1.35; }
.nl-bfe-panel__option-description { display: block; margin-top: 3px; font-size: .85em; line-height: 1.45; color: var(--_muted); }
.nl-bfe-panel__option-extra { display: block; margin-top: 3px; white-space: nowrap; font-size: .9em; font-weight: 650; }

@media (max-width: 600px) { .nl-bfe-panel__toggle { padding-left: 14px; padding-right: 14px; } .nl-bfe-panel__options { padding-left: 14px; padding-right: 14px; } }
@media (prefers-reduced-motion: reduce) {
  .nl-bfe-panel, .nl-bfe-panel__content, .nl-bfe-panel__icon, .nl-bfe-panel__option { transition: none !important; }
}
