/* /css/avonturenpad-ui.css
   ✅ Avonturenpad UI (v2.1.0)
   - child picker
   - hero swipe
   - bottom sheet
   - active-step arrows for parent reorder
*/

#view-avonturenpad {
  color: var(--tl-text, #111827);
}

.ap-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 14px;
}

.ap-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* =========================
   Header
========================= */

.ap-header {
  padding: 14px;
}

.ap-headerRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.ap-title {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.ap-sub {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 850;
  color: var(--tl-muted, #6b7280);
}

.ap-menuBtn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(17, 24, 39, 0.03);
  font-weight: 950;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* =========================
   Kids
========================= */

.ap-kidsRow {
  margin-bottom: 10px;
}

.ap-kids {
  display: flex;
  gap: 10px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0;
}

.ap-kids::-webkit-scrollbar {
  display: none;
}

.ap-kid {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(17, 24, 39, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  cursor: pointer;
}

.ap-kid.is-active {
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.10);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.ap-kidImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.ap-kidInit {
  font-weight: 950;
  color: rgba(17, 24, 39, 0.75);
}

/* =========================
   Week tabs
========================= */

.ap-week {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.ap-week::-webkit-scrollbar {
  display: none;
}

.ap-day {
  flex: 0 0 auto;
  min-width: 44px;
  height: 40px;
  padding: 0 10px;
  border-radius: 9999px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(17, 24, 39, 0.03);
  font-weight: 900;
  color: inherit;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
}

.ap-day.is-active {
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.10);
}

/* =========================
   Hero
========================= */

.ap-hero {
  padding: 16px;
}

.ap-heroInner {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: pan-y;
}

.ap-heroIcon {
  font-size: 140px;
  line-height: 1;
}

.ap-heroTitle {
  font-size: 30px;
  font-weight: 950;
  letter-spacing: -0.02em;
}

.ap-heroSub {
  font-size: 17px;
  font-weight: 850;
  color: var(--tl-muted, #6b7280);
  max-width: 26ch;
}

/* =========================
   Pad
========================= */

.ap-pad {
  padding: 12px;
}

.ap-padRow {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: nowrap;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
}

.ap-padRow::-webkit-scrollbar {
  display: none;
}

.ap-stepWrap {
  flex: 0 0 auto;
  min-width: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.ap-stepWrap.is-current {
  min-width: 92px;
}

.ap-step {
  width: 52px;
  height: 52px;
  border-radius: 9999px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(17, 24, 39, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.ap-step.is-done {
  opacity: 0.55;
}

.ap-step.is-active {
  border-color: rgba(124, 58, 237, 0.45);
  background: rgba(124, 58, 237, 0.10);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}

.ap-stepArrows {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.ap-arrow {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: #fff;
  color: #111827;
  font-weight: 950;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.ap-arrow.is-disabled,
.ap-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.ap-padHint {
  margin-top: 10px;
  text-align: center;
  color: rgba(17, 24, 39, 0.55);
  font-weight: 850;
  font-size: 13px;
}

.ap-empty {
  padding: 22px 16px;
  text-align: center;
  color: var(--tl-muted, #6b7280);
  font-weight: 850;
}

/* =========================
   Sheet
========================= */

.ap-sheetOpen {
  overflow: hidden;
}

.ap-sheetWrap {
  position: fixed;
  inset: 0;
  z-index: 20000;
}

.ap-sheetWrap.hidden {
  display: none;
}

.ap-sheetBackdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.40);
  backdrop-filter: blur(2px);
}

.ap-sheet {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid rgba(17, 24, 39, 0.10);
  box-shadow: 0 24px 60px rgba(17, 24, 39, 0.22);
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

.ap-sheetHandle {
  width: 44px;
  height: 5px;
  background: rgba(17, 24, 39, 0.18);
  border-radius: 999px;
  margin: 6px auto 10px;
}

.ap-sheetTop {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.ap-sheetH {
  font-size: 18px;
  font-weight: 950;
}

.ap-sheetP {
  margin-top: 4px;
  color: rgba(17, 24, 39, 0.58);
  font-weight: 850;
  font-size: 13px;
}

.ap-sheetClose {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(17, 24, 39, 0.03);
  font-weight: 950;
  cursor: pointer;
}

.ap-sheetActions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.ap-sheetBtn {
  flex: 1;
  min-height: 44px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: rgba(124, 58, 237, 0.10);
  color: rgba(17, 24, 39, 0.92);
  font-weight: 950;
  cursor: pointer;
}

.ap-sheetBtnSoft {
  background: rgba(17, 24, 39, 0.04);
}

.ap-sheetBtnPrimary {
  background: rgba(124, 58, 237, 0.18);
}

.ap-sheetBlock {
  margin-top: 14px;
}

.ap-sheetLabel {
  font-weight: 950;
  color: rgba(17, 24, 39, 0.78);
  margin: 8px 2px;
  font-size: 13px;
}

.ap-sheetList {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ap-sheetEmpty {
  padding: 12px;
  border-radius: 14px;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.08);
  font-weight: 850;
  color: rgba(17, 24, 39, 0.55);
}

.ap-sheetItem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 16px;
  background: rgba(17, 24, 39, 0.03);
  border: 1px solid rgba(17, 24, 39, 0.08);
}

.ap-sheetItemLeft {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.ap-sheetEmoji {
  font-size: 22px;
  width: 34px;
  text-align: center;
}

.ap-sheetTxt {
  min-width: 0;
}

.ap-sheetTitle {
  font-weight: 950;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-sheetSub {
  margin-top: 2px;
  font-weight: 850;
  color: rgba(17, 24, 39, 0.55);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ap-sheetDel {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: #fff;
  font-weight: 950;
  cursor: pointer;
}

.ap-add.hidden {
  display: none;
}

.ap-add {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.ap-addRow {
  display: flex;
  gap: 10px;
}

.ap-in {
  width: 100%;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.10);
  background: #fff;
  padding: 0 12px;
  font-weight: 850;
  box-sizing: border-box;
}

.ap-inEmoji {
  width: 86px;
  text-align: center;
}

.ap-addActions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

/* =========================
   Small devices
========================= */

@media (max-width: 390px) {
  .ap-heroInner {
    min-height: 280px;
  }

  .ap-heroIcon {
    font-size: 120px;
  }

  .ap-heroTitle {
    font-size: 28px;
  }

  .ap-stepWrap.is-current {
    min-width: 84px;
  }

  .ap-arrow {
    width: 32px;
    height: 32px;
  }
}