.cfmd-picker {
  width: 100%;
}

.cfmd-trigger {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid #cbd7e8;
  border-radius: 12px;
  background: #f5f8fc;
  color: #10213f;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.cfmd-trigger:hover {
  border-color: #7ca8eb;
  background: #ffffff;
}

.cfmd-trigger:focus-visible {
  outline: none;
  border-color: #2878ef;
  box-shadow: 0 0 0 3px rgba(40, 120, 239, 0.16);
}

.cfmd-trigger-copy {
  min-width: 0;
}

.cfmd-trigger-title {
  display: block;
  color: #10213f;
  font-weight: 700;
}

.cfmd-trigger-summary {
  display: block;
  margin-top: 3px;
  color: #7183a1;
  font-size: 13px;
  line-height: 1.4;
}

.cfmd-trigger-icon {
  flex: 0 0 auto;
  color: #2878ef;
  font-size: 20px;
}

.cfmd-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.cfmd-selected:empty {
  display: none;
}

.cfmd-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid #b9d3fb;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1765d1;
  font-size: 12px;
  font-weight: 700;
}

.cfmd-dialog {
  position: fixed;
  inset: 0;
  width: min(94vw, 520px);
  max-height: min(90vh, 760px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: #ffffff;
  color: #10213f;
  box-shadow: 0 28px 80px rgba(8, 25, 54, 0.28);
  overflow: hidden;
}

.cfmd-dialog::backdrop {
  background: rgba(9, 24, 50, 0.62);
  backdrop-filter: blur(4px);
}

.cfmd-shell {
  display: flex;
  flex-direction: column;
  max-height: min(90vh, 760px);
}

.cfmd-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 24px 18px;
  border-bottom: 1px solid #e2e9f3;
}

.cfmd-heading {
  margin: 0;
  color: #10213f;
  font-size: 22px;
  line-height: 1.2;
}

.cfmd-description {
  margin: 7px 0 0;
  color: #7183a1;
  font-size: 14px;
  line-height: 1.5;
}

.cfmd-close {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d6dfec;
  border-radius: 10px;
  background: #ffffff;
  color: #60718e;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.cfmd-close:hover {
  background: #f3f6fa;
  color: #10213f;
}

.cfmd-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.cfmd-month-nav {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.cfmd-month-label {
  color: #10213f;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.cfmd-nav-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d6dfec;
  border-radius: 10px;
  background: #f7f9fc;
  color: #10213f;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

.cfmd-nav-button:hover:not(:disabled) {
  border-color: #9cbce9;
  background: #edf4ff;
}

.cfmd-nav-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

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

.cfmd-weekdays {
  margin-bottom: 7px;
}

.cfmd-weekday {
  padding: 5px 0;
  color: #8797af;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cfmd-day {
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: #10213f;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.15s ease;
}

.cfmd-day:hover:not(:disabled) {
  border-color: #a9c7f4;
  background: #eef5ff;
  transform: translateY(-1px);
}

.cfmd-day.is-selected {
  border-color: #1765d1;
  background: #1765d1;
  color: #ffffff;
}

.cfmd-day.is-today:not(.is-selected) {
  border-color: #2878ef;
  color: #1765d1;
}

.cfmd-day.is-outside {
  color: #aab6c8;
}

.cfmd-day:disabled {
  color: #c5cedb;
  cursor: not-allowed;
  text-decoration: line-through;
}

.cfmd-selection-panel {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid #dbe5f2;
  border-radius: 13px;
  background: #f5f8fc;
}

.cfmd-selection-count {
  color: #10213f;
  font-size: 14px;
  font-weight: 800;
}

.cfmd-selection-hint {
  margin-top: 4px;
  color: #7183a1;
  font-size: 12px;
  line-height: 1.45;
}

.cfmd-selection-copy {
  min-width: 0;
}

.cfmd-live-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.cfmd-live-date {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #b9d3fb;
  border-radius: 999px;
  background: #eaf3ff;
  color: #1765d1;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

.cfmd-live-empty {
  color: #8797b0;
  font-size: 12px;
  font-weight: 600;
}

.cfmd-footer {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 10px;
  padding: 18px 24px 24px;
  border-top: 1px solid #e2e9f3;
  background: #ffffff;
}

.cfmd-button {
  min-height: 48px;
  padding: 11px 18px;
  border: 1px solid #d4deeb;
  border-radius: 11px;
  background: #f5f7fb;
  color: #60718e;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cfmd-button:hover {
  background: #edf2f8;
}

.cfmd-button-primary {
  border-color: #10213f;
  background: #10213f;
  color: #ffffff;
}

.cfmd-button-primary:hover {
  background: #19325d;
}

.cfmd-button-primary:disabled {
  border-color: #d3dbe7;
  background: #d3dbe7;
  color: #8795aa;
  cursor: not-allowed;
}

.cfmd-button-clear {
  padding-inline: 12px;
  background: transparent;
  color: #e5484d;
}

.cfmd-field-error,
.dfield.has-error .cfmd-trigger,
.cfmd-trigger.herr {
  border-color: #ef4444 !important;
  background: #fff7f7 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

@media (max-width: 560px) {
  .cfmd-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .cfmd-shell {
    max-height: calc(100vh - 20px);
  }

  .cfmd-header {
    padding: 20px 18px 16px;
  }

  .cfmd-body {
    padding: 18px;
  }

  .cfmd-footer {
    grid-template-columns: 1fr 1fr;
    padding: 16px 18px 18px;
  }

  .cfmd-button-clear {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .cfmd-day {
    border-radius: 9px;
    font-size: 13px;
  }
}

/* Large CrewFill monthly working-date calendar */

.cfmd-day-number {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 2px solid transparent;
  border-radius: 50%;
  position: relative;
  z-index: 1;
}

.cfmd-footer {
  position: relative;
  z-index: 2;
  box-shadow: 0 -8px 24px rgba(15, 31, 61, 0.06);
}

@media (min-width: 721px) {
  .cfmd-dialog {
    width: min(96vw, 960px);
    max-height: min(94vh, 900px);
  }

  .cfmd-shell {
    max-height: min(94vh, 900px);
  }

  .cfmd-header {
    padding: 26px 30px 20px;
  }

  .cfmd-body {
    padding: 22px 30px 24px;
  }

  .cfmd-month-nav {
    grid-template-columns: 48px 1fr 48px;
    margin-bottom: 18px;
  }

  .cfmd-month-label {
    font-size: 20px;
  }

  .cfmd-weekdays {
    gap: 0;
    margin-bottom: 0;
    border: 1px solid #dbe4ef;
    border-bottom: 0;
    border-radius: 14px 14px 0 0;
    overflow: hidden;
  }

  .cfmd-weekday {
    padding: 11px 4px;
    border-right: 1px solid #dbe4ef;
    background: #f5f8fc;
    font-size: 12px;
  }

  .cfmd-weekday:last-child {
    border-right: 0;
  }

  .cfmd-grid {
    gap: 0;
    border-top: 1px solid #dbe4ef;
    border-left: 1px solid #dbe4ef;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
  }

  .cfmd-day {
    min-height: 76px;
    aspect-ratio: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 8px;
    border: 0;
    border-right: 1px solid #dbe4ef;
    border-bottom: 1px solid #dbe4ef;
    border-radius: 0;
    background: #ffffff;
  }

  .cfmd-day:hover:not(:disabled) {
    border-color: #dbe4ef;
    background: #f2f7ff;
    transform: none;
  }

  .cfmd-day.is-selected {
    border-color: #dbe4ef;
    background: #edf5ff;
    color: #ffffff;
  }

  .cfmd-day.is-selected .cfmd-day-number {
    border-color: #1765d1;
    background: #1765d1;
    box-shadow:
      0 0 0 3px rgba(23, 101, 209, 0.12);
  }

  .cfmd-day.is-today:not(.is-selected) {
    border-color: #dbe4ef;
    color: #1765d1;
  }

  .cfmd-day.is-today:not(.is-selected)
  .cfmd-day-number {
    border-color: #2878ef;
    background: #ffffff;
  }

  .cfmd-day.is-outside {
    background: #f8fafc;
  }

  .cfmd-day:disabled {
    background: #f8fafc;
  }

  .cfmd-selection-panel {
    display: grid;
    grid-template-columns:
      minmax(210px, 0.7fr)
      minmax(0, 1.3fr);
    align-items: center;
    gap: 20px;
    margin-top: 16px;
  }

  .cfmd-live-dates {
    justify-content: flex-end;
    margin-top: 0;
  }

  .cfmd-footer {
    padding: 18px 30px 24px;
  }
}


