/* Family Book — consistent DD/MM/YYYY date entry across devices */
.fb-date-field{
  position:relative;
  display:grid;
  grid-template-columns:minmax(0,1fr) 46px;
  width:100%;
  min-width:0;
  gap:0;
}
.fb-date-source{
  position:absolute!important;
  inline-size:1px!important;
  block-size:1px!important;
  opacity:0!important;
  pointer-events:none!important;
  overflow:hidden!important;
  inset:auto!important;
}
.fb-date-display{
  width:100%!important;
  min-width:0!important;
  padding-right:12px!important;
  border-top-right-radius:0!important;
  border-bottom-right-radius:0!important;
  cursor:text;
}
.fb-date-display.fb-date-invalid{
  border-color:#c96b6b!important;
  box-shadow:0 0 0 1px rgba(201,107,107,.3)!important;
}
.fb-date-button{
  min-width:46px;
  border:1px solid currentColor;
  border-left:0;
  border-radius:0 11px 11px 0;
  display:grid;
  place-items:center;
  background:transparent;
  color:inherit;
  cursor:pointer;
}
.fb-date-button svg{width:20px;height:20px}

.fb-date-overlay{
  position:fixed;
  inset:0;
  z-index:12000;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(0,0,0,.52);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}
.fb-date-overlay[hidden]{
  display:none!important;
}
.fb-date-dialog{
  width:min(420px,100%);
  border:1px solid rgba(132,161,136,.34);
  border-radius:24px;
  padding:20px;
  background:#f7f2e8;
  color:#243127;
  box-shadow:0 24px 70px rgba(0,0,0,.3);
}
html[data-theme="dark"] .fb-date-dialog{
  background:#182019;
  color:#f4eee4;
  border-color:#39443a;
}
.fb-date-dialog-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:14px;
}
.fb-date-dialog-head p{
  margin:0 0 2px;
  font-size:.72rem;
  font-weight:800;
  letter-spacing:.1em;
  text-transform:uppercase;
  opacity:.62;
}
.fb-date-dialog-head h2{
  margin:0;
  font-size:1.55rem;
  line-height:1.1;
}
.fb-date-close,
.fb-date-nav button{
  border:1px solid rgba(100,125,103,.34);
  background:transparent;
  color:inherit;
  display:grid;
  place-items:center;
  cursor:pointer;
}
.fb-date-close{
  width:42px;
  height:42px;
  border-radius:50%;
  flex:0 0 auto;
}
.fb-date-nav{
  display:grid;
  grid-template-columns:42px minmax(0,1fr) 42px;
  align-items:center;
  gap:8px;
  margin:8px 0 14px;
}
.fb-date-nav>button:not(.fb-date-month){
  width:42px;
  height:42px;
  border-radius:12px;
}
.fb-date-month{
  width:100%!important;
  min-width:0;
  min-height:42px;
  border-radius:12px;
  display:flex!important;
  align-items:center;
  justify-content:center;
  gap:7px;
  padding:8px 12px;
  font-weight:800;
  font-size:1rem;
}
.fb-date-month svg{
  width:16px;
  height:16px;
  opacity:.68;
}
.fb-date-month[aria-expanded="true"] svg{transform:rotate(180deg)}

.fb-date-jump{
  display:grid;
  grid-template-columns:1fr 120px;
  gap:12px;
  padding:14px;
  margin:0 0 14px;
  border:1px solid rgba(110,135,113,.24);
  border-radius:16px;
  background:rgba(123,170,137,.07);
}
.fb-date-jump[hidden],
.fb-date-calendar[hidden]{display:none!important}
.fb-date-jump label{
  display:grid;
  gap:6px;
  min-width:0;
}
.fb-date-jump label span{
  font-size:.68rem;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.06em;
  opacity:.62;
}
.fb-date-jump select,
.fb-date-jump input{
  width:100%;
  min-width:0;
  min-height:44px;
  padding:9px 10px;
  border:1px solid rgba(100,125,103,.34);
  border-radius:11px;
  background:transparent;
  color:inherit;
  font:inherit;
  font-weight:700;
}
.fb-date-jump-apply{
  grid-column:1/-1;
  min-height:42px;
  border:1px solid rgba(100,125,103,.34);
  border-radius:11px;
  background:#7faf8b;
  color:#102016;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}

.fb-date-weekdays,
.fb-date-grid{
  display:grid;
  grid-template-columns:repeat(7,1fr);
  gap:6px;
}
.fb-date-weekdays{
  margin-bottom:7px;
}
.fb-date-weekdays span{
  text-align:center;
  font-size:.68rem;
  font-weight:800;
  opacity:.56;
}
.fb-date-day,
.fb-date-blank{
  aspect-ratio:1;
  min-width:0;
}
.fb-date-day{
  border:0;
  border-radius:12px;
  background:transparent;
  color:inherit;
  font-weight:700;
  cursor:pointer;
}
.fb-date-day:hover{background:rgba(123,170,137,.14)}
.fb-date-day.today{box-shadow:inset 0 0 0 1px #7faf8b}
.fb-date-day.selected{
  background:#7faf8b;
  color:#102016;
}
.fb-date-day:disabled{
  opacity:.25;
  cursor:not-allowed;
}
.fb-date-dialog-foot{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:18px;
  padding-top:14px;
  border-top:1px solid rgba(110,135,113,.22);
}
.fb-date-dialog-foot small{opacity:.65}
.fb-date-clear{
  border:0;
  background:transparent;
  color:#6d8f76;
  font-weight:800;
  cursor:pointer;
  padding:8px 4px;
}

@media(max-width:560px){
  .fb-date-overlay{
    place-items:end center;
    padding:0;
  }
  .fb-date-dialog{
    width:100%;
    border-radius:24px 24px 0 0;
    padding:20px 18px calc(22px + env(safe-area-inset-bottom));
  }
  .fb-date-day{border-radius:11px}
  .fb-date-jump{
    grid-template-columns:1fr 110px;
  }
}
