/* Family Book — parent-controlled child profile creation */
.member-head-actions{
  margin-left:auto;
  display:flex;
  align-items:center;
  gap:10px;
  flex:0 0 auto;
}
.member-head-actions .member-add{
  position:static!important;
  margin:0!important;
}
.member-child-add{
  min-height:44px;
  padding:10px 16px!important;
  border-radius:14px!important;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  white-space:nowrap;
  font-weight:800;
  border-color:var(--fb-shell-border,var(--line))!important;
  background:var(--fb-shell-panel,var(--paper))!important;
  color:var(--fb-shell-accent,var(--accent))!important;
}
.member-child-add:hover,
.member-child-add:focus-visible{
  background:var(--fb-shell-accent-soft,color-mix(in srgb,var(--accent) 10%,var(--paper)))!important;
  border-color:var(--fb-shell-accent,var(--accent))!important;
}
.member-child-add svg{width:18px;height:18px}

.fb-add-child-backdrop{
  position:fixed;
  inset:0;
  z-index:10050;
  display:grid;
  place-items:center;
  padding:18px;
  background:rgba(0,0,0,.62);
  backdrop-filter:blur(5px);
}
.fb-add-child-card{
  width:min(100%,620px);
  max-height:min(90vh,760px);
  overflow:auto;
  box-sizing:border-box;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--paper);
  box-shadow:0 24px 80px rgba(0,0,0,.28);
  padding:22px;
}
.fb-add-child-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.fb-add-child-head span{
  display:block;
  margin-bottom:4px;
  color:var(--accent);
  font-size:.69rem;
  font-weight:900;
  letter-spacing:.1em;
}
.fb-add-child-head h2{
  margin:0;
  font-size:1.55rem;
  line-height:1.12;
}
.fb-add-child-head p{
  margin:6px 0 0;
  color:var(--muted);
  line-height:1.45;
}
.fb-add-child-close{
  width:40px;
  height:40px;
  flex:0 0 40px;
  display:grid;
  place-items:center;
  border:1px solid var(--line);
  border-radius:50%;
  background:transparent;
  color:var(--ink);
}
.fb-add-child-close svg{width:19px;height:19px}
.fb-add-child-form{display:grid;gap:16px}
.fb-add-child-form label{display:grid;gap:7px;font-weight:800}
.fb-add-child-form label>span{font-size:.84rem}
.fb-add-child-form label small{color:var(--muted);font-weight:650}
.fb-add-child-form input{
  width:100%;
  min-height:46px;
  box-sizing:border-box;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--soft);
  color:var(--ink);
  padding:0 13px;
  font:inherit;
}
.fb-add-child-form input:focus{
  outline:2px solid color-mix(in srgb,var(--accent) 32%,transparent);
  outline-offset:1px;
  border-color:var(--accent);
}
.fb-add-child-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}
.fb-add-child-note{
  display:flex;
  align-items:flex-start;
  gap:11px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:color-mix(in srgb,var(--accent) 7%,var(--paper));
}
.fb-add-child-note>svg{
  width:21px;
  height:21px;
  flex:0 0 21px;
  margin-top:1px;
  color:var(--accent);
}
.fb-add-child-note p{
  margin:0;
  color:var(--muted);
  font-size:.83rem;
  line-height:1.45;
}
.fb-add-child-note strong{color:var(--ink)}
.fb-add-child-error{
  padding:10px 12px;
  border-radius:11px;
  background:rgba(180,55,55,.12);
  color:#d97070;
  font-size:.82rem;
  font-weight:750;
}
.fb-add-child-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding-top:2px;
}
.fb-add-child-actions button{
  min-height:44px;
  padding:0 16px;
  border-radius:12px;
}

@media (max-width:560px){
  /* Keep the two member actions in their own top-right row. The eyebrow reserves
     the same vertical space, so the Family Members title can never sit under them. */
  .members-head{
    position:relative!important;
    display:block!important;
    width:100%!important;
  }
  .members-head>div{
    width:100%!important;
    padding-right:0!important;
  }
  .members-head .eyebrow{
    display:flex!important;
    align-items:center!important;
    min-height:42px!important;
    padding-right:104px!important;
    margin-bottom:4px!important;
  }
  .member-head-actions{
    position:absolute!important;
    right:2px!important;
    left:auto!important;
    top:0!important;
    width:auto!important;
    gap:7px;
    margin:0!important;
    justify-content:flex-end!important;
    align-items:center!important;
  }
  .member-head-actions .member-add,
  .member-head-actions .member-child-add{
    position:static!important;
    width:42px!important;
    height:42px!important;
    min-width:42px!important;
    min-height:42px!important;
    padding:0!important;
    margin:0!important;
    border-radius:50%!important;
  }
  .member-head-actions .member-add span,
  .member-head-actions .member-child-add span{display:none!important}
  .member-head-actions svg{width:20px!important;height:20px!important}

  .fb-add-child-backdrop{
    align-items:end;
    padding:0;
  }
  .fb-add-child-card{
    width:100%;
    max-height:92vh;
    border-radius:22px 22px 0 0;
    padding:19px 16px calc(20px + env(safe-area-inset-bottom));
  }
  .fb-add-child-grid{grid-template-columns:1fr}
  .fb-add-child-actions button{flex:1}
}
