.wheel-date-field {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

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

button.wheel-date-trigger {
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 12px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #ddd;
  border-radius: var(--radius-control);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  font-weight: normal;
  text-align: left;
  line-height: 1.35;
}

.wheel-date-trigger span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.wheel-date-trigger img {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

.wheel-date-trigger:disabled { cursor: wait; }

dialog.wheel-date-page {
  width: min(var(--app-width), calc(100% - 32px));
  max-width: calc(100% - 32px);
  height: var(--app-height);
  max-height: calc(100svh - 32px);
  margin: 16px auto auto;
  padding: 24px;
  border: 0;
  border-radius: var(--radius-card);
  background: #fff;
  color: var(--text);
  color-scheme: light;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.08);
}

.wheel-date-page::backdrop {
  background: var(--page-bg);
}

.wheel-date-layout {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.wheel-date-page,
.wheel-date-page * { -webkit-tap-highlight-color: transparent; }
#wheelDateTitle:focus { outline: none; }

.wheel-date-page .top-row { align-items: flex-start; }
.wheel-date-page h1 { font-size: 26px; overflow-wrap: anywhere; }

.wheel-date-page .wheel-date-back {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  gap: 6px;
}

.wheel-date-back img { width: 18px; height: 18px; }

.wheel-date-content {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  margin-top: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0;
}

.wheel-date-section { flex-shrink: 0; }
.wheel-date-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  color: var(--text);
  font-size: 16px;
  font-weight: bold;
  line-height: 20px;
}

.wheel-date-section h2 img { width: 20px; height: 20px; }
.wheel-time-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.wheel-date-group {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.wheel-date-column { flex: 1; min-width: 0; text-align: center; }
.wheel-date-frame {
  --wheel-row: 44px;
  --wheel-pad: 44px;
  position: relative;
  height: calc(var(--wheel-row) + 2 * var(--wheel-pad));
  overflow: hidden;
}

.wheel-date-page button.wheel-date-step {
  width: 44px;
  height: 44px;
  min-height: 44px;
  margin: 0 auto;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

.wheel-date-step img { width: 22px; height: 22px; }
.wheel-date-step-up img { transform: rotate(-90deg); }
.wheel-date-step-down img { transform: rotate(90deg); }
.wheel-date-page button.wheel-date-step:hover:not(:disabled) { background: var(--soft); }
.wheel-date-page button.wheel-date-step:disabled { cursor: default; }
.wheel-date-step:disabled img { opacity: .25; }

.wheel-date-frame::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: var(--wheel-pad);
  height: var(--wheel-row);
  border-radius: 8px;
  background: #edf5ff;
  pointer-events: none;
}

.wheel-date-wheel {
  position: relative;
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scroll-padding-block: var(--wheel-pad);
  scrollbar-width: none;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

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

.wheel-date-page button.wheel-date-option {
  width: 100%;
  height: var(--wheel-row);
  min-height: var(--wheel-row);
  margin: 0;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: var(--wheel-row);
  font-weight: normal;
  scroll-snap-align: center;
  touch-action: pan-y;
}

.wheel-date-option:first-child { margin-top: var(--wheel-pad) !important; }
.wheel-date-option:last-child { margin-bottom: var(--wheel-pad) !important; }
.wheel-date-page button.wheel-date-option[aria-selected="true"] { color: #1667c9; font-weight: bold; }
.wheel-date-wheel:focus-visible { outline: 2px solid var(--save-blue); outline-offset: -2px; border-radius: 8px; }

.wheel-date-footer { flex-shrink: 0; padding-top: 16px; }
.wheel-date-error { margin: 0 0 8px; color: var(--danger); font-size: 14px; }
.wheel-date-error:empty { display: none; }
.wheel-date-actions { display: flex; gap: 12px; }
.wheel-date-page .wheel-date-actions button { margin: 0; min-width: 0; flex: 1; padding: 12px 10px; }
.wheel-date-page button.wheel-date-reset { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.wheel-date-reset img { width: 20px; height: 20px; }
.wheel-date-page #wheelDateApply { background: var(--save-blue); }
.wheel-date-page button:hover,
.wheel-date-page button:active,
.wheel-date-page button:disabled,
button.wheel-date-trigger:hover,
button.wheel-date-trigger:active,
button.wheel-date-trigger:disabled { opacity: 1; animation: none; transition: none; }

@media (max-width: 359px) {
  dialog.wheel-date-page { padding: 20px; }
  .wheel-date-group { gap: 8px; }
  .wheel-date-actions { gap: 8px; }
  .wheel-date-page h1 { font-size: 24px; }
}
