:root {
  --ndp-color-primary: #2f8f4e;
  --ndp-color-primary-hover: #267942;
  --ndp-color-primary-bg: #e8f5ed;
  --ndp-color-accent: #245c7a;
  --ndp-color-surface: #ffffff;
  --ndp-color-surface-subtle: #f3f6f7;
  --ndp-color-surface-hover: #e8ecef;
  --ndp-color-page: #f6f7f8;
  --ndp-color-text: #262b30;
  --ndp-color-text-muted: #717982;
  --ndp-color-text-faint: #727a83;
  --ndp-color-border: #dfe4e8;
  --ndp-color-danger: #d64545;
  --ndp-color-focus: var(--ndp-color-accent);
  --ndp-radius: 8px;
  --ndp-radius-lg: 14px;
  --ndp-shadow: 0 12px 30px rgba(18, 28, 38, 0.16);
  --ndp-z-index: 1000;
  --ndp-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Devanagari", Arial, sans-serif;
  --ndp-transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ndp-transition: none;
  }
}

.ndp-trigger {
  box-sizing: border-box;
  min-width: 220px;
  min-height: 40px;
  border: 1px solid var(--ndp-color-border);
  border-radius: var(--ndp-radius);
  background: var(--ndp-color-surface);
  color: var(--ndp-color-text);
  font: 14px/1.3 var(--ndp-font);
  padding: 9px 12px;
  text-align: left;
  cursor: pointer;
}

/* Editable (typeable) trigger gets a text caret instead of the pointer. */
.ndp-trigger:not([readonly]) {
  cursor: text;
}

/* Native-<input type=date>-style segmented editor: no free-text caret, and a
   whole section highlights when selected. */
.ndp-trigger--segmented {
  caret-color: transparent;
  cursor: default;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.ndp-trigger--segmented::selection {
  background: var(--ndp-color-primary-bg);
  color: var(--ndp-color-primary);
}

.ndp-trigger--segmented::-moz-selection {
  background: var(--ndp-color-primary-bg);
  color: var(--ndp-color-primary);
}

.ndp-trigger--segmented::placeholder {
  color: var(--ndp-color-text-faint);
}

.ndp-trigger:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: 2px;
}

/* Typed value that doesn't parse to a valid, allowed date. */
.ndp-trigger.ndp-input-invalid {
  color: var(--ndp-color-danger);
  border-color: var(--ndp-color-danger);
}

.ndp-trigger.ndp-input-invalid:focus-visible {
  outline-color: var(--ndp-color-danger);
}

.ndp-trigger-wrap:has(.ndp-input-invalid) {
  border-color: var(--ndp-color-danger);
}

.ndp-trigger-wrap {
  width: 100%;
  position: relative;
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--ndp-color-border);
  border-radius: var(--ndp-radius);
  background: var(--ndp-color-surface);
  overflow: hidden;
}

.ndp-trigger-wrap .ndp-trigger {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
}

.ndp-trigger-wrap .ndp-clear {
  position: relative;
  top: unset;
  right: unset;
  transform: none;
  flex: 0 0 auto;
  align-self: center;
  margin-right: 2px;
}

.ndp-mode-toggle {
  appearance: none;
  flex: 0 0 auto;
  width: 38px;
  border: 0;
  border-left: 1px solid var(--ndp-color-border);
  background: var(--ndp-color-surface-subtle);
  color: var(--ndp-color-text-muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--ndp-transition);
}

.ndp-mode-toggle:hover {
  background: var(--ndp-color-surface-hover);
  color: var(--ndp-color-text);
}

.ndp-mode-toggle:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: -2px;
}

.ndp-mode-toggle[data-mode="BS"] {
  color: var(--ndp-color-primary);
}

.ndp-clear {
  appearance: none;
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: var(--ndp-color-text-faint);
  color: var(--ndp-color-surface);
  font-size: 12px;
  line-height: 22px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  transition: var(--ndp-transition);
}

.ndp-clear:hover {
  background: var(--ndp-color-text-muted);
}

.ndp-clear:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: 2px;
}

.ndp-panel-root {
  z-index: var(--ndp-z-index);
  font-family: var(--ndp-font);
}

.ndp-panel,
.ndp-panel * {
  box-sizing: border-box;
}

.ndp-panel {
  display: flex;
  overflow: hidden;
  border: 1px solid var(--ndp-color-border);
  border-radius: var(--ndp-radius-lg);
  background: var(--ndp-color-surface);
  box-shadow: var(--ndp-shadow);
  color: var(--ndp-color-text);
  font: 14px/1.35 var(--ndp-font);
}

.ndp-panel--datetime {
  flex-direction: column;
  width: min(560px, calc(100vw - 16px));
}

/* Date-only is the same panel without the time sidebar — it should be
   narrower and more compact. */
.ndp-panel--date-only {
  width: min(340px, calc(100vw - 16px));
}

.ndp-panel--date-only .ndp-cell {
  height: 38px;
}

.ndp-panel--date-only .ndp-cal-col {
  padding: 10px;
}

.ndp-panel--date-only .ndp-weekdays {
  margin-top: 6px;
}

.ndp-panel--date-only .ndp-cal-header {
  padding: 5px 7px;
}

.ndp-panel--date-only .ndp-button-row {
  margin-top: 8px;
}

/* The with-time datetime panel (calendar + time sidebar) — denser than the
   default sizing so the combined width/height footprint reads smaller,
   without going as tight as the date-only or range panels. Scoped away from
   `.ndp-panel--date-only` since that variant has its own, separate sizing. */
.ndp-panel--datetime:not(.ndp-panel--date-only) {
  width: min(500px, calc(100vw - 16px));
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-cal-col {
  /* Bottom stays tight (matches the separate `.ndp-panel--datetime .ndp-cal-col`
     bottom-padding rule below) — the button row underneath needs less air. */
  padding: 12px 12px 4px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-cell {
  height: 40px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-cal-header {
  padding: 6px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-weekdays {
  margin-top: 8px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-button-row {
  margin-top: 10px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-apply,
.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-secondary {
  padding: 9px 12px;
  font-size: 13px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-panel {
  width: 168px;
  gap: 12px;
  padding: 12px 10px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-title {
  font-size: 12px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-input {
  width: 40px;
  padding: 6px 0;
  font-size: 18px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-entry-colon {
  font-size: 18px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-ampm {
  min-width: 40px;
  padding: 6px 4px;
  font-size: 13px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-wheel {
  width: 40px;
  height: 150px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-wheel-list {
  /* Keeps the scroll-snap center band aligned with the shrunk item height:
     (wheel height − item height) / 2 = (150 − 30) / 2. */
  padding: 60px 0;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-wheel-item {
  height: 30px;
  font-size: 15px;
  line-height: 30px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-wheel-item.is-selected {
  font-size: 17px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-wheels::before {
  height: 30px;
}

.ndp-panel--datetime:not(.ndp-panel--date-only) .ndp-time-now {
  padding: 8px 10px;
  font-size: 12px;
}

/* Range picker is compact — narrower panel, smaller cells, denser layout. */
.ndp-panel--compact {
  width: min(520px, calc(100vw - 16px));
}

.ndp-panel--compact .ndp-cell {
  height: 36px;
}

.ndp-panel--compact .ndp-cal-col {
  padding: 10px;
}

.ndp-panel--compact .ndp-weekdays {
  margin-top: 5px;
}

.ndp-panel--compact .ndp-weekday {
  padding: 2px 0;
  font-size: 11px;
}

.ndp-panel--compact .ndp-cal-header {
  padding: 5px 7px;
  grid-template-columns: 28px 28px 1fr 28px 28px;
}

.ndp-panel--compact .ndp-nav {
  min-width: 28px;
  min-height: 28px;
}

.ndp-panel--compact .ndp-cal-label-primary {
  font-size: 13px;
}

.ndp-panel--compact .ndp-cal-label-secondary {
  font-size: 10px;
}

.ndp-panel--compact .ndp-preset,
.ndp-panel--compact .ndp-submenu-item {
  padding: 6px 12px;
  font-size: 12px;
}

.ndp-panel--compact .ndp-presets {
  width: 155px;
}

.ndp-panel--compact .ndp-grid {
  gap: 1px;
}

.ndp-panel--compact .ndp-cell-primary {
  font-size: 13px;
}

.ndp-panel--compact .ndp-cell-secondary {
  font-size: 9px;
}

.ndp-panel--compact .ndp-input-group {
  margin-bottom: 8px;
}

.ndp-panel--compact .ndp-ig-field {
  padding: 4px 8px;
}

.ndp-panel--compact .ndp-ig-label {
  font-size: 9px;
}

.ndp-panel--compact .ndp-ig-value {
  font-size: 12px;
}

.ndp-panel--compact .ndp-apply {
  margin-top: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.ndp-panel--compact .ndp-range-hint {
  margin-bottom: 7px;
  padding: 5px 8px;
  font-size: 11px;
}

.ndp-panel--month {
  width: min(320px, calc(100vw - 16px));
}

.ndp-datetime-body {
  display: flex;
  min-width: 0;
}

.ndp-panel--datetime .ndp-cal-col {
  padding-bottom: 4px;
}

.ndp-presets {
  width: 190px;
  flex: 0 0 auto;
  padding: 8px 0;
  border-right: 1px solid var(--ndp-color-border);
}

.ndp-preset,
.ndp-submenu-item,
.ndp-nav,
.ndp-mode-button,
.ndp-apply,
.ndp-secondary,
.ndp-cell {
  appearance: none;
  border: 0;
  font: inherit;
}

.ndp-preset,
.ndp-submenu-item {
  display: block;
  width: 100%;
  padding: 9px 16px;
  background: transparent;
  color: var(--ndp-color-text);
  text-align: left;
  cursor: pointer;
  transition: var(--ndp-transition);
}

.ndp-preset:hover,
.ndp-submenu-item:hover {
  background: var(--ndp-color-surface-subtle);
}

.ndp-preset:focus-visible,
.ndp-submenu-item:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: -2px;
}

.ndp-preset.is-active {
  background: var(--ndp-color-primary-bg);
  color: var(--ndp-color-primary);
  font-weight: 700;
  /* Colored left edge makes the active preset readable at a glance in the
     list, not just a font-weight/tint difference. */
  box-shadow: inset 3px 0 0 var(--ndp-color-primary);
}

.ndp-submenu-list {
  padding-left: 14px;
}

.ndp-submenu-item {
  color: var(--ndp-color-text-muted);
  font-size: 13px;
}

.ndp-cal-col {
  min-width: 0;
  flex: 1;
  padding: 14px;
}

/* Input group: Start · → · End · BS/AD switch, joined into one bordered control. */
.ndp-input-group {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin-bottom: 12px;
  border: 1px solid var(--ndp-color-border);
  border-radius: var(--ndp-radius);
  overflow: hidden;
  background: var(--ndp-color-surface);
}

.ndp-ig-field {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 1px;
  padding: 6px 10px;
}

.ndp-ig-field.is-active {
  background: var(--ndp-color-primary-bg);
  box-shadow: inset 0 -2px 0 var(--ndp-color-primary);
}

.ndp-ig-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ndp-color-text-faint);
}

.ndp-ig-value {
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ndp-ig-arrow {
  display: flex;
  align-items: center;
  padding: 0 4px;
  color: var(--ndp-color-text-faint);
}

/* Custom-range guidance banner. */
.ndp-range-hint {
  margin-bottom: 10px;
  border-radius: var(--ndp-radius);
  padding: 7px 10px;
  background: var(--ndp-color-primary-bg);
  color: var(--ndp-color-primary);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.ndp-cal-header {
  display: grid;
  grid-template-columns: 34px 34px 1fr 34px 34px;
  align-items: center;
  gap: 2px;
  border-radius: var(--ndp-radius);
  background: var(--ndp-color-primary);
  color: #fff;
  padding: 7px;
}

.ndp-nav {
  min-width: 34px;
  min-height: 34px;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: var(--ndp-transition);
}

.ndp-nav:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ndp-nav:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.ndp-nav.is-hidden {
  visibility: hidden;
}

.ndp-cal-label {
  appearance: none;
  border: 0;
  border-radius: 4px;
  padding: 2px 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: var(--ndp-transition);
}

.ndp-cal-label:hover {
  background: rgba(255, 255, 255, 0.18);
}

.ndp-cal-label:focus-visible {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

.ndp-cal-label-primary {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ndp-cal-label-secondary {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.86;
}

.ndp-weekdays,
.ndp-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.ndp-weekdays {
  margin-top: 10px;
  color: var(--ndp-color-text-muted);
  text-align: center;
}

.ndp-weekday {
  padding: 4px 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

/* Saturday is Nepal's weekly holiday — the calendar convention (matching
   printed BS calendars) is to mark that whole column in red. The grid always
   lays out Sunday-first regardless of mode, so column 7 is always Saturday. */
.ndp-weekday:nth-child(7n) {
  color: var(--ndp-color-danger);
}

.ndp-grid {
  gap: 2px;
}

.ndp-cell {
  display: flex;
  min-width: 0;
  height: 44px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--ndp-radius);
  background: transparent;
  color: var(--ndp-color-text);
  cursor: pointer;
  text-align: center;
  transition: var(--ndp-transition);
}

.ndp-cell--empty {
  cursor: default;
}

/* Flat, quiet dim instead of a strikethrough — reads as "not here" rather
   than "crossed out," and avoids stacking two separate dimming effects
   (a faint color on top of reduced opacity) that made it look muddy. */
.ndp-cell.is-disabled {
  cursor: not-allowed;
  color: var(--ndp-color-text);
  opacity: 0.32;
}

.ndp-cell.is-disabled:hover {
  background: transparent;
}

.ndp-cell:not(.ndp-cell--empty):not(.is-disabled):hover {
  background: var(--ndp-color-primary-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ndp-color-primary) 30%, transparent);
}

.ndp-cell:not(.ndp-cell--empty):focus-visible {
  box-shadow: inset 0 0 0 2px var(--ndp-color-focus);
  outline: none;
}

.ndp-cell-primary {
  font-size: 15px;
  font-weight: 700;
}

.ndp-cell-secondary {
  color: var(--ndp-color-text-faint);
  font-size: 10px;
}

.ndp-cell.is-in-range {
  background: var(--ndp-color-primary-bg);
  border-radius: 0;
}

/* Range caps round only their outer edge so a multi-day selection reads as
   one continuous pill instead of three disconnected shapes. This only kicks
   in when the cap is actually adjacent to other selected days (`is-in-range`
   is present alongside): the single-date/datetime pickers reuse
   `is-range-start` for their one-and-only "selected" cell (no real range,
   never paired with `is-in-range`), so that stays fully rounded on all four
   corners, same as a single-day range (start === end, both classes present). */
.ndp-cell.is-range-start.is-in-range:not(.is-range-end) {
  border-top-left-radius: var(--ndp-radius);
  border-bottom-left-radius: var(--ndp-radius);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.ndp-cell.is-range-end.is-in-range:not(.is-range-start) {
  border-top-right-radius: var(--ndp-radius);
  border-bottom-right-radius: var(--ndp-radius);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* A single-day range (start === end) and the plain date/datetime pickers'
   "selected" cell both land here and stay fully rounded. */
.ndp-cell.is-range-start.is-range-end,
.ndp-cell.is-range-start:not(.is-in-range),
.ndp-cell.is-range-end:not(.is-in-range) {
  border-radius: var(--ndp-radius);
}

.ndp-cell.is-range-start,
.ndp-cell.is-range-end {
  background: var(--ndp-color-primary);
  color: #fff;
  /* Selected caps get a colored "lift" so they read as raised/tactile, not
     just a flat color swap. */
  box-shadow: 0 4px 10px color-mix(in srgb, var(--ndp-color-primary) 40%, transparent);
}

.ndp-cell.is-range-start .ndp-cell-secondary,
.ndp-cell.is-range-end .ndp-cell-secondary {
  color: rgba(255, 255, 255, 0.8);
}

/* Saturday column reads in red, like a printed BS calendar — unless the cell
   is disabled (muted takes over) or selected/in-range (white takes over). */
.ndp-cell:nth-child(7n):not(.is-disabled) .ndp-cell-primary,
.ndp-cell:nth-child(7n):not(.is-disabled) .ndp-cell-secondary {
  color: var(--ndp-color-danger);
}

/* "Today" gets a ring instead of relying on color alone, so it stays
   legible for colorblind users and reads as a distinct, tactile state even
   unselected. Selected days already carry their own shadow, so the ring only
   shows when today isn't also the picked day. */
.ndp-cell.is-today:not(.is-range-start):not(.is-range-end) {
  box-shadow: inset 0 0 0 1.5px var(--ndp-color-primary);
}

.ndp-cell.is-today:not(.is-range-start):not(.is-range-end) .ndp-cell-primary {
  color: var(--ndp-color-primary);
}

.ndp-cell.is-range-start:nth-child(7n) .ndp-cell-primary,
.ndp-cell.is-range-end:nth-child(7n) .ndp-cell-primary,
.ndp-cell.is-range-start:nth-child(7n) .ndp-cell-secondary,
.ndp-cell.is-range-end:nth-child(7n) .ndp-cell-secondary {
  color: #fff;
}

/* Month & year selection views (opened by clicking the header label). */
.ndp-monthgrid,
.ndp-yeargrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.ndp-monthcell,
.ndp-yearcell {
  appearance: none;
  display: flex;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid transparent;
  border-radius: var(--ndp-radius);
  background: transparent;
  color: var(--ndp-color-text);
  font: 700 15px var(--ndp-font);
  cursor: pointer;
  transition: var(--ndp-transition);
}

.ndp-monthcell:hover,
.ndp-yearcell:not(.ndp-yearcell--empty):hover {
  background: var(--ndp-color-primary-bg);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ndp-color-primary) 30%, transparent);
}

.ndp-monthcell:not(.is-disabled):focus-visible,
.ndp-yearcell:not(.ndp-yearcell--empty):focus-visible {
  box-shadow: inset 0 0 0 2px var(--ndp-color-focus);
  outline: none;
}

.ndp-monthcell.is-selected,
.ndp-yearcell.is-selected {
  background: var(--ndp-color-primary);
  color: #fff;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--ndp-color-primary) 40%, transparent);
}

.ndp-monthcell-en,
.ndp-yearcell-en {
  font-size: 10px;
  font-weight: 400;
  color: var(--ndp-color-text-faint);
}

.ndp-monthcell.is-selected .ndp-monthcell-en,
.ndp-yearcell.is-selected .ndp-yearcell-en {
  color: rgba(255, 255, 255, 0.82);
}

/* Month selection (selectionUnit: 'month') — one month = its full date span. */
.ndp-monthgrid--range {
  margin-top: 8px;
}

.ndp-monthcell.is-disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

.ndp-cal-label--static {
  cursor: default;
}

.ndp-yearcell--empty {
  cursor: default;
}

.ndp-yearcell-bs {
  font-variant-numeric: tabular-nums;
}

.ndp-button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.ndp-today-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.ndp-today-btn {
  appearance: none;
  border: 1px solid var(--ndp-color-border);
  border-radius: 999px;
  padding: 2px 9px;
  background: transparent;
  color: var(--ndp-color-primary);
  font: 700 11px var(--ndp-font);
  line-height: 1.6;
  cursor: pointer;
  transition: var(--ndp-transition);
}

.ndp-today-btn:hover {
  background: var(--ndp-color-primary-bg);
  border-color: var(--ndp-color-primary);
}

.ndp-today-btn:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: 1px;
}

.ndp-time-panel {
  display: flex;
  width: 190px;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 14px;
  border-left: 1px solid var(--ndp-color-border);
  padding: 14px 12px;
  background: var(--ndp-color-page);
}

.ndp-time-title {
  color: var(--ndp-color-text-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* editable, keyboard-first time entry ---------------------------------------- */
.ndp-time-entry {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ndp-time-input {
  box-sizing: border-box;
  width: 46px;
  padding: 8px 0;
  border: 1px solid var(--ndp-color-border);
  border-radius: 8px;
  background: var(--ndp-color-surface);
  color: var(--ndp-color-text);
  font: 700 20px/1 var(--ndp-font);
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ndp-time-input:focus-visible {
  outline: 2px solid var(--ndp-color-accent);
  outline-offset: 1px;
  border-color: var(--ndp-color-accent);
}

.ndp-time-input.ndp-input-invalid {
  color: var(--ndp-color-danger);
  border-color: var(--ndp-color-danger);
}

.ndp-time-input.ndp-input-invalid:focus-visible {
  outline-color: var(--ndp-color-danger);
}

.ndp-time-entry-colon {
  font-weight: 700;
  font-size: 20px;
  color: var(--ndp-color-text-muted);
}

.ndp-time-ampm {
  margin-left: 4px;
  min-width: 44px;
  padding: 8px 6px;
  border: 1px solid var(--ndp-color-border);
  border-radius: 8px;
  background: var(--ndp-color-surface);
  color: var(--ndp-color-text);
  font: 700 14px/1 var(--ndp-font);
  cursor: pointer;
}

.ndp-time-ampm:hover {
  border-color: var(--ndp-color-accent);
}

.ndp-time-ampm:focus-visible {
  outline: 2px solid var(--ndp-color-accent);
  outline-offset: 1px;
}

.ndp-time-scroll-hint {
  margin-top: -6px;
  color: var(--ndp-color-text-muted);
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* iOS-style scrollable wheels ------------------------------------------------ */
.ndp-time-wheels {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
}

/* the fixed center band marking the current selection across all wheels */
.ndp-time-wheels::before {
  content: '';
  position: absolute;
  left: 4px;
  right: 4px;
  top: 50%;
  height: 34px;
  transform: translateY(-50%);
  border-radius: 8px;
  background: var(--ndp-color-primary-bg);
  pointer-events: none;
}

.ndp-wheel {
  position: relative;
  width: 44px;
  height: 170px;
}

/* fade the rows away from the center band */
.ndp-wheel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(var(--ndp-color-page), transparent 34%, transparent 66%, var(--ndp-color-page));
}

.ndp-wheel-list {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  padding: 68px 0;
  -webkit-overflow-scrolling: touch;
}

.ndp-wheel-list::-webkit-scrollbar {
  display: none;
}

.ndp-wheel-item {
  display: block;
  width: 100%;
  height: 34px;
  scroll-snap-align: center;
  border: 0;
  background: transparent;
  color: var(--ndp-color-text-muted);
  font: 600 16px/34px var(--ndp-font);
  font-variant-numeric: tabular-nums;
  text-align: center;
  cursor: pointer;
  transition: color 0.12s ease, font-size 0.12s ease;
}

.ndp-wheel-item:hover:not(.is-disabled) {
  color: var(--ndp-color-text);
}

.ndp-wheel-item.is-selected {
  color: var(--ndp-color-primary);
  font-weight: 800;
  font-size: 19px;
}

.ndp-wheel-item.is-disabled {
  color: var(--ndp-color-text-muted);
  opacity: 0.32;
  cursor: not-allowed;
}

.ndp-wheel-colon {
  align-self: center;
  color: var(--ndp-color-text-muted);
  font: 700 18px var(--ndp-font);
}

.ndp-time-now {
  appearance: none;
  margin-top: auto;
  border: 1px solid var(--ndp-color-border);
  border-radius: var(--ndp-radius);
  padding: 9px 12px;
  background: var(--ndp-color-surface);
  color: var(--ndp-color-text);
  font: 700 13px var(--ndp-font);
  cursor: pointer;
  transition: var(--ndp-transition);
}

.ndp-time-now:hover {
  background: var(--ndp-color-primary-bg);
  color: var(--ndp-color-primary);
}

.ndp-time-now:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: 1px;
}

.ndp-apply,
.ndp-secondary {
  width: 100%;
  margin-top: 12px;
  border-radius: var(--ndp-radius);
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  transition: var(--ndp-transition);
}

.ndp-apply {
  background: var(--ndp-color-primary);
  color: #fff;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ndp-color-primary) 30%, transparent);
}

.ndp-apply:hover {
  background: var(--ndp-color-primary-hover);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--ndp-color-primary) 45%, transparent);
  transform: translateY(-1px);
}

.ndp-apply:active {
  background: var(--ndp-color-primary-hover);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--ndp-color-primary) 30%, transparent);
  transform: translateY(0);
}

.ndp-apply:focus-visible,
.ndp-secondary:focus-visible {
  outline: 2px solid var(--ndp-color-focus);
  outline-offset: 1px;
}

.ndp-secondary {
  border: 1px solid var(--ndp-color-border);
  background: var(--ndp-color-surface);
  color: var(--ndp-color-text);
}

.ndp-secondary:hover {
  background: var(--ndp-color-surface-subtle);
}

@media (max-width: 560px) {
  .ndp-panel {
    flex-direction: column;
    width: min(360px, calc(100vw - 16px));
  }

  .ndp-presets {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--ndp-color-border);
  }

  .ndp-datetime-body {
    flex-direction: column;
  }

  .ndp-time-panel {
    width: 100%;
    border-left: 0;
    border-top: 1px solid var(--ndp-color-border);
  }

  .ndp-time-wheels {
    gap: 6px;
  }
}