/* 성장 시뮬레이터 날짜 입력 모양(생년월일 다이얼, 측정일 달력, 확인 줄). assets/growth-inputs.js 와 짝으로, 그 스크립트를 부르는 페이지는 모두 이 파일을 부른다.
   크기와 색은 페이지 값을 쓰고, 없으면 기본값. 고치면 python _tools/build_min_css.py */
/* 생년월일 다이얼: 평소 한 줄, .is-open 이면 그 칸만 세 줄로 펼쳐 다른 칸 위에 뜸(가운데 줄 = 고른 값) */
.dob-dial { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: var(--sp-1); }
.dial-col { position: relative; height: var(--ctl-h, 44px); }
.dial {
  position: absolute; left: 0; right: 0; top: 0; z-index: 1; height: var(--ctl-h, 44px); padding: 0; overflow-y: auto;
  scroll-snap-type: y mandatory; overscroll-behavior: contain; scrollbar-width: none; touch-action: pan-y;
  border: 1.5px solid var(--field, #e8eaec); border-radius: var(--radius-sm, 12px); background: var(--white, #fff);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 20' fill='none' stroke='%235f6e75' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 7.5L6 4l3.5 3.5M2.5 12.5L6 16l3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center; background-size: 10px 18px;
}
.dial::-webkit-scrollbar { display: none; }
.dial-col.is-open .dial {
  top: calc(var(--ctl-h, 44px) * -1); height: calc(var(--ctl-h, 44px) * 3); padding: var(--ctl-h, 44px) 0; z-index: 6;
  border-color: var(--sage); background-image: none; box-shadow: 0 12px 32px rgba(15,38,51,0.18);
}
.dial-col.is-open::after {   /* 펼쳤을 때 가운데 띠 */
  content: ''; position: absolute; left: var(--line-2, 2px); right: var(--line-2, 2px); top: 0; height: var(--ctl-h, 44px); z-index: 7;
  border-radius: var(--radius-sm, 12px); background: rgba(122,158,142,0.14); pointer-events: none;
}
.dob-dial[aria-invalid="true"] .dial { border-color: #b3261e; }
.dial:focus-visible { outline: var(--line-2, 2px) solid var(--sage); outline-offset: var(--line-1, 1px); }
.dial-item {
  height: var(--ctl-h, 44px); display: flex; align-items: center; justify-content: center; scroll-snap-align: center;
  font-size: var(--fs-sm); color: var(--text-sub); font-variant-numeric: tabular-nums; cursor: pointer; user-select: none;
}
.dial-col:not(.is-open) .dial-item { padding-right: var(--sp-2); }   /* 접혔을 때 화살표 자리 */
.dial-item.is-ph { color: var(--text-light); }
.dial-item.is-on { color: var(--text); font-weight: 700; }
.dial-item.is-on.is-ph { font-weight: 500; color: var(--text-light); }

.mdate {
  width: 100%; height: var(--ctl-h, 44px); padding: 0 calc(var(--sp-2) + 20px) 0 var(--sp-2); text-align: left; cursor: pointer;
  border: 1.5px solid var(--field, #e8eaec); border-radius: var(--radius-sm, 12px); background: var(--white, #fff); color: var(--text);
  font-size: var(--fs-sm); font-variant-numeric: tabular-nums;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235f6e75' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cpath d='M16 2v4M8 2v4M3 10h18'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px 18px;
}
.mdate:hover, .mdate:focus-visible { border-color: var(--sage); }
/* 측정일 달력: 상자 밖(페이지 맨 아래)에 붙으므로 색, 글꼴을 따로 정함 */
.mpop {
  --sage: #7a9e8e; --text: #1a2a32; --text-light: #5f6e75; --primary: #1b3a4b; --field: #e8eaec;
  position: fixed; inset: auto; margin: 0; width: min(320px, calc(100vw - 16px)); padding: var(--sp-2);
  border: var(--line-1, 1px) solid var(--field, #e8eaec); border-radius: var(--radius-lg); background: #fff; color: var(--text);
  box-shadow: 0 16px 40px rgba(15,38,51,0.22);
  font-family: var(--sans, 'IBM Plex Sans KR', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif); line-height: 1.4;
}
.mpop::backdrop { background: transparent; }
.mp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-1); }
.mp-head b { font-size: var(--fs-body); font-weight: 700; }
.mpop button { font: inherit; color: inherit; }
.mp-nav { width: var(--ctl-h, 44px); height: var(--ctl-h, 44px); border: none; border-radius: 50%; background: none; font-size: var(--fs-h3) !important; cursor: pointer; }
.mp-nav:hover:not(:disabled) { background: #f3f1ec; }
.mp-nav:disabled { opacity: 0.3; cursor: default; }
.mp-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.mp-wd span { padding-bottom: var(--sp-0, 4px); text-align: center; font-size: var(--fs-sm); color: var(--text-light); }
.mp-day {
  min-height: var(--ctl-h, 44px); border: var(--line-2, 2px) solid transparent; border-radius: var(--radius-sm, 12px); background: none; cursor: pointer;
  font-size: var(--fs-body) !important; font-weight: 500; font-variant-numeric: tabular-nums;
}
.mpop .sun { color: #c62828; }
.mpop .sat { color: #1e5aa8; }
.mp-day:hover:not(:disabled) { background: #f3f1ec; }
.mp-day.today { border-color: var(--sage); }
.mp-day.sel, .mp-day.sel:hover { background: var(--primary); color: #fff; }
.mp-day:disabled { color: var(--text-light); opacity: 0.35; cursor: default; }
.mp-day:focus-visible, .mp-nav:focus-visible, .mp-today:focus-visible { outline: var(--line-2, 2px) solid var(--primary); outline-offset: 1px; }
.mp-foot { display: flex; justify-content: flex-end; margin-top: var(--sp-1); }
.mp-today { min-height: var(--ctl-h, 44px); padding: 0 var(--sp-2); border: var(--line-1, 1px) solid var(--primary); border-radius: var(--radius-pill, 999px); background: #fff; color: var(--primary) !important; font-weight: 700; cursor: pointer; }

.gf-msg { margin: var(--sp-0, 4px) 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--text-light); text-align: right; }
.gf-msg.is-ok { color: var(--sage-text); font-weight: 500; }
.gf-msg.is-bad { color: #b3261e; }

@media (max-width: 480px) {
  .mdate, .dial-item { font-size: var(--fs-body); }   /* iOS 는 16px 보다 작은 입력 칸을 누르면 화면을 확대함 */
}
