.cftw-native-control {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.cftw-trigger {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0 42px 0 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background:
    linear-gradient(
      45deg,
      transparent 50%,
      #7183a1 50%
    ) calc(100% - 18px) 20px / 5px 5px
    no-repeat,
    linear-gradient(
      135deg,
      #7183a1 50%,
      transparent 50%
    ) calc(100% - 13px) 20px / 5px 5px
    no-repeat,
    var(--bg-card);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cftw-trigger:hover,
.cftw-trigger:focus-visible {
  border-color: var(--blue);
  outline: none;
  box-shadow:
    0 0 0 3px
    rgba(47, 128, 237, 0.14);
}

.cftw-trigger:disabled {
  border-color: #d7dfeb;
  background: #e9eef5;
  color: #8795aa;
  cursor: not-allowed;
  box-shadow: none;
}

.cftw-trigger[data-empty='true'] {
  color: #8795aa;
}

body.cftw-open {
  overflow: hidden;
}

dialog.cftw-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  color: inherit;
}

dialog.cftw-overlay::backdrop {
  background: rgba(9, 24, 49, 0.66);
  backdrop-filter: blur(5px);
}

dialog.cftw-overlay:not([open]) {
  display: none;
}

.cftw-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height:
    min(
      760px,
      calc(100vh - 40px)
    );
  overflow-y: auto;
  padding: 24px;
  border: 1px solid #d8e3f1;
  border-radius: 24px;
  background: #ffffff;
  color: #10213f;
  box-shadow:
    0 28px 80px
    rgba(7, 24, 50, 0.32);
}

.cftw-handle {
  display: none;
  width: 54px;
  height: 5px;
  margin: -10px auto 18px;
  border-radius: 999px;
  background: #d5deeb;
}

.cftw-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.cftw-kicker {
  margin: 0 0 5px;
  color: #f59e0b;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.cftw-header h2 {
  margin: 0;
  color: #10213f;
  font-size: 24px;
  line-height: 1.2;
}

.cftw-close {
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #d8e3f1;
  border-radius: 12px;
  background: #f7f9fc;
  color: #7183a1;
  font-size: 27px;
  line-height: 1;
  cursor: pointer;
}

.cftw-close:hover,
.cftw-close:focus-visible {
  border-color: #2f80ed;
  color: #10213f;
  outline: none;
}

.cftw-zone {
  display: inline-flex;
  align-items: center;
  margin-top: 14px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #2472df;
  font-size: 12px;
  font-weight: 800;
}

.cftw-preview {
  margin: 22px 0 18px;
  color: #10213f;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.04em;
}

.cftw-wheel-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid #d8e3f1;
  border-radius: 18px;
  background: #f8faff;
}

.cftw-time-wheel {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 294px;
  margin: 0;
  padding: 123px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  box-sizing: border-box;
  border: 0;
  background: transparent;
  outline: none;
  scrollbar-width: none;
  scroll-snap-type: y mandatory;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.cftw-time-wheel::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.cftw-time-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #7183a1;
  font-family: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  opacity: 0.42;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  cursor: pointer;
  transition:
    color 120ms ease,
    opacity 120ms ease,
    transform 120ms ease;
}

.cftw-time-option.is-selected {
  color: #10213f;
  font-size: 23px;
  font-weight: 800;
  opacity: 1;
  transform: scale(1.035);
}

.cftw-time-option:focus {
  outline: none;
}

.cftw-time-wheel:focus-visible {
  box-shadow:
    inset 0 0 0 3px
    rgba(47, 128, 237, 0.2);
}

.cftw-wheel-selection {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 12px;
  left: 12px;
  height: 48px;
  border: 1px solid #b7cff2;
  border-radius: 12px;
  background: #eaf2ff;
  transform: translateY(-50%);
  pointer-events: none;
}

.cftw-wheel-fade {
  position: absolute;
  z-index: 3;
  right: 0;
  left: 0;
  height: 82px;
  pointer-events: none;
}

.cftw-wheel-fade-top {
  top: 0;
  background:
    linear-gradient(
      to bottom,
      #f8faff 15%,
      rgba(248, 250, 255, 0)
    );
}

.cftw-wheel-fade-bottom {
  bottom: 0;
  background:
    linear-gradient(
      to top,
      #f8faff 15%,
      rgba(248, 250, 255, 0)
    );
}

.cftw-help {
  margin: 10px 0 0;
  color: #7183a1;
  font-size: 12px;
  text-align: center;
}

.cftw-actions {
  display: grid;
  grid-template-columns:
    1fr 1.25fr;
  gap: 12px;
  margin-top: 22px;
}

.cftw-actions button {
  min-height: 52px;
  padding: 0 18px;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.cftw-cancel {
  border: 1px solid #d8e3f1;
  background: #f7f9fc;
  color: #5f718d;
}

.cftw-apply {
  border: 1px solid #10213f;
  background: #10213f;
  color: #ffffff;
}

.cftw-cancel:hover,
.cftw-cancel:focus-visible,
.cftw-apply:hover,
.cftw-apply:focus-visible {
  outline: none;
  transform: translateY(-1px);
}

@media (max-width: 560px) {
  .cftw-overlay {
    place-items: end center;
    padding: 0;
  }

  .cftw-dialog {
    width: 100%;
    max-height:
      min(90vh, 760px);
    padding:
      20px 18px
      calc(
        18px +
        env(safe-area-inset-bottom)
      );
    border-radius:
      24px 24px 0 0;
  }

  .cftw-handle {
    display: block;
  }

  .cftw-header h2 {
    font-size: 21px;
  }

  .cftw-preview {
    margin: 18px 0 16px;
    font-size: 38px;
  }

  .cftw-time-wheel {
    height: 264px;
    padding: 108px 8px;
  }

  .cftw-time-option {
    font-size: 18px;
  }

  .cftw-time-option.is-selected {
    font-size: 22px;
  }

  .cftw-actions {
    grid-template-columns: 1fr 1.2fr;
  }
}
