/* Najma controls (najma-controls.js): themed list, calendar and time panels for native fields. */
.ns-layer {
  --ns-night: #171b4d; --ns-ink-2: #3b3f63; --ns-muted: #5d5f7a; --ns-gold: #e9b44c; --ns-gold-soft: #fbf0d6;
  --ns-cream: #fbf7f0; --ns-sand: #f1e6d3; --ns-rule: #e6dccb; --ns-sage: #7f9a76;
  position: fixed; inset: 0; z-index: 2147483000; pointer-events: none;
  font-family: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ns-night);
}
.ns-pop {
  position: fixed; pointer-events: auto; display: flex; flex-direction: column; overflow: hidden;
  padding: 6px; border-radius: 20px; background: #fff;
  box-shadow: 0 0 0 1px var(--ns-rule), 0 24px 48px -20px rgba(23, 27, 77, .38), 0 6px 14px -8px rgba(23, 27, 77, .18);
  opacity: 0; transform: translateY(-6px) scale(.985); transform-origin: top center;
  transition: opacity .18s ease, transform .22s cubic-bezier(.2, .8, .2, 1);
}
.ns-pop.is-up { transform-origin: bottom center; transform: translateY(6px) scale(.985); }
.ns-layer.is-open .ns-pop { opacity: 1; transform: none; }
.ns-layer.is-closing .ns-pop { opacity: 0; }

/* list */
.ns-list { overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 2px; padding: 2px; outline: none; scrollbar-width: thin; scrollbar-color: #d8c9ab transparent; }
.ns-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 42px; padding: 9px 12px 9px 14px;
  border-radius: 13px; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ns-ink-2);
  transition: background-color .15s, color .15s;
}
.ns-opt svg { flex-shrink: 0; color: #b07f1a; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.ns-opt.is-active { background: var(--ns-cream); color: var(--ns-night); }
.ns-opt.is-selected { background: var(--ns-gold-soft); color: var(--ns-night); font-weight: 800; }
.ns-opt.is-selected svg { opacity: 1; transform: none; }
.ns-opt.is-selected.is-active { background: #f7e3b4; }
.ns-opt.is-empty .ns-txt { color: var(--ns-muted); font-weight: 600; }
.ns-opt.is-disabled { cursor: default; color: #a6a3b5; background: none; }
.ns-list.is-kbd .ns-opt.is-active { box-shadow: inset 0 0 0 2px var(--ns-gold); }   /* ring only while using the keyboard */
.ns-txt { min-width: 0; overflow-wrap: anywhere; }
.ns-group { margin: 8px 12px 4px; font-size: 13px; font-weight: 800; color: var(--ns-muted); }
.ns-group:first-child { margin-top: 4px; }
.ns-none { padding: 16px 14px; font-size: 14px; color: var(--ns-muted); text-align: center; }
.ns-search { position: relative; flex-shrink: 0; padding: 4px 4px 8px; }
.ns-search svg { position: absolute; left: 18px; top: 50%; transform: translateY(calc(-50% - 2px)); color: #b07f1a; pointer-events: none; }
.ns-search input {
  width: 100%; height: 42px; padding: 0 14px 0 40px; border: 0; border-radius: 12px; background: var(--ns-cream);
  box-shadow: inset 0 0 0 1.5px var(--ns-rule); font-family: inherit; font-size: 14.5px; font-weight: 500; color: var(--ns-night); -webkit-appearance: none; appearance: none;
}
.ns-search input:focus { outline: none; background: #fff; box-shadow: inset 0 0 0 2px var(--ns-gold), 0 0 0 4px rgba(233, 180, 76, .18); }
.ns-search input::-webkit-search-cancel-button { display: none; }

/* calendar */
.ns-cal { padding: 12px; }
.ns-cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 2px 10px; }
.ns-cal-head strong { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
.ns-nav { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 999px; background: var(--ns-sand); color: var(--ns-night); cursor: pointer; transition: background-color .2s, transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.ns-nav:hover { background: var(--ns-gold); }
.ns-nav:active { transform: scale(.92); }
.ns-cal-grid { display: grid; grid-template-columns: repeat(7, 38px); gap: 3px; outline: none; }
.ns-dow { display: grid; place-items: center; height: 28px; font-size: 12px; font-weight: 700; color: var(--ns-muted); }
.ns-day {
  height: 38px; border: 0; border-radius: 12px; background: none; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; color: var(--ns-night);
  cursor: pointer; font-variant-numeric: tabular-nums; transition: background-color .15s, color .15s;
}
.ns-day:hover:not(:disabled) { background: var(--ns-cream); }
.ns-day.is-out { color: #b2afc0; }
.ns-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ns-gold); }
.ns-day.is-selected { background: var(--ns-night); color: #fff; font-weight: 800; }
.ns-day:focus-visible { outline: 3px solid var(--ns-gold); outline-offset: 1px; }
.ns-day:disabled { color: #d3cfdc; cursor: not-allowed; text-decoration: line-through; }
.ns-cal-foot { display: flex; justify-content: space-between; gap: 8px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--ns-rule); }
.ns-link { height: 34px; padding: 0 12px; border: 0; border-radius: 999px; background: none; font-family: inherit; font-size: 13.5px; font-weight: 700; color: var(--ns-night); cursor: pointer; }
.ns-link:hover { background: var(--ns-cream); }

/* time slots */
.ns-time .ns-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ns-time .ns-opt { justify-content: center; font-variant-numeric: tabular-nums; }
.ns-time .ns-opt svg { display: none; }

/* phones: bottom sheet */
.ns-layer.is-sheet { pointer-events: auto; background: rgba(13, 15, 43, 0); transition: background-color .22s ease; }
.ns-layer.is-sheet.is-open { background: rgba(13, 15, 43, .42); }
.ns-layer.is-sheet .ns-pop {
  left: 0 !important; right: 0; bottom: 0 !important; top: auto !important; max-width: none !important; min-width: 0 !important;
  max-height: min(78vh, 620px) !important; padding: 0 10px calc(14px + env(safe-area-inset-bottom)); border-radius: 26px 26px 0 0;
  transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .8, .2, 1);
}
.ns-layer.is-sheet.is-open .ns-pop { opacity: 1; transform: none; }
.ns-layer.is-sheet.is-closing .ns-pop { transform: translateY(100%); }
.ns-sheet-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 6px 12px 10px; }
.ns-sheet-head strong { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.ns-grab { position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: var(--ns-rule); }
.ns-x { display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border: 0; border-radius: 999px; background: var(--ns-sand); color: var(--ns-night); cursor: pointer; }
.ns-layer.is-sheet .ns-opt { min-height: 50px; font-size: 16px; }
.ns-layer.is-sheet .ns-cal { padding: 0 14px calc(16px + env(safe-area-inset-bottom)); }
.ns-layer.is-sheet .ns-cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.ns-layer.is-sheet .ns-day { height: 44px; }
.ns-layer.is-sheet .ns-time .ns-slots, .ns-layer.is-sheet .ns-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.ns-lock { overflow: hidden; }

/* Closed state of the enhanced fields: hide the OS calendar/clock icon, show ours */
input[type='date']:not([data-native])::-webkit-calendar-picker-indicator,
input[type='time']:not([data-native])::-webkit-calendar-picker-indicator { display: none; }
input[type='date']:not([data-native]), input[type='time']:not([data-native]) {
  cursor: pointer; padding-right: 42px !important; background-repeat: no-repeat !important; background-position: right 14px center !important;
}
input[type='date']:not([data-native]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b07f1a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='3'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E") !important; }
input[type='time']:not([data-native]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23b07f1a' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") !important; }
select:not([multiple]):not([data-native])[aria-expanded='true'],
input[type='date'][aria-expanded='true'], input[type='time'][aria-expanded='true'] { box-shadow: inset 0 0 0 2px #e9b44c, 0 0 0 4px rgba(233, 180, 76, .18) !important; }

@media (prefers-reduced-motion: reduce) {
  .ns-pop, .ns-layer.is-sheet .ns-pop, .ns-layer.is-sheet { transition: none !important; }
}

/* Checkboxes & radios on the site and portals: Najma style instead of OS boxes.
   Inputs that are visually hidden on purpose (custom chips, sr-only, opacity-0) are left alone. */
:where(.x-site, .x-portal) input:is([type="checkbox"], [type="radio"]):not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"]):not([hidden]) {
  appearance: none; -webkit-appearance: none; flex-shrink: 0; width: 20px; height: 20px; min-width: 20px; min-height: 0; margin: 2px 0 0; padding: 0;
  display: inline-grid; place-content: center; vertical-align: middle; border: 0; border-radius: 7px; background: #fff;
  box-shadow: inset 0 0 0 2px #cdbf9f; cursor: pointer; transition: background-color .2s, box-shadow .2s;
}
:where(.x-site, .x-portal) input[type="radio"]:not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"]) { border-radius: 999px; }
:where(.x-site, .x-portal) input[type="checkbox"]:not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"])::before {
  content: ''; width: 10px; height: 5px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: translateY(-1px) rotate(-45deg) scale(0);
  transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
:where(.x-site, .x-portal) input[type="radio"]:not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"])::before {
  content: ''; width: 8px; height: 8px; border-radius: 999px; background: #fff; transform: scale(0); transition: transform .25s cubic-bezier(.34, 1.56, .64, 1);
}
:where(.x-site, .x-portal) input:is([type="checkbox"], [type="radio"]):not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"]):checked { background: #171b4d; box-shadow: none; }
:where(.x-site, .x-portal) input:is([type="checkbox"], [type="radio"]):not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"]):checked::before { transform: translateY(-1px) rotate(-45deg) scale(1); }
:where(.x-site, .x-portal) input[type="radio"]:not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"]):checked::before { transform: scale(1); }
:where(.x-site, .x-portal) input:is([type="checkbox"], [type="radio"]):not([data-native]):not(.sr-only):not(.peer):not([class*="opacity-0"]):hover:not(:disabled):not(:checked) { box-shadow: inset 0 0 0 2px #e9b44c; }
:where(.x-site, .x-portal) input:is([type="checkbox"], [type="radio"]):not([data-native]):disabled { opacity: .45; cursor: not-allowed; }
:where(.x-site, .x-portal) input:is([type="checkbox"], [type="radio"]):not([data-native]):focus-visible { outline: 3px solid #e9b44c; outline-offset: 2px; }
/* sliders */
:where(.x-site, .x-portal) input[type="range"]:not([data-native]) { accent-color: #171b4d; }
