/* First-open profile. Motion is transform and opacity, plus the sheet. */
.r12 {
  min-height: 100dvh;
  padding: 28px 18px 32px;
  background: linear-gradient(180deg, #f4f7f2 0%, #eaf3e8 100%);
  color: #102a16;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}
.r12-title {
  margin: 8px 0 18px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}
.r12-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 18px;
}
.r12-avatar {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #e8f0e6;
  color: #0b3514;
  display: grid;
  place-items: center;
  overflow: visible;
}
.r12-avatar img {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.r12-person { width: 54px; height: 54px; display: block; }
.r12-cam {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #ffad17;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 3px rgba(16, 42, 22, 0.18);
}
.r12-cam svg { width: 15px; height: 15px; display: block; }
.r12-caption {
  margin: 8px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #647066;
  font-size: 14px;
  font-weight: 700;
}
.r12-card {
  background: #fff;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(16, 42, 22, 0.05);
}
.r12-row {
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #e1e8df;
  background: #fff;
  color: #102a16;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto 16px;
  gap: 10px;
  align-items: center;
  text-align: left;
  transform: scale(1);
  transition: transform 100ms linear;
}
.r12-row:last-child { border-bottom: 0; }
.r12-row.is-pressed { transform: scale(0.98); }
.r12-row.r12-enter {
  animation: r12-rise 240ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(var(--i) * 40ms);
}
.r12-ico {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(11, 53, 20, 0.08);
  color: #0b3514;
  display: grid;
  place-items: center;
}
.r12-ico svg { width: 18px; height: 18px; display: block; }
.r12-label { font-size: 16px; font-weight: 700; }
.r12-value {
  color: #102a16;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}
.r12-value.is-empty { color: #647066; font-weight: 600; }
.r12-value.is-fresh { animation: r12-in 200ms ease both; }
.r12-chev { color: #647066; font-size: 18px; line-height: 1; }
.r12-note {
  margin: 14px 4px 18px;
  color: #647066;
  font-size: 13px;
  line-height: 1.55;
}
.r12-save {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  background: #ffe4a6;
  color: #0b3514;
  font-size: 17px;
  font-weight: 800;
  transition: background-color 200ms linear, color 200ms linear;
}
.r12-save.is-ready {
  background: #0b3514;
  color: #fff;
}
.r12-skip {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 0;
  background: transparent;
  color: #0b3514;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
}
.r12-back {
  position: absolute;
  top: 18px;
  left: 12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #0b3514;
  font-size: 22px;
}
.r12.is-edit { position: relative; padding-top: 56px; }

.r12-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(16, 42, 22, 0.28);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms linear;
  display: flex;
  align-items: flex-end;
}
.r12-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(8px);
}
.r12-backdrop.is-closing {
  opacity: 0;
  transition-duration: 220ms;
}
.r12-sheet {
  width: 100%;
  max-height: 78dvh;
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: #fff;
  color: #102a16;
  transform: translateY(100%);
  transition: transform 260ms cubic-bezier(0.16, 1, 0.3, 1);
}
.r12-backdrop.is-open .r12-sheet { transform: translateY(0); }
.r12-backdrop.is-closing .r12-sheet {
  transform: translateY(100%);
  transition-duration: 220ms;
}
.r12-grab {
  width: 40px;
  height: 4px;
  margin: 4px auto 12px;
  border-radius: 999px;
  background: #e1e8df;
}
.r12-sheet h2 {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 800;
}
.r12-field {
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 1px solid #e1e8df;
  border-radius: 14px;
  font: inherit;
  font-size: 17px;
  color: #102a16;
}
.r12-done,
.r12-option {
  width: 100%;
  min-height: 52px;
  margin-top: 10px;
  border: 0;
  border-radius: 14px;
  background: #f4f7f2;
  color: #102a16;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}
.r12-option { text-align: left; padding: 0 16px; }
.r12-option.is-on { box-shadow: inset 0 0 0 2px #0b3514; }
.r12-done { background: #0b3514; color: #fff; font-weight: 800; }
.r12-wheels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr));
  height: 180px;
  margin: 4px 0 8px;
}
.r12-wheels::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 72px;
  height: 36px;
  border-radius: 10px;
  background: rgba(11, 53, 20, 0.06);
  pointer-events: none;
}
.r12-wheel {
  height: 180px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
}
.r12-wheel::-webkit-scrollbar { display: none; }
.r12-wheel-item,
.r12-wheel-pad {
  height: 36px;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  color: #102a16;
  white-space: nowrap;
}
.r12-wheel-pad { scroll-snap-align: none; }

@keyframes r12-rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes r12-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-height: 820px) {
  .r12 { padding: 16px 16px 12px; }
  .r12-title { margin: 0 0 10px; font-size: 26px; }
  .r12-avatar,
  .r12-avatar img { width: 92px; height: 92px; }
  .r12-avatar-block { margin-bottom: 12px; }
  .r12-row { min-height: 50px; padding: 6px 12px; }
  .r12-note { margin: 10px 2px 12px; }
  .r12-save { min-height: 48px; }
  .r12-skip { margin-top: 2px; padding: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .r12-row,
  .r12-row.r12-enter,
  .r12-value.is-fresh,
  .r12-save,
  .r12-backdrop,
  .r12-sheet {
    animation: none;
    transition: none;
  }
  .r12-sheet,
  .r12-backdrop.is-open .r12-sheet,
  .r12-backdrop.is-closing .r12-sheet { transform: none; }
  .r12-backdrop.is-open { backdrop-filter: none; }
}
