/**
 * Styles for the shared date-range filter: two compact date fields, From and To,
 * and the calendar panel they open (quick ranges, two months, Cancel / Apply).
 * The markup comes from views/partials/date-range-filter.ejs; the panel is drawn
 * by public/js/dateRangeFilter.js (bundled from widgets-src/date-range-filter.js).
 *
 * Plain CSS rather than a partial under public/sass, because this workspace has
 * no Sass build: public/css/style.css ships prebuilt with the WowDash theme.
 * Everything below is expressed through that theme's custom properties, so the
 * filter follows the panel's light and dark palettes without a second set of rules.
 */

.hkm-daterange {
  --dr-accent: var(--primary-600, #487fff);
  --dr-tint: color-mix(in srgb, var(--dr-accent) 10%, transparent);
  --dr-ring: color-mix(in srgb, var(--dr-accent) 18%, transparent);
  --dr-line: var(--border-color, #e5e7eb);
  --dr-ink: var(--text-primary-light, #111827);
  --dr-muted: var(--text-secondary-light, #6b7280);
  /* --white, not --base: the dark theme turns --white dark, while --base stays white in it. */
  --dr-surface: var(--white, #fff);

  position: relative;
  display: inline-block;
  max-width: 100%;
  vertical-align: middle;
}

/* ---- the group: [icon] FROM 05 Oct 2026 (→) TO 03 Nov 2026 [▾] [×] ---- */

.hkm-daterange__fields {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 44px;
  max-width: 100%;
  padding: 0 4px 0 6px;
  border: 1px solid var(--dr-line);
  border-radius: 12px;
  background-color: var(--dr-surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.hkm-daterange__fields:hover {
  border-color: color-mix(in srgb, var(--dr-accent) 40%, var(--dr-line));
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.07);
}

.hkm-daterange__fields:focus-within,
.hkm-daterange.is-open .hkm-daterange__fields {
  border-color: var(--dr-accent);
  box-shadow: 0 0 0 3px var(--dr-ring);
}

/* A range in force: the group says so with its accent, like an active filter chip. */
.hkm-daterange.is-set .hkm-daterange__fields {
  border-color: color-mix(in srgb, var(--dr-accent) 45%, var(--dr-line));
}

/* Icons drawn as masks in the text colour, so they follow the theme. */
.hkm-daterange__icon::before,
.hkm-daterange__sep > span,
.hkm-daterange__quick::before,
.hkm-daterange__clear::before {
  flex: none;
  background-color: currentColor;
  -webkit-mask: var(--dr-icon) center / contain no-repeat;
  mask: var(--dr-icon) center / contain no-repeat;
}

/* The calendar, in a soft tinted tile: opens the From date. */
.hkm-daterange__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 2px;
  border-radius: 9px;
  background-color: var(--dr-tint);
  color: var(--dr-accent);
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.hkm-daterange__icon:hover {
  background-color: var(--dr-ring);
}

.hkm-daterange__icon::before {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='3'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3Ccircle cx='8' cy='14' r='.7' fill='black'/%3E%3Ccircle cx='12' cy='14' r='.7' fill='black'/%3E%3Ccircle cx='16' cy='14' r='.7' fill='black'/%3E%3C/svg%3E");
  content: "";
  width: 17px;
  height: 17px;
}

/* The arrow between the dates, in a small round badge. */
.hkm-daterange__sep {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: 0 1px;
  border-radius: 50%;
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

.hkm-daterange__sep > span {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
  width: 11px;
  height: 11px;
}

/* ---- a field: a small caption over the date, written out ("05 Oct 2026") ---- */

.hkm-daterange__field {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  height: 36px;
  margin: 0;
  padding: 0 10px;
  border-radius: 9px;
  /* The whole field opens the date picker: the input lies over it, unseen. */
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.hkm-daterange__field:hover,
.hkm-daterange__field:focus-within,
.hkm-daterange__field.is-active {
  background-color: var(--dr-tint);
}

/* The end the calendar is picking right now, underlined in the accent. */
.hkm-daterange__field.is-active {
  box-shadow: inset 0 -2px 0 var(--dr-accent);
}

.hkm-daterange__field.is-active .hkm-daterange__caption {
  color: var(--dr-accent);
}

.hkm-daterange__caption {
  color: var(--dr-muted);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.hkm-daterange__value {
  color: var(--dr-ink);
  font-size: 0.875rem;
  font-weight: 650;
  letter-spacing: -0.005em;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hkm-daterange__field:hover .hkm-daterange__value,
.hkm-daterange__field:focus-within .hkm-daterange__value,
.hkm-daterange__field.is-active .hkm-daterange__value {
  color: var(--dr-accent);
}

/* No date chosen (an optional range left open). */
.hkm-daterange__value.is-empty {
  color: var(--dr-muted);
  font-weight: 500;
}

/*
 * Until the script runs, the browser's date input lies over the whole field, unseen, so the field
 * still picks a date. The script then turns it into a hidden input and the field into a button
 * that opens the calendar panel. The theme styles every input; this one is reset to a bare box.
 */
.hkm-daterange__input,
.hkm-daterange__input:focus {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  opacity: 0;
  cursor: pointer;
}

.hkm-daterange__input::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  cursor: pointer;
}

/* Keyboard focus shows on the field, since its input cannot be seen. */
.hkm-daterange__field:has(.hkm-daterange__input:focus-visible),
.hkm-daterange__field:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 2px var(--dr-accent);
}

[data-theme="dark"] .hkm-daterange__input {
  color-scheme: dark;
}

/* ---- the quick-range and clear buttons ---- */

.hkm-daterange__quick,
.hkm-daterange__clear {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--dr-muted);
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease;
}

.hkm-daterange__quick {
  margin-left: 2px;
  border-left: 1px solid var(--dr-line);
  border-radius: 0 7px 7px 0;
}

.hkm-daterange__quick::before {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  content: "";
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}

.hkm-daterange__quick[aria-expanded="true"]::before {
  transform: rotate(180deg);
}

.hkm-daterange__clear::before {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M7 7l10 10M17 7 7 17'/%3E%3C/svg%3E");
  content: "";
  width: 13px;
  height: 13px;
}

.hkm-daterange__quick:hover,
.hkm-daterange__quick[aria-expanded="true"] {
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

.hkm-daterange__clear:hover {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.hkm-daterange__quick:focus-visible,
.hkm-daterange__clear:focus-visible {
  outline: 2px solid var(--dr-accent);
  outline-offset: -2px;
}

/*
 * ---- the calendar panel ----
 *
 *   [ QUICK RANGES ] [ ‹  November 2026 ▾        December 2026 ▾  › ]
 *   [ Today        ] [ Su Mo Tu We Th Fr Sa      Su Mo Tu We Th Fr Sa ]
 *   [ Yesterday    ] [  1  2  3 (4==5==6) 7  ...                      ]
 *   [ ...          ] [ 04 Nov – 06 Nov 2026 · 3 days   Clear Cancel Apply ]
 *
 * Fixed to the window rather than the filter, so a card or a scrolling table it sits in
 * cannot clip it; the script places it under the fields, or over them when there is no room.
 */

.hkm-daterange__panel {
  position: fixed;
  z-index: 1055; /* above Bootstrap's dropdowns; inside a modal it stacks within the modal */
  display: flex;
  max-width: calc(100vw - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--dr-line);
  border-radius: 16px;
  background-color: var(--dr-surface);
  box-shadow:
    0 24px 48px -12px rgba(16, 24, 40, 0.24),
    0 4px 12px rgba(16, 24, 40, 0.06);
  color: var(--dr-ink);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
  transform-origin: top left;
  animation: hkm-dr-open 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.hkm-daterange--align-end .hkm-daterange__panel {
  transform-origin: top right;
}

.hkm-daterange__panel.is-above {
  transform-origin: bottom left;
  animation-name: hkm-dr-open-up;
}

.hkm-daterange--align-end .hkm-daterange__panel.is-above {
  transform-origin: bottom right;
}

.hkm-daterange__panel[hidden] {
  display: none;
}

@keyframes hkm-dr-open {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hkm-dr-open-up {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes hkm-dr-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* The theme styles buttons globally; only what no class below sets is reset here. */
.hkm-daterange__panel button {
  margin: 0;
  font-family: inherit;
  letter-spacing: normal;
  text-align: center;
  text-transform: none;
  -webkit-appearance: none;
  appearance: none;
}

/* Icons drawn as masks in the text colour, like the fields' own. */
.hkm-daterange__nav::before,
.hkm-daterange__title::after,
.hkm-daterange__preset[aria-pressed="true"]::after {
  flex: none;
  content: "";
  background-color: currentColor;
  -webkit-mask: var(--dr-icon) center / contain no-repeat;
  mask: var(--dr-icon) center / contain no-repeat;
}

/* ---- quick ranges, down the side ---- */

.hkm-daterange__presets {
  display: flex;
  flex: none;
  flex-direction: column;
  gap: 2px;
  width: 184px;
  padding: 14px 10px;
  border-right: 1px solid var(--dr-line);
  background-color: color-mix(in srgb, var(--dr-accent) 4%, var(--dr-surface));
}

.hkm-daterange__presets-title {
  padding: 4px 10px 8px;
  color: var(--dr-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hkm-daterange__preset {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--dr-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.hkm-daterange__preset:hover {
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

/* The range in force, filled in the accent with a tick. */
.hkm-daterange__preset[aria-pressed="true"] {
  background-color: var(--dr-accent);
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--dr-accent) 80%, transparent);
  color: #fff;
  font-weight: 600;
}

.hkm-daterange__preset[aria-pressed="true"]::after {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  width: 14px;
  height: 14px;
}

/* ---- the months ---- */

.hkm-daterange__main {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  min-width: 0;
}

.hkm-daterange__calendar {
  position: relative;
  display: flex;
  gap: 32px;
  padding: 16px 20px 12px;
}

.hkm-daterange__month {
  flex: none;
  width: 266px;
}

.hkm-daterange__month-head {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin-bottom: 8px;
}

/* The month's name: opens the month-and-year view. */
.hkm-daterange__title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--dr-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.hkm-daterange__title::after {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  width: 14px;
  height: 14px;
  opacity: 0.6;
}

.hkm-daterange__title:hover {
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

/* Previous and next: at the calendar's two top corners, whether one month shows or two. */
.hkm-daterange__nav {
  position: absolute;
  z-index: 2;
  top: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--dr-line);
  border-radius: 10px;
  background-color: var(--dr-surface);
  color: var(--dr-ink);
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.hkm-daterange__nav--prev {
  left: 20px;
}

.hkm-daterange__nav--next {
  right: 20px;
}

.hkm-daterange__nav::before {
  --dr-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E");
  width: 16px;
  height: 16px;
}

.hkm-daterange__nav--next::before {
  transform: scaleX(-1);
}

.hkm-daterange__nav:hover {
  border-color: color-mix(in srgb, var(--dr-accent) 45%, var(--dr-line));
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

.hkm-daterange__weekdays,
.hkm-daterange__week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.hkm-daterange__weekdays {
  margin-bottom: 4px;
}

.hkm-daterange__weekday {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 28px;
  color: var(--dr-muted);
  font-size: 0.75rem;
  font-weight: 600;
}

.hkm-daterange__weeks {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hkm-daterange__cell {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 38px;
}

.hkm-daterange__day {
  position: relative;
  z-index: 1;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--dr-ink);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    color 0.12s ease;
}

.hkm-daterange__day:hover {
  background-color: var(--dr-ring);
  color: var(--dr-accent);
}

/* Today: ringed in the accent. */
.hkm-daterange__cell.is-today .hkm-daterange__day {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--dr-accent) 60%, transparent);
  color: var(--dr-accent);
  font-weight: 700;
}

/*
 * The range: a tinted band behind the days, rounded where a week or the month ends, and starting
 * and stopping at the middle of the first and last days so it runs into their filled tiles.
 */
.hkm-daterange__cell.is-range::before {
  position: absolute;
  top: 1px;
  right: 0;
  bottom: 1px;
  left: 0;
  content: "";
  background-color: color-mix(in srgb, var(--dr-accent) 11%, transparent);
}

.hkm-daterange__cell.is-range:first-child::before,
.hkm-daterange__cell.is-range.is-first::before {
  left: 1px;
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.hkm-daterange__cell.is-range:last-child::before,
.hkm-daterange__cell.is-range.is-last::before {
  right: 1px;
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.hkm-daterange__cell.is-range.is-start::before {
  left: 50%;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.hkm-daterange__cell.is-range.is-end::before {
  right: 50%;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

/* A first day at the end of a week (or a last day at the start of one) has no band to join. */
.hkm-daterange__cell.is-range.is-start:last-child::before,
.hkm-daterange__cell.is-range.is-start.is-last::before,
.hkm-daterange__cell.is-range.is-end:first-child::before,
.hkm-daterange__cell.is-range.is-end.is-first::before {
  display: none;
}

/* While the last day is being picked, the band that follows the pointer is lighter and dashed. */
.hkm-daterange__cell.is-range.is-preview::before {
  border-top: 1px dashed color-mix(in srgb, var(--dr-accent) 45%, transparent);
  border-bottom: 1px dashed color-mix(in srgb, var(--dr-accent) 45%, transparent);
  background-color: color-mix(in srgb, var(--dr-accent) 6%, transparent);
}

.hkm-daterange__cell.is-range:not(.is-start):not(.is-end) .hkm-daterange__day {
  color: color-mix(in srgb, var(--dr-accent) 65%, var(--dr-ink));
}

.hkm-daterange__cell.is-start .hkm-daterange__day,
.hkm-daterange__cell.is-end .hkm-daterange__day {
  background-color: var(--dr-accent);
  box-shadow: 0 6px 14px -6px color-mix(in srgb, var(--dr-accent) 75%, transparent);
  color: #fff;
  font-weight: 700;
}

.hkm-daterange__cell.is-preview.is-end:not(.is-start) .hkm-daterange__day {
  background-color: color-mix(in srgb, var(--dr-accent) 72%, var(--dr-surface));
}

/* ---- the month-and-year view, laid over the months ---- */

.hkm-daterange__years {
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  display: none;
  flex-direction: column;
  padding: 16px 20px 12px;
  background-color: var(--dr-surface);
}

.hkm-daterange__calendar.is-months .hkm-daterange__years {
  display: flex;
  animation: hkm-dr-fade 0.15s ease;
}

.hkm-daterange__calendar.is-months .hkm-daterange__month {
  visibility: hidden;
}

.hkm-daterange__years-title {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  margin-bottom: 16px;
  color: var(--dr-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hkm-daterange__month-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.hkm-daterange__month-option {
  height: 48px;
  padding: 0;
  border: 1px solid var(--dr-line);
  border-radius: 12px;
  background-color: var(--dr-surface);
  color: var(--dr-ink);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.hkm-daterange__month-option:hover {
  border-color: color-mix(in srgb, var(--dr-accent) 45%, var(--dr-line));
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

/* Months the range covers, tinted; this month, ringed; the month on show, filled. */
.hkm-daterange__month-option.is-in-range {
  border-color: transparent;
  background-color: var(--dr-tint);
  color: var(--dr-accent);
}

.hkm-daterange__month-option.is-this-month {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--dr-accent) 60%, transparent);
}

.hkm-daterange__month-option.is-current {
  border-color: var(--dr-accent);
  background-color: var(--dr-accent);
  color: #fff;
}

/* ---- the foot: what is picked, then Clear / Cancel / Apply ---- */

.hkm-daterange__foot {
  display: flex;
  flex-wrap: wrap;
  /* As wide as the calendar above it, never wider: a long summary wraps instead. */
  width: 0;
  min-width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding: 12px 20px 14px;
  border-top: 1px solid var(--dr-line);
}

.hkm-daterange__summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hkm-daterange__summary-range {
  color: var(--dr-ink);
  font-size: 0.875rem;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.hkm-daterange__summary-note {
  color: var(--dr-muted);
  font-size: 0.75rem;
}

.hkm-daterange__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.hkm-daterange__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--dr-line);
  border-radius: 10px;
  background-color: var(--dr-surface);
  color: var(--dr-ink);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.12s ease,
    border-color 0.12s ease,
    color 0.12s ease;
}

.hkm-daterange__btn:hover {
  border-color: color-mix(in srgb, var(--dr-accent) 45%, var(--dr-line));
  color: var(--dr-accent);
}

.hkm-daterange__btn--quiet {
  padding: 0 10px;
  border-color: transparent;
  background: none;
  color: var(--dr-muted);
}

.hkm-daterange__btn--quiet:hover {
  border-color: transparent;
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.hkm-daterange__btn--primary {
  min-width: 88px;
  border-color: var(--dr-accent);
  background-color: var(--dr-accent);
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--dr-accent) 80%, transparent);
  color: #fff;
}

.hkm-daterange__btn--primary:hover {
  border-color: color-mix(in srgb, var(--dr-accent) 86%, #000);
  background-color: color-mix(in srgb, var(--dr-accent) 86%, #000);
  color: #fff;
}

.hkm-daterange__btn:disabled {
  box-shadow: none;
  opacity: 0.45;
  pointer-events: none;
}

.hkm-daterange__preset:focus-visible,
.hkm-daterange__title:focus-visible,
.hkm-daterange__nav:focus-visible,
.hkm-daterange__month-option:focus-visible,
.hkm-daterange__btn:focus-visible {
  outline: 2px solid var(--dr-accent);
  outline-offset: 2px;
}

.hkm-daterange__day:focus-visible {
  outline: 2px solid var(--dr-accent);
  outline-offset: 1px;
}

/* ---- narrower windows: one month (the script reads the same width) ---- */

@media (min-width: 800px) {
  .hkm-daterange__month-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 799.98px) {
  .hkm-daterange__month + .hkm-daterange__month {
    display: none;
  }
}

/* ---- small screens: the two fields share the row ---- */

@media (max-width: 575.98px) {
  .hkm-daterange,
  .hkm-daterange__fields {
    width: 100%;
  }

  .hkm-daterange__field {
    flex: 1 1 0;
  }

  .hkm-daterange__input,
  .hkm-daterange__input:focus {
    width: 100%;
  }

  /* The panel spans the window: quick ranges become a row of chips over one month. */
  .hkm-daterange__panel {
    flex-direction: column;
    width: calc(100vw - 24px);
  }

  .hkm-daterange__presets {
    flex-direction: row;
    gap: 6px;
    width: auto;
    padding: 10px 12px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--dr-line);
    scrollbar-width: none;
  }

  .hkm-daterange__presets::-webkit-scrollbar {
    display: none;
  }

  .hkm-daterange__presets-title,
  .hkm-daterange__preset[aria-pressed="true"]::after {
    display: none;
  }

  .hkm-daterange__preset {
    flex: none;
    width: auto;
    min-height: 34px;
    padding: 6px 12px;
    border: 1px solid var(--dr-line);
    border-radius: 999px;
  }

  .hkm-daterange__preset[aria-pressed="true"] {
    border-color: var(--dr-accent);
  }

  .hkm-daterange__calendar,
  .hkm-daterange__years {
    padding: 12px 12px 8px;
  }

  .hkm-daterange__month {
    width: 100%;
  }

  .hkm-daterange__nav {
    top: 12px;
  }

  .hkm-daterange__nav--prev {
    left: 12px;
  }

  .hkm-daterange__nav--next {
    right: 12px;
  }

  .hkm-daterange__foot {
    padding: 12px;
  }

  .hkm-daterange__actions {
    width: 100%;
  }

  .hkm-daterange__btn--primary {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hkm-daterange__panel,
  .hkm-daterange__calendar.is-months .hkm-daterange__years {
    animation: none;
  }

  .hkm-daterange__quick::before {
    transition: none;
  }
}
