/* «Громко» — выбор даты (datepicker.js). Общий для лендинга, конструктора и анкеты.
   Язык бренда: тёплая бумага, Prata в названии месяца, Golos в числах, оливковый акцент, тонкие линии.
   Страница может переопределить токены --dp-* у .dp (окно) и стиль кнопки-поля .dp-field (под свои поля). */

/* исходный input — источник значения, на экране его нет */
input.dp-src { display: none !important; }

/* кнопка-поле: раскладка; рамку, фон и размер даёт страница (классы input копируются на кнопку, напр. .inp) */
.dp-field {
  display: flex; align-items: center; gap: 10px;
  width: 100%; min-width: 0; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
:where(.dp-field) { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; -webkit-appearance: none; appearance: none; }
.dp-field__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dp-field.is-empty .dp-field__t { color: var(--dp-ph, #8A857C); }
.dp-field__i { display: inline-flex; flex: none; width: 18px; height: 18px; color: var(--dp-icon, currentColor); opacity: .55; transition: opacity .2s; }
.dp-field__i svg { width: 100%; height: 100%; }
.dp-field:hover .dp-field__i, .dp-field[aria-expanded="true"] .dp-field__i { opacity: .9; }
.dp-field:disabled { cursor: default; }

/* ---------- окно ---------- */
.dp {
  --dp-bg: #FBFAF7;
  --dp-ink: #161616;
  --dp-soft: #66625B;
  --dp-mute: #A29D94;
  --dp-line: rgba(22, 22, 22, .1);
  --dp-accent: #3E4630;
  --dp-on-accent: #F4F0E6;
  --dp-hover: rgba(62, 70, 48, .08);
  --dp-serif: "Prata", "Prata Fallback", Georgia, "Times New Roman", serif;
  --dp-sans: "Golos Text", "Golos Fallback", system-ui, -apple-system, "Segoe UI", sans-serif;
  position: fixed; inset: auto; margin: 0; padding: 0; border: 0;
  width: 324px; max-width: calc(100vw - 16px); max-height: none; overflow: visible;
  background: transparent; color: var(--dp-ink);
  font: 400 15px/1.3 var(--dp-sans); color-scheme: light;
}
.dp::backdrop { background: transparent; }
.dp:focus { outline: none; }
.dp__in {
  background: var(--dp-bg); border-radius: 18px; padding: 12px 14px 14px;
  box-shadow: 0 0 0 1px var(--dp-line), 0 24px 60px -18px rgba(22, 22, 22, .32), 0 4px 14px -6px rgba(22, 22, 22, .12);
  animation: dpIn .2s cubic-bezier(.2, .7, .1, 1) both;
}
.dp.is-closing .dp__in { animation: dpOut .18s ease both; }
@keyframes dpIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes dpOut { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.dp__grab { display: none; }

.dp__head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; margin-bottom: 6px; }
.dp__nav, .dp__title, .dp__d, .dp__m {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dp__nav { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--dp-soft); transition: background-color .2s, color .2s; }
.dp__nav svg { width: 20px; height: 20px; }
.dp__nav:hover:not(:disabled) { background: var(--dp-hover); color: var(--dp-ink); }
.dp__nav:disabled { opacity: .25; cursor: default; }
.dp__title {
  justify-self: center; min-height: 44px; padding: 0 12px; border-radius: 999px;
  font: 400 19px/1.1 var(--dp-serif); letter-spacing: -.01em; transition: background-color .2s;
}
.dp__title:hover { background: var(--dp-hover); }

.dp__wd, .dp__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dp__wd { padding: 4px 0 6px; border-bottom: 1px solid var(--dp-line); margin-bottom: 6px; }
.dp__wd span { text-align: center; font-size: 11px; letter-spacing: .08em; text-transform: lowercase; color: var(--dp-mute); }
.dp__grid { row-gap: 2px; }
.dp__d {
  position: relative; height: 42px; border-radius: 50%; aspect-ratio: 1; justify-self: center; max-width: 100%;
  font-size: 15px; font-variant-numeric: lining-nums tabular-nums;
  transition: background-color .15s, color .15s;
}
.dp__d:hover:not(.is-off):not(.is-sel) { background: var(--dp-hover); }
.dp__d.is-we:not(.is-sel) { color: var(--dp-soft); }
.dp__pad { height: 42px; }
.dp__d.is-today::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--dp-accent); }
.dp__d.is-sel { background: var(--dp-accent); color: var(--dp-on-accent); }
.dp__d.is-sel.is-today::after { background: var(--dp-on-accent); }
.dp__d.is-off, .dp__d.is-off.is-we { color: var(--dp-mute); opacity: .55; cursor: default; }
.dp__d:focus-visible, .dp__m:focus-visible, .dp__nav:focus-visible, .dp__title:focus-visible { outline: 2px solid var(--dp-accent); outline-offset: 1px; }

.dp__months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding-top: 6px; border-top: 1px solid var(--dp-line); }
.dp__m { min-height: 48px; border-radius: 12px; font-size: 15px; transition: background-color .15s; }
.dp__m:hover:not(.is-off):not(.is-sel) { background: var(--dp-hover); }
.dp__m.is-sel { background: var(--dp-accent); color: var(--dp-on-accent); }
.dp__m.is-off { color: var(--dp-mute); opacity: .55; cursor: default; }
.dp [hidden] { display: none !important; }

/* ---------- телефон: нижний лист ---------- */
.dp.dp--sheet { inset: auto 0 0 0; width: 100%; max-width: 100%; }
.dp.dp--sheet::backdrop { background: rgba(22, 20, 16, .36); animation: dpFade .25s ease both; }
.dp.dp--sheet .dp__in {
  border-radius: 22px 22px 0 0; padding: 8px max(16px, env(safe-area-inset-left)) calc(18px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-right));
  box-shadow: 0 -10px 40px -12px rgba(22, 22, 22, .3);
  animation: dpUp .28s cubic-bezier(.2, .7, .1, 1) both;
  max-width: 480px; margin: 0 auto;
}
.dp.dp--sheet.is-closing .dp__in { animation: dpDown .18s ease both; }
.dp.dp--sheet .dp__grab { display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--dp-line); margin: 0 auto 8px; }
.dp.dp--sheet .dp__title { font-size: 21px; }
.dp.dp--sheet .dp__d { height: 46px; font-size: 16px; }
.dp.dp--sheet .dp__pad { height: 46px; }
@media (max-width: 359px) { .dp.dp--sheet .dp__d, .dp.dp--sheet .dp__pad { height: 40px; } .dp.dp--sheet .dp__in { padding-left: 10px; padding-right: 10px; } }
@keyframes dpUp { from { transform: translateY(100%); } }
@keyframes dpDown { to { transform: translateY(100%); } }
@keyframes dpFade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  .dp__in, .dp.dp--sheet .dp__in, .dp.dp--sheet::backdrop { animation: none !important; }
}
