/* Month / day picker in the paper look (shared/paper_date_picker.ts).
   Cream sheet, thick ink outline, hard shadow, teal for the chosen cell,
   DM Sans. The panel is appended to <body>, outside the page's ".body"
   wrapper, so it styles everything it uses itself. */

/* The field: the same box as the text inputs beside it. */
.pdp-trigger {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 12px;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  width: 100%;
  min-height: 49px;
  margin: 8px 0;
  padding: 12px 16px 12px 20px;
  border: 2.5px solid #333333;
  border-radius: 12px;
  background: #fbefe5;
  -webkit-box-shadow: 3px 3px 0 #333333;
          box-shadow: 3px 3px 0 #333333;
  color: #2a211c;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  text-align: left;
  -webkit-transition: border-color 0.15s ease, -webkit-box-shadow 0.15s ease, -webkit-transform 0.15s ease;
  transition: border-color 0.15s ease, -webkit-box-shadow 0.15s ease, -webkit-transform 0.15s ease;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
  transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease, -webkit-box-shadow 0.15s ease, -webkit-transform 0.15s ease;
}

.pdp-trigger__value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pdp-trigger--empty .pdp-trigger__value {
  color: #9a8578;
  font-weight: 400;
}

.pdp-trigger__icon {
  -webkit-box-flex: 0;
      -ms-flex: none;
          flex: none;
  color: #2a211c;
}

/* The old ".body button:active" rule turns buttons black and drops them 4px;
   the field presses in like the other paper boxes instead. */
.body .pdp-trigger:active {
  background: #fbefe5;
  -webkit-box-shadow: 1px 1px 0 #333333;
          box-shadow: 1px 1px 0 #333333;
  -webkit-transform: translate(2px, 2px);
      -ms-transform: translate(2px, 2px);
          transform: translate(2px, 2px);
}

.pdp-trigger--open {
  border-color: #d0673f;
  outline: none;
}

.pdp-trigger:focus {
  border-color: #d0673f;
  outline: none;
}

/* ---- The panel ---------------------------------------------------------- */
.pdp-panel {
  position: fixed;
  z-index: 1045;
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
  overflow-y: auto;
  -ms-scroll-chaining: none;
      overscroll-behavior: contain;
  border: 2.5px solid #333333;
  background: #fbefe5;
  color: #2a211c;
  font-family: "DM Sans", sans-serif;
}

.pdp-panel *,
.pdp-panel *::before,
.pdp-panel *::after {
  -webkit-box-sizing: border-box;
          box-sizing: border-box;
}

/* Beside the field. */
.pdp-panel--pop {
  padding: 12px;
  border-radius: 14px;
  -webkit-box-shadow: 5px 5px 0 #333333;
          box-shadow: 5px 5px 0 #333333;
  -webkit-transform-origin: top center;
      -ms-transform-origin: top center;
          transform-origin: top center;
  -webkit-transition: opacity 0.16s ease, -webkit-transform 0.16s ease;
  transition: opacity 0.16s ease, -webkit-transform 0.16s ease;
  transition: opacity 0.16s ease, transform 0.16s ease;
  transition: opacity 0.16s ease, transform 0.16s ease, -webkit-transform 0.16s ease;
}

.pdp-panel--pop.pdp-panel--above {
  -webkit-transform-origin: bottom center;
      -ms-transform-origin: bottom center;
          transform-origin: bottom center;
}

.pdp-panel--pop.pdp-enter,
.pdp-panel--pop.pdp-leave {
  opacity: 0;
  -webkit-transform: translateY(-6px) scale(0.97);
      -ms-transform: translateY(-6px) scale(0.97);
          transform: translateY(-6px) scale(0.97);
}

.pdp-panel--pop.pdp-panel--above.pdp-enter,
.pdp-panel--pop.pdp-panel--above.pdp-leave {
  -webkit-transform: translateY(6px) scale(0.97);
      -ms-transform: translateY(6px) scale(0.97);
          transform: translateY(6px) scale(0.97);
}

/* A sheet from the bottom edge on phones and short screens. */
.pdp-panel--sheet {
  right: 0;
  bottom: 0;
  left: 0;
  max-height: 88vh;
  max-height: 88dvh;
  margin: 0 auto;
  max-width: 520px;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
  -webkit-box-shadow: 0 -4px 0 #333333;
          box-shadow: 0 -4px 0 #333333;
  -webkit-transition: -webkit-transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: -webkit-transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), -webkit-transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.pdp-panel--sheet.pdp-enter,
.pdp-panel--sheet.pdp-leave {
  -webkit-transform: translateY(105%);
      -ms-transform: translateY(105%);
          transform: translateY(105%);
}

.pdp-scrim {
  /* Takes every press and drag itself: nothing under it scrolls or is hit. */
  -ms-touch-action: none;
      touch-action: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1044;
  background: rgba(12, 10, 10, 0.55);
  -webkit-transition: opacity 0.2s ease;
  transition: opacity 0.2s ease;
}

.pdp-scrim.pdp-enter,
.pdp-scrim.pdp-leave {
  opacity: 0;
}

.pdp-sheet-top {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pdp-sheet-title {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}

/* ---- Buttons inside (reset first: none of the page's button rules) ----- */
.pdp-panel button {
  margin: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.pdp-panel button:disabled {
  cursor: default;
}

/* Keyboard focus ring; older browsers (no :focus-visible) show it on any
   focus, which is still correct. */
.pdp-panel button:focus {
  outline: 3px solid #005a9c;
  outline-offset: 2px;
}

.pdp-panel button:focus:not(:focus-visible) {
  outline: none;
}

/* Announces the month or year shown, for screen readers only. */
.pdp-live {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.pdp-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 2.5px solid #333333 !important;
  border-radius: 50%;
  background: #fbefe5 !important;
  -webkit-box-shadow: 2px 2px 0 #333333;
          box-shadow: 2px 2px 0 #333333;
  font-size: 22px !important;
  line-height: 1;
}

.pdp-head {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
      -ms-flex-align: center;
          align-items: center;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.pdp-nav {
  display: grid;
  place-items: center;
  -webkit-box-flex: 0;
      -ms-flex: none;
          flex: none;
  width: 40px;
  height: 40px;
  border: 2.5px solid #333333 !important;
  border-radius: 10px;
  background: #f6e2d2 !important;
  -webkit-box-shadow: 2px 2px 0 #333333;
          box-shadow: 2px 2px 0 #333333;
  font-size: 22px !important;
  font-weight: 700 !important;
  line-height: 1;
}

.pdp-nav:disabled {
  opacity: 0.3;
  -webkit-box-shadow: none;
          box-shadow: none;
}

.pdp-caption {
  -webkit-box-flex: 1;
      -ms-flex: 1;
          flex: 1;
  min-width: 0;
  font-size: 16px !important;
  font-weight: 800 !important;
  text-align: center;
}

.pdp-caption--button {
  padding: 8px 6px !important;
  border-radius: 10px;
}

@media (hover: hover) {
  .pdp-caption--button:hover {
    background: #f6e2d2 !important;
  }
}

.pdp-week {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin-bottom: 4px;
  color: #6e5a4e;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.pdp-week span {
  padding: 4px 0;
}

.pdp-grid {
  display: grid;
  gap: 6px;
}

.pdp-grid--months {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.pdp-grid--days {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}

.pdp-cell {
  min-height: 42px;
  border: 2px solid transparent !important;
  border-radius: 10px;
  font-size: 15px !important;
  font-weight: 600 !important;
  font-variant-numeric: tabular-nums;
  -webkit-transition: background-color 0.12s ease;
  transition: background-color 0.12s ease;
}

.pdp-grid--days .pdp-cell {
  min-height: 34px;
  border-radius: 50%;
  aspect-ratio: 1;
  justify-self: center;
  width: 100%;
  max-width: 36px;
}

@media (hover: hover) {
  .pdp-cell:not(:disabled):not(.pdp-cell--selected):hover {
    background: #f6e2d2 !important;
  }
}

.pdp-cell--today {
  border-color: #f0986e !important;
  border-style: dashed !important;
}

.pdp-cell--selected {
  border: 2px solid #333333 !important;
  border-style: solid !important;
  background: #93f9e8 !important;
  -webkit-box-shadow: 2px 2px 0 #333333;
          box-shadow: 2px 2px 0 #333333;
  font-weight: 800 !important;
}

.pdp-cell:disabled {
  opacity: 0.3;
}

.pdp-blank {
  min-height: 34px;
}

.pdp-foot {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
      -ms-flex-pack: justify;
          justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1.5px dashed #c9b2a3;
}

.pdp-action {
  padding: 9px 14px !important;
  border: 2px solid #333333 !important;
  border-radius: 10px;
  background: #fbefe5 !important;
  -webkit-box-shadow: 2px 2px 0 #333333;
          box-shadow: 2px 2px 0 #333333;
  font-size: 14px !important;
  font-weight: 700 !important;
}

.pdp-action--strong {
  background: #93f9e8 !important;
}

.pdp-action:disabled {
  opacity: 0.4;
  -webkit-box-shadow: none;
          box-shadow: none;
}

.pdp-panel button:not(:disabled):active {
  -webkit-transform: translate(1px, 1px);
      -ms-transform: translate(1px, 1px);
          transform: translate(1px, 1px);
  -webkit-box-shadow: none;
          box-shadow: none;
}

/* Bigger targets for fingers. */
@media (pointer: coarse) {
  .pdp-cell {
    min-height: 46px;
  }

  .pdp-grid--days .pdp-cell {
    min-height: 40px;
    max-width: 44px;
  }

  .pdp-nav,
  .pdp-close {
    width: 44px;
    height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pdp-panel,
  .pdp-scrim,
  .pdp-trigger {
    -webkit-transition: none;
    transition: none;
  }
}

/* A phone on its side (short screen): the sheet keeps the whole month in
   view. The title row goes (the × moves up beside the arrows), and cells and
   gaps are tighter. */
.pdp-panel--short {
  max-height: calc(100vh - 8px);
  max-height: calc(100dvh - 8px);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
}

.pdp-panel--short .pdp-sheet-top {
  position: absolute;
  top: 8px;
  right: 14px;
  margin: 0;
}

.pdp-panel--short .pdp-sheet-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pdp-panel--short .pdp-close {
  width: 36px;
  height: 36px;
}

.pdp-panel--short .pdp-head {
  margin-right: 46px;
  margin-bottom: 6px;
}

.pdp-panel--short .pdp-nav {
  width: 36px;
  height: 36px;
}

.pdp-panel--short .pdp-week span {
  padding: 1px 0;
}

.pdp-panel--short .pdp-grid--months .pdp-cell {
  min-height: 34px;
}

.pdp-panel--short .pdp-grid--days {
  gap: 2px;
}

.pdp-panel--short .pdp-grid--days .pdp-cell {
  min-height: 0;
  max-width: 30px;
}

.pdp-panel--short .pdp-blank {
  min-height: 0;
}

.pdp-panel--short .pdp-foot {
  margin-top: 6px;
  padding-top: 6px;
}

.pdp-panel--short .pdp-action {
  padding: 6px 12px !important;
}
