.lc-dp-field {
  position: relative;
}

.lc-dp-helper {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #475569;
}

.lc-dp-input-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}

.lc-dp-input {
  width: 100%;
  min-width: 0;
  padding-right: 2.75rem;
  font-size: 1rem;
}

@media (min-width: 640px) {
  .lc-dp-input {
    font-size: 0.875rem;
  }
}

.lc-dp-input.lc-dp-input--error {
  border-color: #f43f5e;
}

.lc-dp-cal-btn {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  transform: translateY(-50%);
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
}

.lc-dp-cal-btn:hover {
  background: #e3d5d4;
}

.lc-dp-cal-btn:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.lc-dp-cal-btn svg {
  width: 1.25rem;
  height: 1.25rem;
}

.lc-dp-error {
  margin-top: 0.375rem;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #e11d48;
}

.lc-dp-live {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Desktop popover */
.lc-dp-popover {
  position: absolute;
  z-index: 30;
  width: 21rem;
  max-width: calc(100vw - 2rem);
  padding: 0.75rem;
  border: 1px solid #e3d5d4;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}

.lc-dp-popover .lc-dp-header {
  margin-bottom: 0.5rem;
}

.lc-dp-popover .lc-dp-nav-btn {
  min-width: 2.25rem;
  min-height: 2.25rem;
}

.lc-dp-popover .lc-dp-select {
  min-height: 2.25rem;
  padding-top: 0.25rem;
  padding-bottom: 0.25rem;
}

.lc-dp-popover .lc-dp-weekdays {
  margin-bottom: 0.125rem;
}

.lc-dp-popover .lc-dp-grid {
  gap: 0;
}

.lc-dp-popover .lc-dp-day,
.lc-dp-popover .lc-dp-day--empty {
  width: 2rem;
  height: 2rem;
}

.lc-dp-popover .lc-dp-footer {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.lc-dp-popover .lc-dp-done-btn {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.lc-dp-popover--above {
  bottom: 100%;
  margin-bottom: 0.5rem;
}

.lc-dp-popover--below {
  top: 100%;
  margin-top: 0.5rem;
}

.lc-dp-header {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.lc-dp-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
}

.lc-dp-nav-btn:hover:not(:disabled) {
  background: #e3d5d4;
}

.lc-dp-nav-btn:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.lc-dp-nav-btn:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.lc-dp-select {
  min-width: 0;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #e3d5d4;
  border-radius: 0.75rem;
  background: #fff;
  color: #0f172a;
}

.lc-dp-month-select {
  flex: 1.7 1 0;
}

.lc-dp-year-select {
  flex: 1 1 0;
}

@media (min-width: 640px) {
  .lc-dp-select {
    font-size: 0.875rem;
  }
}

.lc-dp-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.125rem;
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
  color: #64748b;
}

.lc-dp-grid {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  overflow: visible;
}

.lc-dp-row {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.125rem;
  padding: 0 2px;
  overflow: visible;
}

.lc-dp-day {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2.25rem;
  height: 2.25rem;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 9999px;
  background: transparent;
  font-size: 0.875rem;
  color: #0f172a;
  cursor: pointer;
  justify-self: center;
  aspect-ratio: 1;
}

.lc-dp-day--empty {
  width: 2.25rem;
  height: 2.25rem;
  pointer-events: none;
  justify-self: center;
}

.lc-dp-day:hover:not(:disabled):not(.lc-dp-day--selected) {
  background: #e3d5d4;
}

.lc-dp-day--selected {
  background: #aeb39d;
  font-weight: 700;
  color: #0f172a;
}

.lc-dp-day--today:not(.lc-dp-day--selected) {
  box-shadow: inset 0 0 0 1px #aeb39d;
}

.lc-dp-day:disabled {
  color: #cbd5e1;
  cursor: not-allowed;
}

.lc-dp-day:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

.lc-dp-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e3d5d4;
}

.lc-dp-text-btn {
  padding: 0.375rem 0.5rem;
  border: none;
  border-radius: 0.5rem;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.lc-dp-text-btn:hover {
  background: #e3d5d4;
}

.lc-dp-done-btn {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 0.75rem;
  background: #aeb39d;
  font-size: 0.875rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.lc-dp-done-btn:hover {
  background: #e3d5d4;
}

.lc-dp-done-btn:focus-visible,
.lc-dp-text-btn:focus-visible {
  outline: 2px solid #0f172a;
  outline-offset: 2px;
}

/* Mobile sheet */
.lc-dp-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.4);
}

.lc-dp-sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 51;
  display: flex;
  flex-direction: column;
  max-height: 90dvh;
  padding-bottom: env(safe-area-inset-bottom, 0);
  border-radius: 1.5rem 1.5rem 0 0;
  background: #fff;
  overflow: hidden;
}

.lc-dp-sheet--anim {
  transform: translateY(100%);
  transition: transform 0.28s ease;
}

.lc-dp-sheet--open {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .lc-dp-sheet--anim {
    transition: none;
  }
}

.lc-dp-handle {
  flex-shrink: 0;
  width: 2.5rem;
  height: 0.25rem;
  margin: 0.625rem auto 0;
  border-radius: 9999px;
  background: #e3d5d4;
}

.lc-dp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 1rem 0.5rem;
}

.lc-dp-sheet-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: #0f172a;
}

.lc-dp-close-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
}

.lc-dp-close-btn:hover {
  background: #e3d5d4;
}

.lc-dp-sheet-body {
  flex: 1;
  padding: 0 1rem 1rem;
  overflow-y: auto;
}

.lc-dp-sheet .lc-dp-nav-btn {
  min-width: 2.75rem;
  min-height: 2.75rem;
}

.lc-dp-sheet .lc-dp-day {
  width: min(100%, 2.75rem);
  height: 2.75rem;
  font-size: 1rem;
}

.lc-dp-sheet .lc-dp-day--empty {
  width: min(100%, 2.75rem);
  height: 2.75rem;
}

.lc-dp-confirm-btn {
  display: block;
  width: 100%;
  min-height: 3rem;
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.75rem;
  background: #aeb39d;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  cursor: pointer;
}

.lc-dp-confirm-btn:hover {
  background: #e3d5d4;
}

.lc-dp-clear-link {
  display: block;
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.5rem;
  border: none;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  text-align: center;
}

.lc-dp-body-lock {
  overflow: hidden;
}
