/**
 * WGT / ZRG DOB modal layout — scoped to #wgt-dob-modal only.
 * Does not affect BZF / form-logic.js DOB fields.
 */

#wgt-dob-modal .wgt-dob-modal-dialog {
  padding: 12px 12px 10px;
}

#wgt-dob-modal .wgt-dob-modal-title {
  margin: 0 0 4px;
  font-size: 1.18rem;
  letter-spacing: 0.4px;
}

#wgt-dob-modal .wgt-dob-modal-subtitle {
  margin: 0 0 6px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  color: #6a5640;
}

#wgt-dob-modal .wgt-dob-modal-hint {
  margin: 0 0 10px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.4;
  color: #5a4836;
}

#wgt-dob-modal .wgt-dob-inner.dob-section {
  margin-bottom: 0;
}

#wgt-dob-modal .dob-type-row {
  display: block;
  margin-bottom: 8px;
}

#wgt-dob-modal .dob-type-row > .dob-label {
  display: block;
  margin: 0 0 6px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #3a2a18;
}

#wgt-dob-modal .wgt-dob-cal-seg.dob-type-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  border: 1.5px solid rgba(180, 140, 60, 0.55);
  border-radius: 10px;
  overflow: visible;
  background: #efe6d4;
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0;
  min-height: 40px;
  padding: 0 8px;
  font-size: 0.98rem;
  font-weight: 700;
  color: #6a5640;
  background: #faf6ee;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
  min-width: 0;
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label:first-child {
  border-radius: 8.5px 0 0 8.5px;
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label:last-child {
  border-radius: 0 8.5px 8.5px 0;
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label + .dob-type-radio-label {
  border-left: 1.5px solid rgba(180, 140, 60, 0.35);
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label input[type="radio"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label.is-selected {
  background: linear-gradient(180deg, #f0d78a 0%, #d4a84a 100%);
  color: #4a1808;
  box-shadow: inset 0 0 0 1px rgba(140, 100, 30, 0.45);
}

#wgt-dob-modal .wgt-dob-cal-seg .dob-type-radio-label:focus-within {
  outline: 2px solid rgba(160, 120, 40, 0.55);
  outline-offset: -2px;
  z-index: 1;
}

#wgt-dob-modal .dob-row-fields.unified-dob-row.wgt-dob-row-fields {
  display: flex !important;
  flex-direction: column !important;
  /* Beat mobile style.css .dob-row-fields { gap: 20px !important } */
  gap: 8px !important;
  align-items: stretch !important;
  width: 100% !important;
  margin: 0 !important;
}

#wgt-dob-modal .dob-date-row {
  display: block;
  width: 100%;
  margin: 0 !important;
  gap: 0;
  align-items: stretch !important;
}

#wgt-dob-modal #wgt-dob-solar-fields.wgt-dob-ymd,
#wgt-dob-modal #wgt-dob-lunar-fields.wgt-dob-ymd {
  display: grid;
  /* Year is 4 digits; give month more room for 閏月 labels (halfway from prior shift) */
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.28fr) minmax(0, 1fr);
  gap: 6px;
  width: 100%;
  align-items: stretch;
}

#wgt-dob-modal .wgt-dob-ymd-cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

#wgt-dob-modal .wgt-dob-ymd-cell .dob-unit {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #4a3a28;
  line-height: 1;
  flex-shrink: 0;
}

#wgt-dob-modal .wgt-dob-meta.dob-hour-gender-row {
  display: grid;
  /* Hour grows so this row is flush with calendar/date rows above */
  grid-template-columns: minmax(0, 1fr) 5.1rem max-content;
  column-gap: 8px;
  width: 100%;
  align-items: end !important;
  justify-content: stretch;
  margin: 0 !important;
}

#wgt-dob-modal .wgt-dob-meta .wgt-dob-field:first-child,
#wgt-dob-modal .wgt-dob-meta .wgt-dob-field:nth-child(2),
#wgt-dob-modal .wgt-dob-meta .wgt-dob-zodiac-field {
  width: 100%;
  max-width: none;
}

#wgt-dob-modal .wgt-dob-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

#wgt-dob-modal .wgt-dob-field > .dob-label {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: #3a2a18;
  line-height: 1.2;
}

#wgt-dob-modal .wgt-dob-zodiac-field {
  width: auto;
}

#wgt-dob-modal .wgt-dob-zodiac-field:has(#wgt-zodiac-sign:empty):has(#wgt-zodiac-name:empty) {
  visibility: hidden;
}

#wgt-dob-modal .wgt-dob-zodiac.zodiac-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35em; /* one space between symbol and name */
  margin: 0;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  background: #fffdf7;
  border: 1.5px solid rgba(160, 120, 55, 0.45);
  box-sizing: border-box;
  white-space: nowrap;
}

#wgt-dob-modal .wgt-dob-zodiac .zodiac-symbol,
#wgt-dob-modal .wgt-dob-zodiac .zodiac-name {
  margin: 0 !important;
  top: 0 !important;
  font-size: 1.02rem !important;
  line-height: 1.2 !important;
  font-weight: 700;
  color: #3a2a18;
}

#wgt-dob-modal .wgt-dob-zodiac .zodiac-symbol {
  font-size: 1.15rem !important;
}

/* Branded selects — override global .dob-row-fields select sizing */
#wgt-dob-modal .wgt-dob-inner select {
  box-sizing: border-box;
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
  height: 40px !important;
  margin: 0 !important;
  padding: 0 28px 0 8px;
  border: 1.5px solid rgba(160, 120, 55, 0.45);
  border-radius: 8px;
  background-color: #fffdf7;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%235a4836' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
  color: #2f1f0d;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.2;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

#wgt-dob-modal .wgt-dob-inner select:focus {
  outline: none;
  border-color: rgba(180, 140, 50, 0.85);
  box-shadow: 0 0 0 2px rgba(218, 165, 32, 0.28);
}

#wgt-dob-modal select#wgt-lunarHour {
  width: 100% !important;
  min-width: 0 !important;
  max-width: none !important;
}

#wgt-dob-modal .wgt-dob-actions {
  margin-top: 12px;
  gap: 8px 10px;
}

#wgt-dob-modal .wgt-dob-secondary-btn,
#wgt-dob-modal .wgt-dob-decline-btn {
  min-height: 44px;
  padding-top: 10px;
  padding-bottom: 10px;
}

#wgt-dob-modal .wgt-dob-secondary-btn {
  min-width: 0;
  font-size: 1.06rem;
  border-radius: 11px;
}

#wgt-dob-modal .wgt-dob-decline-btn {
  min-width: 0;
  font-size: 0.98rem;
  border-radius: 10px;
}

@media (max-width: 360px) {
  #wgt-dob-modal #wgt-dob-solar-fields.wgt-dob-ymd,
  #wgt-dob-modal #wgt-dob-lunar-fields.wgt-dob-ymd {
    gap: 4px;
  }

  #wgt-dob-modal .wgt-dob-inner select {
    font-size: 0.92rem;
    padding-left: 6px;
    padding-right: 24px;
  }
}
