:root {
  --birth-wheel-primary: #665be7;
  --birth-wheel-primary-2: #8177f5;
  --birth-wheel-soft: #f0efff;
  --birth-wheel-text: #171a23;
  --birth-wheel-muted: #7b8190;
  --birth-wheel-line: #e7e9f1;
  --birth-wheel-item-height: 50px;
}

.birth-date-wheel-source {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  clip-path: inset(50%) !important;
  pointer-events: none !important;
}

input[type="hidden"].birth-date-wheel-source { display: none !important; }

.birth-date-wheel-trigger {
  width: 100%;
  min-height: 50px;
  padding: 8px 13px;
  border: 1px solid #d9dce7;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--birth-wheel-text);
  background: #fff;
  box-shadow: 0 3px 10px rgba(24, 29, 43, .035);
  font: inherit;
  text-align: start;
  cursor: pointer;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.birth-date-wheel-trigger:hover,
.birth-date-wheel-trigger:focus-visible {
  border-color: var(--birth-wheel-primary);
  box-shadow: 0 0 0 3px rgba(102, 91, 231, .12);
  outline: none;
}

.birth-date-wheel-trigger:active { transform: scale(.995); }
.birth-date-wheel-trigger:disabled { opacity: .62; cursor: not-allowed; }

.birth-date-wheel-trigger__value {
  direction: ltr;
  color: var(--birth-wheel-text);
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: .25px;
}

.birth-date-wheel-trigger.is-empty .birth-date-wheel-trigger__value {
  direction: rtl;
  color: var(--birth-wheel-muted);
  font-weight: 500;
  letter-spacing: 0;
}

.birth-date-wheel-trigger__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--birth-wheel-primary);
  background: var(--birth-wheel-soft);
}

.birth-date-wheel-trigger__icon svg { width: 18px; height: 18px; }

.birth-wheel-backdrop {
  position: fixed;
  z-index: 8990;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(15, 18, 27, .46);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  cursor: default;
  transition: opacity .24s ease, visibility .24s ease;
}

.birth-wheel-backdrop.is-open { opacity: 1; visibility: visible; }

.birth-wheel-sheet {
  position: fixed;
  z-index: 9000;
  left: 50%;
  bottom: 0;
  width: min(100%, 520px);
  max-height: min(92dvh, 650px);
  padding: 9px 16px calc(16px + env(safe-area-inset-bottom));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .72);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  color: var(--birth-wheel-text);
  background: #fff;
  box-shadow: 0 -12px 60px rgba(20, 24, 38, .22);
  direction: rtl;
  transform: translate(-50%, 105%);
  visibility: hidden;
  transition: transform .32s cubic-bezier(.2, .8, .2, 1), visibility .32s ease;
}

.birth-wheel-sheet.is-open { transform: translate(-50%, 0); visibility: visible; }

.birth-wheel-sheet__handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 6px;
  border-radius: 999px;
  background: #d9dce5;
}

.birth-wheel-sheet__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0 11px;
}

.birth-wheel-sheet__title { margin: 0; font-size: 17px; font-weight: 800; }

.birth-wheel-sheet__close {
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #555b68;
  background: #f1f2f6;
  cursor: pointer;
}

.birth-wheel-sheet__close:hover,
.birth-wheel-sheet__close:focus-visible { color: #fff; background: #665be7; outline: none; }

.birth-wheel-preview {
  padding: 9px 13px;
  border: 1px solid #e9e7ff;
  border-radius: 14px;
  background: linear-gradient(180deg, #faf9ff, #f4f3ff);
  text-align: center;
}

.birth-wheel-preview small { display: block; margin-bottom: 1px; color: var(--birth-wheel-muted); font-size: 10px; }
.birth-wheel-preview strong {
  display: inline-block; direction: ltr; color: var(--birth-wheel-primary);
  font-size: 18px; font-weight: 850; font-variant-numeric: tabular-nums; letter-spacing: .55px;
}

.birth-wheel-labels,
.birth-wheel-columns {
  display: grid;
  grid-template-columns: 1fr 1fr 1.3fr;
  gap: 7px;
}

.birth-wheel-labels {
  padding: 10px 4px 3px;
  color: var(--birth-wheel-muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}

.birth-wheel-columns {
  position: relative;
  height: calc(var(--birth-wheel-item-height) * 5);
  margin-bottom: 12px;
  overflow: hidden;
  direction: rtl;
}

.birth-wheel-columns::before,
.birth-wheel-columns::after {
  content: "";
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  height: calc(var(--birth-wheel-item-height) * 1.55);
  pointer-events: none;
}

.birth-wheel-columns::before { top: 0; background: linear-gradient(#fff 18%, rgba(255,255,255,0)); }
.birth-wheel-columns::after { bottom: 0; background: linear-gradient(rgba(255,255,255,0), #fff 82%); }

.birth-wheel-selection {
  position: absolute;
  z-index: 1;
  top: calc(50% - var(--birth-wheel-item-height) / 2);
  left: 1px;
  right: 1px;
  height: var(--birth-wheel-item-height);
  border-top: 1px solid #dfddff;
  border-bottom: 1px solid #dfddff;
  border-radius: 13px;
  background: #f2f1ff;
  pointer-events: none;
}

.birth-wheel {
  position: relative;
  z-index: 2;
  padding-block: calc(var(--birth-wheel-item-height) * 2);
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  direction: ltr;
  text-align: center;
  touch-action: pan-y;
}

.birth-wheel::-webkit-scrollbar { display: none; }

.birth-wheel__item {
  height: var(--birth-wheel-item-height);
  display: flex;
  align-items: center;
  justify-content: center;
  scroll-snap-align: center;
  color: #9a9eaa;
  font-size: 17px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  user-select: none;
  cursor: pointer;
  transform: scale(.94);
  transition: color .14s ease, transform .14s ease, opacity .14s ease;
}

.birth-wheel__item.is-active { color: var(--birth-wheel-text); font-size: 20px; font-weight: 850; transform: scale(1.04); }

.birth-wheel-confirm {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--birth-wheel-primary), var(--birth-wheel-primary-2));
  box-shadow: 0 11px 25px rgba(102, 91, 231, .27);
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.birth-wheel-confirm:hover,
.birth-wheel-confirm:focus-visible { outline: 3px solid rgba(102,91,231,.18); outline-offset: 2px; }
.birth-wheel-confirm:active { transform: translateY(1px) scale(.995); box-shadow: 0 7px 18px rgba(102,91,231,.22); }

body.dark-layout .birth-date-wheel-trigger,
html.dark .birth-date-wheel-trigger {
  color: #f4f5f8; border-color: #45495a; background: #252936;
}
body.dark-layout .birth-date-wheel-trigger__value,
html.dark .birth-date-wheel-trigger__value { color: #f4f5f8; }
body.dark-layout .birth-wheel-sheet,
html.dark .birth-wheel-sheet {
  --birth-wheel-text: #f5f6fb; --birth-wheel-muted: #aeb3c2;
  border-color: rgba(255,255,255,.08); background: #242734;
}
body.dark-layout .birth-wheel-columns::before,
html.dark .birth-wheel-columns::before { background: linear-gradient(#242734 18%, rgba(36,39,52,0)); }
body.dark-layout .birth-wheel-columns::after,
html.dark .birth-wheel-columns::after { background: linear-gradient(rgba(36,39,52,0), #242734 82%); }
body.dark-layout .birth-wheel-selection,
html.dark .birth-wheel-selection { background: #30334d; }
body.dark-layout .birth-wheel-preview,
html.dark .birth-wheel-preview { border-color: #41445f; background: #2c2f43; }

@media (min-width: 600px) {
  .birth-wheel-sheet { bottom: 18px; border-bottom: 1px solid rgba(255,255,255,.72); border-radius: 26px; }
}

@media (max-height: 610px) {
  :root { --birth-wheel-item-height: 43px; }
  .birth-wheel-sheet { max-height: 96dvh; }
  .birth-wheel-preview { padding-block: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .birth-wheel-sheet, .birth-wheel-backdrop, .birth-wheel__item,
  .birth-date-wheel-trigger { scroll-behavior: auto !important; transition: none !important; }
}
